Skip to content

Commit caab344

Browse files
committed
A few small changes to move towards empty match files for CL:
* Return UNSUPPORTED_ENUMERATION in device info query when FP16 extension isn't supported * Add a mapping from CL_INVALID_ARG_SIZE to UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE * Remove a bunch of {{OPT}} entries from the enqueue match file, these should all be passing since bounds checking was added to the validation layer * Write in a special case for PROGRAM_INFO_BINARIES test - this query works pretty differently to the others
1 parent b4b2c72 commit caab344

File tree

5 files changed

+27
-42
lines changed

5 files changed

+27
-42
lines changed

source/adapters/opencl/common.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ ur_result_t mapCLErrorToUR(cl_int Result) {
9393
return UR_RESULT_ERROR_INVALID_KERNEL_ARGS;
9494
case CL_INVALID_COMMAND_QUEUE:
9595
return UR_RESULT_ERROR_INVALID_QUEUE;
96+
case CL_INVALID_ARG_SIZE:
97+
return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE;
9698
default:
9799
return UR_RESULT_ERROR_UNKNOWN;
98100
}
Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,4 @@
1-
{{OPT}}urEnqueueMemBufferCopyRectTest.InvalidSize/Intel_R__OpenCL___{{.*}}
2-
{{OPT}}urEnqueueMemBufferReadRectTest.InvalidSize/Intel_R__OpenCL___{{.*}}
3-
{{OPT}}urEnqueueMemBufferWriteRectTest.InvalidSize/Intel_R__OpenCL___{{.*}}
4-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
5-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
6-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
7-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
8-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
9-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
10-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
11-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
12-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
13-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
14-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
15-
{{OPT}}urEnqueueUSMFill2DTestWithParam.Success/Intel_R__OpenCL___{{.*}}
16-
{{OPT}}urEnqueueUSMFill2DNegativeTest.OutOfBounds/Intel_R__OpenCL___{{.*}}
17-
{{OPT}}urEnqueueUSMAdviseTest.InvalidSizeTooLarge/Intel_R__OpenCL___{{.*}}
18-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/Intel_R__OpenCL___{{.*}}
19-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/Intel_R__OpenCL___{{.*}}
20-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/Intel_R__OpenCL___{{.*}}
21-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/Intel_R__OpenCL___{{.*}}
22-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/Intel_R__OpenCL___{{.*}}
23-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessBlocking/Intel_R__OpenCL___{{.*}}
24-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/Intel_R__OpenCL___{{.*}}
25-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/Intel_R__OpenCL___{{.*}}
26-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/Intel_R__OpenCL___{{.*}}
27-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/Intel_R__OpenCL___{{.*}}
28-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/Intel_R__OpenCL___{{.*}}
29-
{{OPT}}urEnqueueUSMMemcpy2DTestWithParam.SuccessNonBlocking/Intel_R__OpenCL___{{.*}}
30-
{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidNullHandleQueue/Intel_R__OpenCL___{{.*}}
31-
{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidNullPointer/Intel_R__OpenCL___{{.*}}
32-
{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidSize/Intel_R__OpenCL___{{.*}}
33-
{{OPT}}urEnqueueUSMMemcpy2DNegativeTest.InvalidEventWaitList/Intel_R__OpenCL___{{.*}}
34-
{{OPT}}urEnqueueUSMPrefetchTest.InvalidSizeTooLarge/Intel_R__OpenCL___{{.*}}
1+
{{OPT}}urEnqueueDeviceGetGlobalVariableReadTest.Success/Intel_R__OpenCL___{{.*}}_
352
urEnqueueKernelLaunchKernelWgSizeTest.Success/Intel_R__OpenCL___{{.*}}_
363
urEnqueueKernelLaunchKernelSubGroupTest.Success/Intel_R__OpenCL___{{.*}}_
374
{{OPT}}urEnqueueKernelLaunchUSMLinkedList.Success/Intel_R__OpenCL___{{.*}}_UsePoolEnabled
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
urKernelSetArgValueTest.InvalidKernelArgumentSize/Intel_R__OpenCL___{{.*}}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
urProgramCreateWithILTest.BuildInvalidProgram/Intel_R__OpenCL___{{.*}}_
22
urProgramGetFunctionPointerTest.InvalidFunctionName/Intel_R__OpenCL___{{.*}}_
33
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_SOURCE
4-
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_BINARIES

test/conformance/program/urProgramGetInfo.cpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,31 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urProgramGetInfoSingleTest);
3333

3434
TEST_P(urProgramGetInfoTest, Success) {
3535
auto property_name = getParam();
36-
size_t property_size = 0;
3736
std::vector<char> property_value;
38-
ASSERT_SUCCESS(
39-
urProgramGetInfo(program, property_name, 0, nullptr, &property_size));
40-
property_value.resize(property_size);
41-
ASSERT_SUCCESS(urProgramGetInfo(program, property_name, property_size,
42-
property_value.data(), nullptr));
37+
size_t property_size = 0;
38+
if (property_name == UR_PROGRAM_INFO_BINARIES) {
39+
size_t binary_sizes_len = 0;
40+
ASSERT_SUCCESS(urProgramGetInfo(program, UR_PROGRAM_INFO_BINARY_SIZES,
41+
0, nullptr, &binary_sizes_len));
42+
// Due to how the fixtures + env are set up we should only have one
43+
// device associated with program, so one binary.
44+
ASSERT_EQ(binary_sizes_len / sizeof(size_t), 1);
45+
size_t binary_sizes[1] = {binary_sizes_len};
46+
ASSERT_SUCCESS(urProgramGetInfo(program, UR_PROGRAM_INFO_BINARY_SIZES,
47+
binary_sizes_len, binary_sizes,
48+
nullptr));
49+
property_value.resize(binary_sizes[0]);
50+
char *binaries[1] = {property_value.data()};
51+
ASSERT_SUCCESS(urProgramGetInfo(program, UR_PROGRAM_INFO_BINARIES,
52+
sizeof(binaries[0]), binaries,
53+
nullptr));
54+
} else {
55+
ASSERT_SUCCESS(
56+
urProgramGetInfo(program, property_name, 0, nullptr, &property_size));
57+
property_value.resize(property_size);
58+
ASSERT_SUCCESS(urProgramGetInfo(program, property_name, property_size,
59+
property_value.data(), nullptr));
60+
}
4361
switch (property_name) {
4462
case UR_PROGRAM_INFO_REFERENCE_COUNT: {
4563
auto returned_reference_count =

0 commit comments

Comments
 (0)