Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CTS] Skip images and fill2D tests if feature is not supported #2344

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/adapters/native_cpu/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
case UR_DEVICE_INFO_ENQUEUE_NATIVE_COMMAND_SUPPORT_EXP:
return ReturnValue(false);

case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED:
return ReturnValue(ur_bool_t{false});

case UR_DEVICE_INFO_USM_POOL_SUPPORT:
return ReturnValue(false);

Expand Down
1 change: 0 additions & 1 deletion test/conformance/device/device_adapter_native_cpu.match
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ urDeviceGetInfoTest.Success/UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRES
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_MAX_WORK_GROUPS_3D
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ASYNC_BARRIER
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES
urDeviceGetInfoTest.Success/UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion3D/*
{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/*
urEnqueueUSMAdviseTest.InvalidSizeTooLarge/*
urEnqueueUSMFill2DNegativeTest.OutOfBounds/*
{{OPT}}urEnqueueUSMMemcpyTest.Blocking/*
{{OPT}}urEnqueueUSMMemcpyTest.BlockingWithEvent/*
{{OPT}}urEnqueueUSMMemcpyTest.WaitForDependencies/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ urEnqueueKernelLaunchKernelWgSizeTest.Success/*
{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion2D/*
{{OPT}}urEnqueueMemImageWriteTest.InvalidRegion3D/*
{{OPT}}urEnqueueKernelLaunchMultiDeviceTest.KernelLaunchReadDifferentQueues/*
urEnqueueUSMFill2DNegativeTest.OutOfBounds/*
urEnqueueUSMAdviseTest.InvalidSizeTooLarge/*
urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/*
{{OPT}}urEnqueueTimestampRecordingExpTest.SuccessBlocking/*
10 changes: 0 additions & 10 deletions test/conformance/enqueue/enqueue_adapter_native_cpu.match
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,6 @@ urEnqueueEventsWaitWithBarrierOrderingTest.SuccessNonEventDependencies/*_
{{OPT}}urEnqueueUSMPrefetchTest.InvalidSizeZero/*
{{OPT}}urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/*
{{OPT}}urEnqueueUSMPrefetchTest.InvalidEventWaitList/*
{{OPT}}urEnqueueReadHostPipeTest.InvalidNullHandleQueue/*
{{OPT}}urEnqueueReadHostPipeTest.InvalidNullHandleProgram/*
{{OPT}}urEnqueueReadHostPipeTest.InvalidNullPointerPipeSymbol/*
{{OPT}}urEnqueueReadHostPipeTest.InvalidNullPointerBuffer/*
{{OPT}}urEnqueueReadHostPipeTest.InvalidEventWaitList/*
{{OPT}}urEnqueueWriteHostPipeTest.InvalidNullHandleQueue/*
{{OPT}}urEnqueueWriteHostPipeTest.InvalidNullHandleProgram/*
{{OPT}}urEnqueueWriteHostPipeTest.InvalidNullPointerPipeSymbol/*
{{OPT}}urEnqueueWriteHostPipeTest.InvalidNullPointerBuffer/*
{{OPT}}urEnqueueWriteHostPipeTest.InvalidEventWaitList/*
urEnqueueKernelLaunchIncrementMultiDeviceMultiThreadTest.Success/*
urEnqueueKernelLaunchIncrementMultiDeviceTest.Success/*
urEnqueueKernelLaunchIncrementTest.Success/*
Expand Down
11 changes: 8 additions & 3 deletions test/conformance/enqueue/urEnqueueUSMFill2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ TEST_P(urEnqueueUSMFill2DTestWithParam, Success) {

ur_event_handle_t event = nullptr;

ASSERT_SUCCESS(urEnqueueUSMFill2D(queue, ptr, pitch, pattern_size,
pattern.data(), width, height, 0, nullptr,
&event));
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
urEnqueueUSMFill2D(queue, ptr, pitch, pattern_size, pattern.data(),
width, height, 0, nullptr, &event));
EXPECT_SUCCESS(urQueueFlush(queue));

ASSERT_SUCCESS(urEventWait(1, &event));
Expand All @@ -161,6 +161,11 @@ struct urEnqueueUSMFill2DNegativeTest : uur::urQueueTest {

ASSERT_SUCCESS(urUSMDeviceAlloc(context, device, nullptr, nullptr,
allocation_size, &ptr));

UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
urEnqueueUSMFill2D(queue, ptr, pitch, pattern_size, pattern.data(),
width, height, 0, nullptr, nullptr));
ASSERT_SUCCESS(urQueueFinish(queue));
}

void TearDown() override {
Expand Down
15 changes: 0 additions & 15 deletions test/conformance/memory/memory_adapter_level_zero_v2.match

This file was deleted.

1 change: 0 additions & 1 deletion test/conformance/memory/memory_adapter_native_cpu.match
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ urMemBufferPartitionTest.InvalidValueCreateType/*
urMemBufferPartitionTest.InvalidValueBufferCreateInfoOutOfBounds/*
urMemGetInfoTestWithParam.Success/*
urMemGetInfoTest.InvalidSizeSmall/*
urMemImageCreateTestWithImageFormatParam.Success/*
urMemReleaseTest.Success/*
urMemReleaseTest.CheckReferenceCount/*
urMemRetainTest.Success/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ TEST_P(urMemImageCreateTestWithImageFormatParam, Success) {
}
}

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

if (!is_primary_image_format &&
res == UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT) {
GTEST_SKIP();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urMemImageCreateWithNativeHandleTest);

TEST_P(urMemImageCreateWithNativeHandleTest, Success) {
ur_native_handle_t native_handle = 0;
ASSERT_SUCCESS(urMemGetNativeHandle(image, device, &native_handle));
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
urMemGetNativeHandle(image, device, &native_handle));

ur_mem_handle_t mem = nullptr;
ASSERT_SUCCESS(urMemImageCreateWithNativeHandle(
Expand Down
21 changes: 12 additions & 9 deletions test/conformance/testing/include/uur/fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ struct urMemImageTest : urContextTest {
if (!imageSupported) {
GTEST_SKIP();
}
ASSERT_SUCCESS(urMemImageCreate(context, UR_MEM_FLAG_READ_WRITE,
&image_format, &image_desc, nullptr,
&image));
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
urMemImageCreate(context, UR_MEM_FLAG_READ_WRITE, &image_format,
&image_desc, nullptr, &image));
}

void TearDown() override {
Expand Down Expand Up @@ -323,8 +323,9 @@ template <class T> struct urMemImageTestWithParam : urContextTestWithParam<T> {
if (!imageSupported) {
GTEST_SKIP();
}
ASSERT_SUCCESS(urMemImageCreate(this->context, UR_MEM_FLAG_READ_WRITE,
&format, &desc, nullptr, &image));
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(
urMemImageCreate(this->context, UR_MEM_FLAG_READ_WRITE, &format,
&desc, nullptr, &image));
ASSERT_NE(nullptr, image);
}

Expand Down Expand Up @@ -373,17 +374,14 @@ struct urQueueTest : urContextTest {
struct urHostPipeTest : urQueueTest {
void SetUp() override {
UUR_RETURN_ON_FATAL_FAILURE(urQueueTest::SetUp());
UUR_RETURN_ON_FATAL_FAILURE(
uur::KernelsEnvironment::instance->LoadSource("foo", il_binary));
ASSERT_SUCCESS(uur::KernelsEnvironment::instance->CreateProgram(
platform, context, device, *il_binary, nullptr, &program));

size_t size = 0;
ASSERT_SUCCESS(urDeviceGetInfo(
device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, 0, nullptr,
&size));
ASSERT_NE(size, 0);
ASSERT_EQ(sizeof(ur_bool_t), size);

void *info_data = alloca(size);
ASSERT_SUCCESS(urDeviceGetInfo(
device, UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, size,
Expand All @@ -395,6 +393,11 @@ struct urHostPipeTest : urQueueTest {
if (!supported) {
GTEST_SKIP() << "Host pipe read/write is not supported.";
}

UUR_RETURN_ON_FATAL_FAILURE(
uur::KernelsEnvironment::instance->LoadSource("foo", il_binary));
ASSERT_SUCCESS(uur::KernelsEnvironment::instance->CreateProgram(
platform, context, device, *il_binary, nullptr, &program));
}

void TearDown() override {
Expand Down
Loading