mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Improve enqueue kernel error handling.
- Do not allow to enqueue parent kernel if there is no device queue. Change-Id: I0f06b8ed2387fc87abd652653f2c8bb8c4939a12 Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
5ab6386581
commit
e7901775a8
@@ -40,6 +40,10 @@ cl_int CommandQueueHw<GfxFamily>::enqueueKernel(
|
||||
auto &kernel = *castToObject<Kernel>(clKernel);
|
||||
const auto &kernelInfo = kernel.getKernelInfo();
|
||||
|
||||
if (kernel.isParentKernel && !this->context->getDefaultDeviceQueue()) {
|
||||
return CL_INVALID_OPERATION;
|
||||
}
|
||||
|
||||
if (!kernel.isPatched()) {
|
||||
if (event) {
|
||||
*event = nullptr;
|
||||
|
||||
@@ -882,3 +882,16 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelWhenAuxTrans
|
||||
EXPECT_EQ(1u, cmdQ.waitCalled);
|
||||
}
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueAuxKernelTests, givenParentKernelButNoDeviceQueueWhenEnqueueIsCalledItReturnsInvalidOperation) {
|
||||
if (pDevice->getSupportedClVersion() >= 20) {
|
||||
MyCmdQ<FamilyType> cmdQ(context, pDevice);
|
||||
size_t gws[3] = {1, 0, 0};
|
||||
|
||||
std::unique_ptr<MockParentKernel> parentKernel(MockParentKernel::create(*context, false, false, false, false, false));
|
||||
parentKernel->initialize();
|
||||
|
||||
auto status = cmdQ.enqueueKernel(parentKernel.get(), 1, nullptr, gws, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_INVALID_OPERATION, status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user