Revert "Erase from unwaited requests container on QoS abort (#3125)" (#3148)
authorKrzysztof Bruniecki <krzysztof.bruniecki@intel.com>
Mon, 16 Nov 2020 12:05:59 +0000 (13:05 +0100)
committerGitHub <noreply@github.com>
Mon, 16 Nov 2020 12:05:59 +0000 (15:05 +0300)
This reverts commit d7e98f605d157ebf3dd986b4336a9b0a76da7f80.

inference-engine/src/gna_plugin/gna_device.cpp

index 3b91033..133db7a 100644 (file)
@@ -310,14 +310,14 @@ const std::map <const std::pair<Gna2OperationType, int32_t>, const std::string>
 GnaWaitStatus GNADeviceHelper::wait(uint32_t reqId, int64_t millisTimeout) {
 #if GNA_LIB_VER == 2
     const auto status = Gna2RequestWait(reqId, millisTimeout);
-    if (status == Gna2StatusWarningDeviceBusy) {
-        return GNA_REQUEST_PENDING;
-    }
-    unwaitedRequestIds.erase(std::remove(unwaitedRequestIds.begin(), unwaitedRequestIds.end(), reqId));
     if (status == Gna2StatusDriverQoSTimeoutExceeded) {
         return GNA_REQUEST_ABORTED;
     }
+    if (status == Gna2StatusWarningDeviceBusy) {
+        return GNA_REQUEST_PENDING;
+    }
     checkGna2Status(status);
+    unwaitedRequestIds.erase(std::remove(unwaitedRequestIds.begin(), unwaitedRequestIds.end(), reqId));
 #else
     if (isPerformanceMeasuring) {
         nGNAStatus = GNAWaitPerfRes(nGNAHandle, millisTimeout, reqId, &nGNAPerfResults);