diff --git a/test/conformance/kernel/kernel_adapter_level_zero.match b/test/conformance/kernel/kernel_adapter_level_zero.match index 75b58b6d48..8194c7ddad 100644 --- a/test/conformance/kernel/kernel_adapter_level_zero.match +++ b/test/conformance/kernel/kernel_adapter_level_zero.match @@ -13,4 +13,14 @@ urKernelSetArgPointerTest.SuccessDevice/Intel_R__oneAPI_Unified_Runtime_over_Lev urKernelSetArgPointerTest.SuccessShared/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urKernelSetArgPointerNegativeTest.InvalidNullHandleKernel/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urKernelSetArgPointerNegativeTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -Segmentation fault +urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetArgValueTest.InvalidKernelArgumentIndex/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetArgValueTest.InvalidKernelArgumentSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetExecInfoTest.SuccessIndirectAccess/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetExecInfoUSMPointersTest.SuccessHost/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetExecInfoUSMPointersTest.SuccessDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetExecInfoUSMPointersTest.SuccessShared/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetSpecializationConstantsTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetSpecializationConstantsTest.InvalidNullHandleKernel/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetSpecializationConstantsTest.InvalidNullPointerSpecConstants/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urKernelSetSpecializationConstantsTest.InvalidSizeCount/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ diff --git a/test/conformance/kernel/kernel_adapter_opencl.match b/test/conformance/kernel/kernel_adapter_opencl.match index 9a890011d8..799225be19 100644 --- a/test/conformance/kernel/kernel_adapter_opencl.match +++ b/test/conformance/kernel/kernel_adapter_opencl.match @@ -1,7 +1,3 @@ -urKernelSetArgSamplerTest.Success/Intel_R__OpenCL___{{.*}}_ -urKernelSetArgSamplerTest.InvalidNullHandleKernel/Intel_R__OpenCL___{{.*}}_ -urKernelSetArgSamplerTest.InvalidNullHandleArgValue/Intel_R__OpenCL___{{.*}}_ -urKernelSetArgSamplerTest.InvalidKernelArgumentIndex/Intel_R__OpenCL___{{.*}}_ urKernelSetArgValueTest.InvalidKernelArgumentSize/Intel_R__OpenCL___{{.*}}_ urKernelSetSpecializationConstantsTest.Success/Intel_R__OpenCL___{{.*}}_ urKernelSetSpecializationConstantsTest.InvalidNullHandleKernel/Intel_R__OpenCL___{{.*}}_ diff --git a/test/conformance/kernel/urKernelSetArgPointer.cpp b/test/conformance/kernel/urKernelSetArgPointer.cpp index 50396eb2ed..11d26778c5 100644 --- a/test/conformance/kernel/urKernelSetArgPointer.cpp +++ b/test/conformance/kernel/urKernelSetArgPointer.cpp @@ -15,7 +15,7 @@ struct urKernelSetArgPointerTest : uur::urKernelExecutionTest { if (allocation) { ASSERT_SUCCESS(urUSMFree(context, allocation)); } - UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urKernelExecutionTest::TearDown()); } void ValidateAllocation(void *pointer) { diff --git a/test/conformance/kernel/urKernelSetArgSampler.cpp b/test/conformance/kernel/urKernelSetArgSampler.cpp index 814b79a153..37cb3401f2 100644 --- a/test/conformance/kernel/urKernelSetArgSampler.cpp +++ b/test/conformance/kernel/urKernelSetArgSampler.cpp @@ -5,8 +5,10 @@ #include -struct urKernelSetArgSamplerTest : uur::urKernelTest { +struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { void SetUp() { + program_name = "image_copy"; + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); // Images and samplers are not available on AMD ur_platform_backend_t backend; ASSERT_SUCCESS(urPlatformGetInfo(platform, UR_PLATFORM_INFO_BACKEND, @@ -14,9 +16,7 @@ struct urKernelSetArgSamplerTest : uur::urKernelTest { if (backend == UR_PLATFORM_BACKEND_HIP) { GTEST_SKIP() << "Sampler are not supported on hip."; } - - program_name = "image_copy"; - UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::SetUp()); + Build(); ur_sampler_desc_t sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* sType */ nullptr, /* pNext */ @@ -31,7 +31,7 @@ struct urKernelSetArgSamplerTest : uur::urKernelTest { if (sampler) { ASSERT_SUCCESS(urSamplerRelease(sampler)); } - UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::TearDown()); } ur_sampler_handle_t sampler = nullptr; diff --git a/test/conformance/kernel/urKernelSetSpecializationConstants.cpp b/test/conformance/kernel/urKernelSetSpecializationConstants.cpp index 9b2bce7208..665a20de4a 100644 --- a/test/conformance/kernel/urKernelSetSpecializationConstants.cpp +++ b/test/conformance/kernel/urKernelSetSpecializationConstants.cpp @@ -5,10 +5,10 @@ #include -struct urKernelSetSpecializationConstantsTest : uur::urKernelExecutionTest { +struct urKernelSetSpecializationConstantsTest : uur::urBaseKernelExecutionTest { void SetUp() override { program_name = "spec_constant"; - UUR_RETURN_ON_FATAL_FAILURE(urKernelExecutionTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelExecutionTest::SetUp()); bool supports_kernel_spec_constant = false; ASSERT_SUCCESS(urDeviceGetInfo( device, UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS, @@ -18,6 +18,7 @@ struct urKernelSetSpecializationConstantsTest : uur::urKernelExecutionTest { GTEST_SKIP() << "Device does not support setting kernel spec constants."; } + Build(); } uint32_t spec_value = 42; diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index 681db73f05..2ede84d135 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -1089,14 +1089,17 @@ template struct urProgramTestWithParam : urContextTestWithParam { ur_program_handle_t program = nullptr; }; -struct urKernelTest : urProgramTest { +struct urBaseKernelTest : urProgramTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urProgramTest::SetUp()); - ASSERT_SUCCESS(urProgramBuild(context, program, nullptr)); auto kernel_names = uur::KernelsEnvironment::instance->GetEntryPointNames(program_name); kernel_name = kernel_names[0]; ASSERT_FALSE(kernel_name.empty()); + } + + void Build() { + ASSERT_SUCCESS(urProgramBuild(context, program, nullptr)); ASSERT_SUCCESS(urKernelCreate(program, kernel_name.data(), &kernel)); } @@ -1111,15 +1114,26 @@ struct urKernelTest : urProgramTest { ur_kernel_handle_t kernel = nullptr; }; -template struct urKernelTestWithParam : urProgramTestWithParam { +struct urKernelTest : urBaseKernelTest { + void SetUp() override { + urBaseKernelTest::SetUp(); + Build(); + } +}; + +template +struct urBaseKernelTestWithParam : urProgramTestWithParam { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urProgramTestWithParam::SetUp()); - ASSERT_SUCCESS(urProgramBuild(this->context, this->program, nullptr)); auto kernel_names = uur::KernelsEnvironment::instance->GetEntryPointNames( this->program_name); kernel_name = kernel_names[0]; ASSERT_FALSE(kernel_name.empty()); + } + + void Build() { + ASSERT_SUCCESS(urProgramBuild(this->context, this->program, nullptr)); ASSERT_SUCCESS( urKernelCreate(this->program, kernel_name.data(), &kernel)); } @@ -1135,16 +1149,23 @@ template struct urKernelTestWithParam : urProgramTestWithParam { ur_kernel_handle_t kernel = nullptr; }; -struct urKernelExecutionTest : urKernelTest { +template struct urKernelTestWithParam : urBaseKernelTestWithParam { + void SetUp() override { + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTestWithParam::SetUp()); + urBaseKernelTestWithParam::Build(); + } +}; + +struct urBaseKernelExecutionTest : urBaseKernelTest { void SetUp() override { - UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::SetUp()); + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); } void TearDown() override { for (auto &buffer : buffer_args) { ASSERT_SUCCESS(urMemRelease(buffer)); } - UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::TearDown()); + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::TearDown()); } // Adds a kernel arg representing a sycl buffer constructed with a 1D range. @@ -1233,6 +1254,13 @@ struct urKernelExecutionTest : urKernelTest { uint32_t current_arg_index = 0; }; +struct urKernelExecutionTest : urBaseKernelExecutionTest { + void SetUp() { + UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelExecutionTest::SetUp()); + Build(); + } +}; + template struct GlobalVar { std::string name; T value;