SWDEV-376995 - Fixed misplaced checking

Change-Id: Ia3bddabfa7fc76066541fb81723136ae6cffb0a4


[ROCm/clr commit: d6a08403d8]
This commit is contained in:
victzhan
2023-02-16 12:41:20 -05:00
committed by Victor Zhang
parent 9c51780b13
commit 46652f12a2
+6 -4
View File
@@ -340,10 +340,6 @@ hipError_t ihipLaunchKernelCommand(amd::Command*& command, hipFunction_t f,
return hipErrorOutOfMemory;
}
if (kernelCommand->status() == CL_INVALID_OPERATION) {
kernelCommand->release();
return hipErrorIllegalState;
}
command = kernelCommand;
return hipSuccess;
@@ -398,6 +394,12 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
hip::Event* eStop = reinterpret_cast<hip::Event*>(stopEvent);
eStop->BindCommand(*command, false);
}
if (command->status() == CL_INVALID_OPERATION) {
command->release();
return hipErrorIllegalState;
}
command->release();
return hipSuccess;