From 6ba7eaa0a7c270c732870b0c77f70a1f5ef5bf35 Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Tue, 28 Jan 2025 17:22:35 +0000 Subject: [PATCH 1/2] Fix the easily dealt with CL adapter KNOWN_FAILURES. --- .../kernel/urKernelSetArgSampler.cpp | 16 ++++++++++++---- test/conformance/memory/urMemGetInfo.cpp | 6 ++++-- test/conformance/memory/urMemImageCreate.cpp | 17 ++++++++++++++++- .../urMemImageCreateWithImageFormatParam.cpp | 6 +++++- test/conformance/sampler/urSamplerCreate.cpp | 9 +++++++-- test/conformance/testing/include/uur/fixtures.h | 16 ++++++++++++++-- test/conformance/usm/urUSMGetMemAllocInfo.cpp | 2 +- 7 files changed, 59 insertions(+), 13 deletions(-) diff --git a/test/conformance/kernel/urKernelSetArgSampler.cpp b/test/conformance/kernel/urKernelSetArgSampler.cpp index ff039c76ce..c8dab5c435 100644 --- a/test/conformance/kernel/urKernelSetArgSampler.cpp +++ b/test/conformance/kernel/urKernelSetArgSampler.cpp @@ -10,8 +10,6 @@ struct urKernelSetArgSamplerTestWithParam : uur::urBaseKernelTestWithParam { void SetUp() { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); - const auto param = getParam(); const auto normalized = std::get<0>(param); const auto addr_mode = std::get<1>(param); @@ -29,6 +27,12 @@ struct urKernelSetArgSamplerTestWithParam UUR_RETURN_ON_FATAL_FAILURE( uur::urBaseKernelTestWithParam::SetUp()); + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } + auto ret = urSamplerCreate(context, &sampler_desc, &sampler); if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE || ret == UR_RESULT_ERROR_UNINITIALIZED) { @@ -72,11 +76,15 @@ TEST_P(urKernelSetArgSamplerTestWithParam, Success) { struct urKernelSetArgSamplerTest : uur::urBaseKernelTest { void SetUp() { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); - program_name = "image_copy"; UUR_RETURN_ON_FATAL_FAILURE(urBaseKernelTest::SetUp()); + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } + ur_sampler_desc_t sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* sType */ nullptr, /* pNext */ diff --git a/test/conformance/memory/urMemGetInfo.cpp b/test/conformance/memory/urMemGetInfo.cpp index d307a34fc0..1fbebcc8df 100644 --- a/test/conformance/memory/urMemGetInfo.cpp +++ b/test/conformance/memory/urMemGetInfo.cpp @@ -116,7 +116,7 @@ struct urMemGetInfoImageTest : uur::urMemImageTest { UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemGetInfoImageTest); TEST_P(urMemGetInfoImageTest, SuccessSize) { - UUR_KNOWN_FAILURE_ON(uur::LevelZero{}, uur::OpenCL{"UHD Graphics"}); + UUR_KNOWN_FAILURE_ON(uur::LevelZero{}); ur_mem_info_t property_name = UR_MEM_INFO_SIZE; size_t property_size = 0; @@ -135,7 +135,9 @@ TEST_P(urMemGetInfoImageTest, SuccessSize) { image_desc.arraySize * image_desc.width * image_desc.height * image_desc.depth; - ASSERT_EQ(image_size_bytes, expected_image_size); + // Make sure the driver has allocated enough space to hold the image (the + // actual size may be padded out to above the requested size) + ASSERT_GE(image_size_bytes, expected_image_size); } TEST_P(urMemGetInfoImageTest, SuccessContext) { diff --git a/test/conformance/memory/urMemImageCreate.cpp b/test/conformance/memory/urMemImageCreate.cpp index 94be2f3f5a..db9d280c73 100644 --- a/test/conformance/memory/urMemImageCreate.cpp +++ b/test/conformance/memory/urMemImageCreate.cpp @@ -26,9 +26,14 @@ static ur_image_desc_t image_desc{ struct urMemImageCreateTest : public uur::urContextTest { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTest::SetUp()); + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } + uur::raii::Mem image_handle = nullptr; auto ret = urMemImageCreate(context, UR_MEM_FLAG_READ_WRITE, &image_format, &image_desc, nullptr, image_handle.ptr()); @@ -36,6 +41,8 @@ struct urMemImageCreateTest : public uur::urContextTest { if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { GTEST_SKIP() << "urMemImageCreate not supported"; } + + ASSERT_SUCCESS(ret); } void TearDown() override { @@ -51,6 +58,12 @@ struct urMemImageCreateTestWithParam void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTestWithParam::SetUp()); + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(this->device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } + uur::raii::Mem image_handle = nullptr; auto ret = urMemImageCreate(this->context, UR_MEM_FLAG_READ_WRITE, &image_format, @@ -59,6 +72,8 @@ struct urMemImageCreateTestWithParam if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { GTEST_SKIP() << "urMemImageCreate not supported"; } + + ASSERT_SUCCESS(ret); } void TearDown() override { diff --git a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp index 1764e59793..c47c1f7883 100644 --- a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp +++ b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp @@ -67,9 +67,13 @@ std::vector all_image_formats; struct urMemImageCreateTestWithImageFormatParam : uur::urContextTestWithParam { void SetUp() { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE( uur::urContextTestWithParam::SetUp()); + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } } void TearDown() { UUR_RETURN_ON_FATAL_FAILURE( diff --git a/test/conformance/sampler/urSamplerCreate.cpp b/test/conformance/sampler/urSamplerCreate.cpp index fca552eaa5..6b801dea8f 100644 --- a/test/conformance/sampler/urSamplerCreate.cpp +++ b/test/conformance/sampler/urSamplerCreate.cpp @@ -11,11 +11,15 @@ struct urSamplerCreateTestWithParam : public uur::urContextTestWithParam { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); - UUR_RETURN_ON_FATAL_FAILURE( uur::urContextTestWithParam::SetUp()); + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } + ur_sampler_desc_t sampler_desc{ UR_STRUCTURE_TYPE_SAMPLER_DESC, /* stype */ nullptr, /* pNext */ @@ -30,6 +34,7 @@ struct urSamplerCreateTestWithParam ret == UR_RESULT_ERROR_UNINITIALIZED) { GTEST_SKIP() << "urSamplerCreate not supported"; } + ASSERT_SUCCESS(ret); } void TearDown() override { diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index 4f6aa816ea..f4776fa25a 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -205,8 +205,14 @@ struct urContextTest : urDeviceTest { struct urSamplerTest : urContextTest { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE(urContextTest::SetUp()); + + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } + sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* stype */ nullptr, /* pNext */ @@ -330,8 +336,14 @@ template struct urContextTestWithParam : urDeviceTestWithParam { template struct urSamplerTestWithParam : urContextTestWithParam { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam::SetUp()); + + bool image_support = false; + ASSERT_SUCCESS(uur::GetDeviceImageSupport(this->device, image_support)); + if (!image_support) { + GTEST_SKIP() << "Device doesn't support images"; + } + sampler_desc = { UR_STRUCTURE_TYPE_SAMPLER_DESC, /* stype */ nullptr, /* pNext */ diff --git a/test/conformance/usm/urUSMGetMemAllocInfo.cpp b/test/conformance/usm/urUSMGetMemAllocInfo.cpp index a181e5ebfe..e27c643472 100644 --- a/test/conformance/usm/urUSMGetMemAllocInfo.cpp +++ b/test/conformance/usm/urUSMGetMemAllocInfo.cpp @@ -25,7 +25,7 @@ UUR_DEVICE_TEST_SUITE_P(urUSMGetMemAllocInfoPoolTest, uur::deviceTestWithParamPrinter); TEST_P(urUSMGetMemAllocInfoPoolTest, SuccessPool) { - UUR_KNOWN_FAILURE_ON(uur::OpenCL{}, uur::LevelZeroV2{}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}); size_t property_size = 0; ur_usm_alloc_info_t property_name = UR_USM_ALLOC_INFO_POOL; From 8d6451223a4f9047d77b13d59681ad5f2faaa9fe Mon Sep 17 00:00:00 2001 From: Aaron Greig Date: Thu, 30 Jan 2025 16:27:16 +0000 Subject: [PATCH 2/2] Add links to issues. --- test/conformance/device/urDeviceGetGlobalTimestamps.cpp | 1 + test/conformance/kernel/urKernelGetGroupInfo.cpp | 5 +++-- test/conformance/kernel/urKernelGetSubGroupInfo.cpp | 1 + .../memory/urMemImageCreateWithImageFormatParam.cpp | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/conformance/device/urDeviceGetGlobalTimestamps.cpp b/test/conformance/device/urDeviceGetGlobalTimestamps.cpp index 3fe76cfc51..f87004f2c1 100644 --- a/test/conformance/device/urDeviceGetGlobalTimestamps.cpp +++ b/test/conformance/device/urDeviceGetGlobalTimestamps.cpp @@ -31,6 +31,7 @@ using urDeviceGetGlobalTimestampTest = uur::urDeviceTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urDeviceGetGlobalTimestampTest); TEST_P(urDeviceGetGlobalTimestampTest, Success) { + // See https://github.com/oneapi-src/unified-runtime/issues/2633 UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"}); uint64_t device_time = 0; diff --git a/test/conformance/kernel/urKernelGetGroupInfo.cpp b/test/conformance/kernel/urKernelGetGroupInfo.cpp index 9bf7309c0a..0708e72b4c 100644 --- a/test/conformance/kernel/urKernelGetGroupInfo.cpp +++ b/test/conformance/kernel/urKernelGetGroupInfo.cpp @@ -46,8 +46,9 @@ TEST_P(urKernelGetGroupInfoFixedWorkGroupSizeTest, struct urKernelGetGroupInfoMaxWorkGroupSizeTest : uur::urKernelTest { void SetUp() override { - UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, - uur::OpenCL{"12th Gen", "13th Gen", "Intel(R) Xeon"}); + UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}); + // see https://github.com/oneapi-src/unified-runtime/issues/2644 + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"12th Gen", "13th Gen", "Intel(R) Xeon"}); program_name = "max_wg_size"; UUR_RETURN_ON_FATAL_FAILURE(urKernelTest::SetUp()); } diff --git a/test/conformance/kernel/urKernelGetSubGroupInfo.cpp b/test/conformance/kernel/urKernelGetSubGroupInfo.cpp index 10eb9fcfe8..2c1f29235d 100644 --- a/test/conformance/kernel/urKernelGetSubGroupInfo.cpp +++ b/test/conformance/kernel/urKernelGetSubGroupInfo.cpp @@ -10,6 +10,7 @@ struct urKernelGetSubGroupInfoFixedSubGroupSizeTest : uur::urKernelTest { void SetUp() override { + // See https://github.com/oneapi-src/unified-runtime/issues/2514 UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::HIP{}, uur::OpenCL{}, uur::LevelZero{}, uur::LevelZeroV2{}); program_name = "fixed_sg_size"; diff --git a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp index c47c1f7883..666dc1ec65 100644 --- a/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp +++ b/test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp @@ -97,8 +97,9 @@ UUR_DEVICE_TEST_SUITE_P( uur::deviceTestWithParamPrinter); TEST_P(urMemImageCreateTestWithImageFormatParam, Success) { - UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{}, - uur::OpenCL{"Intel(R) UHD Graphics 770"}); + UUR_KNOWN_FAILURE_ON(uur::LevelZeroV2{}, uur::NativeCPU{}); + // See https://github.com/oneapi-src/unified-runtime/issues/2638 + UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) UHD Graphics 770"}); ur_image_channel_order_t channel_order = std::get<1>(GetParam()).channelOrder; ur_image_channel_type_t channel_type = std::get<1>(GetParam()).channelType;