Skip to content

Commit 5ad3f0a

Browse files
committed
Merge branch 'aaron/clErrorCodeMapping' into aaron/clCTSFixMegaBranch
2 parents 74ad837 + 16e28e2 commit 5ad3f0a

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

source/adapters/opencl/common.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ ur_result_t mapCLErrorToUR(cl_int Result) {
6060
return UR_RESULT_ERROR_OUT_OF_RESOURCES;
6161
case CL_INVALID_MEM_OBJECT:
6262
return UR_RESULT_ERROR_INVALID_MEM_OBJECT;
63+
case CL_INVALID_QUEUE_PROPERTIES:
64+
return UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES;
65+
case CL_INVALID_BUFFER_SIZE:
66+
return UR_RESULT_ERROR_INVALID_BUFFER_SIZE;
67+
case CL_INVALID_IMAGE_SIZE:
68+
return UR_RESULT_ERROR_INVALID_IMAGE_SIZE;
69+
case CL_INVALID_IMAGE_FORMAT_DESCRIPTOR:
70+
case CL_INVALID_IMAGE_DESCRIPTOR:
71+
return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR;
72+
case CL_IMAGE_FORMAT_NOT_SUPPORTED:
73+
return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT;
74+
case CL_PROFILING_INFO_NOT_AVAILABLE:
75+
return UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE;
76+
case CL_LINK_PROGRAM_FAILURE:
77+
return UR_RESULT_ERROR_PROGRAM_LINK_FAILURE;
78+
case CL_INVALID_ARG_INDEX:
79+
return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX;
6380
default:
6481
return UR_RESULT_ERROR_UNKNOWN;
6582
}

test/conformance/queue/queue_adapter_cuda.match

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
urQueueCreateTest.InvalidValueProperties/NVIDIA_CUDA_BACKEND___{{.*}}_
21
urQueueCreateTest.InvalidQueueProperties/NVIDIA_CUDA_BACKEND___{{.*}}_
32
urQueueCreateWithNativeHandleTest.Success/NVIDIA_CUDA_BACKEND___{{.*}}_
43
urQueueGetInfoTestWithInfoParam.Success/NVIDIA_CUDA_BACKEND___{{.*}}___UR_QUEUE_INFO_DEVICE_DEFAULT

test/conformance/queue/queue_adapter_hip.match

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
urQueueCreateTest.InvalidValueProperties/AMD_HIP_BACKEND___{{.*}}_
21
urQueueCreateTest.InvalidQueueProperties/AMD_HIP_BACKEND___{{.*}}_
32
urQueueCreateWithParamTest.SuccessWithProperties/AMD_HIP_BACKEND___{{.*}}___UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE
43
urQueueCreateWithParamTest.SuccessWithProperties/AMD_HIP_BACKEND___{{.*}}___UR_QUEUE_FLAG_PROFILING_ENABLE
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
urQueueCreateTest.InvalidValueProperties/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
21
urQueueCreateTest.InvalidQueueProperties/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_
32
{{Segmentation fault|Aborted}}

test/conformance/queue/urQueueCreate.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,23 @@ TEST_P(urQueueCreateTest, InvalidNullPointerQueue) {
6565
urQueueCreate(context, device, 0, nullptr));
6666
}
6767

68-
TEST_P(urQueueCreateTest, InvalidValueProperties) {
69-
ur_queue_handle_t queue = nullptr;
68+
TEST_P(urQueueCreateTest, InvalidQueueProperties) {
7069
ur_queue_properties_t props = {
7170
/*.stype =*/UR_STRUCTURE_TYPE_QUEUE_PROPERTIES,
7271
/*.pNext =*/nullptr,
7372
/*.flags =*/UR_QUEUE_FLAG_FORCE_UINT32,
7473
};
75-
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_VALUE,
76-
urQueueCreate(context, device, &props, &queue));
77-
}
7874

79-
TEST_P(urQueueCreateTest, InvalidQueueProperties) {
80-
ur_queue_properties_t props = {
81-
/*.stype =*/UR_STRUCTURE_TYPE_QUEUE_PROPERTIES,
82-
/*.pNext =*/nullptr,
83-
/*.flags =*/UR_QUEUE_FLAG_PRIORITY_HIGH | UR_QUEUE_FLAG_PRIORITY_LOW,
84-
};
75+
// Initial value is just not a valid enum
76+
{
77+
ur_queue_handle_t queue = nullptr;
78+
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES,
79+
urQueueCreate(context, device, &props, &queue));
80+
}
8581
// It should be an error to specify both low/high priorities
8682
{
8783
ur_queue_handle_t queue = nullptr;
84+
props.flags = UR_QUEUE_FLAG_PRIORITY_HIGH | UR_QUEUE_FLAG_PRIORITY_LOW;
8885
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES,
8986
urQueueCreate(context, device, &props, &queue));
9087
}

0 commit comments

Comments
 (0)