Commit fc77109 1 parent cc6a9b8 commit fc77109 Copy full SHA for fc77109
File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -39,16 +39,15 @@ class FileRead : public StatelessOperator<CPUBackend> {
39
39
filenames_.resize (nsamples);
40
40
files_.resize (nsamples);
41
41
auto &tp = ws.GetThreadPool ();
42
+ FileStream::Options opts;
43
+ opts.use_mmap = !dont_use_mmap_;
44
+ opts.use_odirect = use_o_direct_;
45
+ opts.read_ahead = false ;
42
46
for (int i = 0 ; i < nsamples; i++) {
43
47
size_t filename_len = filepaths.tensor_shape_span (i)[0 ];
44
48
filenames_[i].resize (filename_len + 1 );
45
49
std::memcpy (&filenames_[i][0 ], filepaths.raw_tensor (i), filename_len);
46
50
filenames_[i][filename_len] = ' \0 ' ;
47
-
48
- FileStream::Options opts;
49
- opts.use_mmap = !dont_use_mmap_;
50
- opts.use_odirect = use_o_direct_;
51
- opts.read_ahead = false ;
52
51
tp.AddWork (
53
52
[&, i](int tid) {
54
53
files_[i] = FileStream::Open (filenames_[i], opts);
You can’t perform that action at this time.
0 commit comments