mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Return error when Kernel SIMD size is not in expected range
Change-Id: Ic4411535cd97f6e4e2c0252c43ab90c78713c5c5 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
5d12bd8583
commit
9a4d515d3f
@@ -2732,6 +2732,36 @@ TEST(KernelTest, whenNullAllocationThenAssignNullPointerToCacheFlushVector) {
|
||||
EXPECT_EQ(nullptr, kernel.mockKernel->kernelArgRequiresCacheFlush[0]);
|
||||
}
|
||||
|
||||
TEST(KernelTest, givenKernelCompiledWithSimdSizeLowerThanExpectedWhenInitializingThenReturnError) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
|
||||
auto minSimd = HwHelper::get(device->getHardwareInfo().platform.eRenderCoreFamily).getMinimalSIMDSize();
|
||||
MockKernelWithInternals kernel(*device);
|
||||
kernel.executionEnvironment.CompiledSIMD32 = 0;
|
||||
kernel.executionEnvironment.CompiledSIMD16 = 0;
|
||||
kernel.executionEnvironment.CompiledSIMD8 = 1;
|
||||
|
||||
cl_int retVal = kernel.mockKernel->initialize();
|
||||
|
||||
if (minSimd > 8) {
|
||||
EXPECT_EQ(CL_INVALID_KERNEL, retVal);
|
||||
} else {
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(KernelTest, givenKernelCompiledWithSimdOneWhenInitializingThenReturnError) {
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
|
||||
MockKernelWithInternals kernel(*device);
|
||||
kernel.executionEnvironment.CompiledSIMD32 = 0;
|
||||
kernel.executionEnvironment.CompiledSIMD16 = 0;
|
||||
kernel.executionEnvironment.CompiledSIMD8 = 0;
|
||||
kernel.executionEnvironment.LargestCompiledSIMDSize = 1;
|
||||
|
||||
cl_int retVal = kernel.mockKernel->initialize();
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
TEST(KernelTest, whenAllocationRequiringCacheFlushThenAssignAllocationPointerToCacheFlushVector) {
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
|
||||
|
||||
Reference in New Issue
Block a user