Skip to content

Commit

Permalink
[NativeCPU] implement missing query for HOST_PIPE support
Browse files Browse the repository at this point in the history
and skip pipe and fill2d tests if the feature is not supported
  • Loading branch information
igchor committed Dec 17, 2024
1 parent 16b6d46 commit b13d49f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 23 deletions.
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
3 changes: 0 additions & 3 deletions test/conformance/device/device_adapter_native_cpu.match
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ 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
1 change: 0 additions & 1 deletion test/conformance/enqueue/enqueue_adapter_level_zero.match
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
3 changes: 2 additions & 1 deletion test/conformance/memory/urMemImageCreateWithNativeHandle.cpp
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;
UUR_ASSERT_SUCCESS_OR_UNSUPPORTED(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
10 changes: 6 additions & 4 deletions test/conformance/testing/include/uur/fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,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 @@ -396,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

0 comments on commit b13d49f

Please sign in to comment.