MCPcopy Create free account
hub / github.com/NVIDIA/DALI / RunImpl

Method RunImpl

dali/operators/decoder/numpy.cc:150–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149
150void NumpyDecoder::RunImpl(Workspace &ws) {
151 const auto &input = ws.Input<CPUBackend>(0);
152 auto &output = ws.Output<CPUBackend>(0);
153 auto &tPool = ws.GetThreadPool();
154
155 for (int sampleIdx = 0; sampleIdx < input.num_samples(); ++sampleIdx) {
156 tPool.AddWork([&, sampleIdx](int) {
157 const numpy::HeaderData &header = headers_[sampleIdx];
158 ConstSampleView<CPUBackend> inputView(
159 static_cast<const uint8_t *>(input.raw_tensor(sampleIdx)) + header.data_offset,
160 header.shape, header.type());
161 RunDecoding(output[sampleIdx], std::move(inputView), header);
162 });
163 }
164 tPool.RunAll();
165}
166
167DALI_REGISTER_OPERATOR(decoders__Numpy, NumpyDecoder, CPU);
168

Callers

nothing calls this directly

Calls 6

RunDecodingFunction · 0.85
GetThreadPoolMethod · 0.80
num_samplesMethod · 0.45
AddWorkMethod · 0.45
typeMethod · 0.45
RunAllMethod · 0.45

Tested by

no test coverage detected