Skip to content

Commit

Permalink
Merge pull request #2648 from aarongreig/aaron/fixEasyCLKnownErrors
Browse files Browse the repository at this point in the history
Fix the easily dealt with CL adapter KNOWN_FAILURES.
  • Loading branch information
aarongreig authored Jan 31, 2025
2 parents b959b36 + 8d64512 commit 992ff37
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 17 deletions.
1 change: 1 addition & 0 deletions test/conformance/device/urDeviceGetGlobalTimestamps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions test/conformance/kernel/urKernelGetGroupInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
1 change: 1 addition & 0 deletions test/conformance/kernel/urKernelGetSubGroupInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
16 changes: 12 additions & 4 deletions test/conformance/kernel/urKernelSetArgSampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
struct urKernelSetArgSamplerTestWithParam
: uur::urBaseKernelTestWithParam<uur::SamplerCreateParamT> {
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);
Expand All @@ -29,6 +27,12 @@ struct urKernelSetArgSamplerTestWithParam
UUR_RETURN_ON_FATAL_FAILURE(
uur::urBaseKernelTestWithParam<uur::SamplerCreateParamT>::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) {
Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 4 additions & 2 deletions test/conformance/memory/urMemGetInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
17 changes: 16 additions & 1 deletion test/conformance/memory/urMemImageCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,23 @@ 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());

if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
GTEST_SKIP() << "urMemImageCreate not supported";
}

ASSERT_SUCCESS(ret);
}

void TearDown() override {
Expand All @@ -51,6 +58,12 @@ struct urMemImageCreateTestWithParam
void SetUp() override {
UUR_RETURN_ON_FATAL_FAILURE(uur::urContextTestWithParam<Param>::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,
Expand All @@ -59,6 +72,8 @@ struct urMemImageCreateTestWithParam
if (ret == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) {
GTEST_SKIP() << "urMemImageCreate not supported";
}

ASSERT_SUCCESS(ret);
}

void TearDown() override {
Expand Down
11 changes: 8 additions & 3 deletions test/conformance/memory/urMemImageCreateWithImageFormatParam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ std::vector<ur_image_format_t> all_image_formats;
struct urMemImageCreateTestWithImageFormatParam
: uur::urContextTestWithParam<ur_image_format_t> {
void SetUp() {
UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"});
UUR_RETURN_ON_FATAL_FAILURE(
uur::urContextTestWithParam<ur_image_format_t>::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(
Expand All @@ -93,8 +97,9 @@ UUR_DEVICE_TEST_SUITE_P(
uur::deviceTestWithParamPrinter<ur_image_format_t>);

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;
Expand Down
9 changes: 7 additions & 2 deletions test/conformance/sampler/urSamplerCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
struct urSamplerCreateTestWithParam
: public uur::urContextTestWithParam<uur::SamplerCreateParamT> {
void SetUp() override {
UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"});

UUR_RETURN_ON_FATAL_FAILURE(
uur::urContextTestWithParam<uur::SamplerCreateParamT>::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 */
Expand All @@ -30,6 +34,7 @@ struct urSamplerCreateTestWithParam
ret == UR_RESULT_ERROR_UNINITIALIZED) {
GTEST_SKIP() << "urSamplerCreate not supported";
}
ASSERT_SUCCESS(ret);
}

void TearDown() override {
Expand Down
16 changes: 14 additions & 2 deletions test/conformance/testing/include/uur/fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -330,8 +336,14 @@ template <class T> struct urContextTestWithParam : urDeviceTestWithParam<T> {

template <class T> struct urSamplerTestWithParam : urContextTestWithParam<T> {
void SetUp() override {
UUR_KNOWN_FAILURE_ON(uur::OpenCL{"Intel(R) FPGA"});
UUR_RETURN_ON_FATAL_FAILURE(urContextTestWithParam<T>::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 */
Expand Down
2 changes: 1 addition & 1 deletion test/conformance/usm/urUSMGetMemAllocInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ UUR_DEVICE_TEST_SUITE_P(urUSMGetMemAllocInfoPoolTest,
uur::deviceTestWithParamPrinter<ur_usm_alloc_info_t>);

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;
Expand Down

0 comments on commit 992ff37

Please sign in to comment.