mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Removing dependent commandQueue kernels
Signed-off-by: Andrzej Koska <andrzej.koska@intel.com> Related-To: NEO-6212
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
34ad95ae12
commit
bd9457262e
@ -2830,4 +2830,49 @@ HWTEST_F(GTPinTestsWithLocalMemory, givenGtPinCanUseSharedAllocationWhenGtpinNot
|
||||
mockGAHandle.reset();
|
||||
allocDataHandle.reset();
|
||||
}
|
||||
|
||||
TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenGtpinRemoveCommandQueueIsCalledThenAllKernelsFromCmdQueueAreRemoved) {
|
||||
gtpinCallbacks.onContextCreate = OnContextCreate;
|
||||
gtpinCallbacks.onContextDestroy = OnContextDestroy;
|
||||
gtpinCallbacks.onKernelCreate = OnKernelCreate;
|
||||
gtpinCallbacks.onKernelSubmit = OnKernelSubmit;
|
||||
gtpinCallbacks.onCommandBufferCreate = OnCommandBufferCreate;
|
||||
gtpinCallbacks.onCommandBufferComplete = OnCommandBufferComplete;
|
||||
retFromGtPin = GTPin_Init(>pinCallbacks, &driverServices, nullptr);
|
||||
EXPECT_EQ(GTPIN_DI_SUCCESS, retFromGtPin);
|
||||
|
||||
kernelExecQueue.clear();
|
||||
|
||||
CommandQueue *cmdQ1 = reinterpret_cast<CommandQueue *>(1);
|
||||
CommandQueue *cmdQ2 = reinterpret_cast<CommandQueue *>(2);
|
||||
Kernel *kernel1 = reinterpret_cast<Kernel *>(1);
|
||||
Kernel *kernel2 = reinterpret_cast<Kernel *>(2);
|
||||
Kernel *kernel3 = reinterpret_cast<Kernel *>(3);
|
||||
Kernel *kernel4 = reinterpret_cast<Kernel *>(4);
|
||||
|
||||
gtpinkexec_t kExec;
|
||||
kExec.pKernel = kernel1;
|
||||
kExec.pCommandQueue = cmdQ1;
|
||||
kernelExecQueue.push_back(kExec);
|
||||
|
||||
kExec.pKernel = kernel2;
|
||||
kExec.pCommandQueue = cmdQ1;
|
||||
kernelExecQueue.push_back(kExec);
|
||||
|
||||
kExec.pKernel = kernel3;
|
||||
kExec.pCommandQueue = cmdQ2;
|
||||
kernelExecQueue.push_back(kExec);
|
||||
|
||||
kExec.pKernel = kernel4;
|
||||
kExec.pCommandQueue = cmdQ2;
|
||||
kernelExecQueue.push_back(kExec);
|
||||
EXPECT_EQ(4u, kernelExecQueue.size());
|
||||
|
||||
gtpinRemoveCommandQueue(cmdQ1);
|
||||
EXPECT_EQ(2u, kernelExecQueue.size());
|
||||
|
||||
gtpinRemoveCommandQueue(cmdQ2);
|
||||
EXPECT_EQ(0u, kernelExecQueue.size());
|
||||
}
|
||||
|
||||
} // namespace ULT
|
||||
|
Reference in New Issue
Block a user