MCPcopy Create free account
hub / github.com/alibaba/MNN / workerThread

Method workerThread

tools/train/source/data/DataLoader.cpp:66–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void DataLoader::workerThread() {
67 while (true) {
68 auto currentJob = mJobs->pop();
69 if (currentJob.quit) {
70 break;
71 }
72 // make sure there are no empty jobs, so that there are no empty batch
73 MNN_ASSERT(currentJob.job.size() != 0);
74 auto batch = mDataset->getBatch(currentJob.job);
75 mDataQueue->push(std::move(batch));
76 }
77}
78
79void DataLoader::join() {
80 for (int i = 0; i < mConfig->numWorkers; i++) {

Callers

nothing calls this directly

Calls 3

popMethod · 0.45
sizeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected