Forum Discussion
RubenPadial
Contributor
9 months agoHello @JohnT_Intel ,
As I said, it also included in dla_bechmark as well as the application I shared with you. It doesn't work. Find below the code extracted:
for (size_t iireq = 0; iireq < nireq; iireq++) { auto inferRequest = inferRequestsQueues.at(net_id)->getIdleRequest(); if (!inferRequest) { THROW_IE_EXCEPTION << "No idle Infer Requests!"; } if(niter != 0LL){ std::cout << "#Debug: 10. Set output blob.\n"; for (auto & item : outputInfos.at(net_id)) { std::string currOutputName = item.first; auto currOutputBlob = ioBlobs.at(net_id).second[iterations.at(net_id)][currOutputName]; inferRequest->SetBlob(currOutputName, currOutputBlob); } std::cout << "#Debug: 10. Set input blob.\n"; for (auto & item: inputInfos.at(net_id)){ std::string currInputName = item.first; auto currInputBlob = ioBlobs.at(net_id).first[iterations.at(net_id)][currInputName]; inferRequest->SetBlob(currInputName, currInputBlob); } } // Execute one request/batch if (FLAGS_api == "sync") { inferRequest->infer(); } else { // As the inference request is currently idle, the wait() adds no additional overhead (and should return immediately). // The primary reason for calling the method is exception checking/re-throwing. // Callback, that governs the actual execution can handle errors as well, // but as it uses just error codes it has no details like ‘what()’ method of `std::exception` // So, rechecking for any exceptions here. inferRequest->wait(); inferRequest->startAsync(); } iterations.at(net_id) ++; if (net_id == exeNetworks.size() - 1) { execTime = std::chrono::duration_cast<ns>(Time::now() - startTime).count(); if (niter > 0) { progressBar.addProgress(1); } else { // calculate how many progress intervals are covered by current iteration. // depends on the current iteration time and time of each progress interval. // Previously covered progress intervals must be skipped. auto progressIntervalTime = duration_nanoseconds / progressBarTotalCount; size_t newProgress = execTime / progressIntervalTime - progressCnt; progressBar.addProgress(newProgress); progressCnt += newProgress; } } }