SWDEV-376995 - Added if statement so that when AQL dispatch failed it returns corresponding hip error instead of hipSuccess

Change-Id: I0724fbcf0833c5dd8b2e4d6e443b3e226046dddf
This commit is contained in:
victzhan
2023-02-08 16:15:10 -05:00
committed by Victor Zhang
parent e34be4fbee
commit 4e324a9c63
+7 -1
View File
@@ -336,10 +336,16 @@ hipError_t ihipLaunchKernelCommand(amd::Command*& command, hipFunction_t f,
// Capture the kernel arguments
if (CL_SUCCESS != kernelCommand->captureAndValidate()) {
delete kernelCommand;
kernelCommand->release();
return hipErrorOutOfMemory;
}
if (kernelCommand->status() == CL_INVALID_OPERATION) {
kernelCommand->release();
return hipErrorIllegalState;
}
command = kernelCommand;
return hipSuccess;
}