Skip to content

Commit 2621f1d

Browse files
committed
Replace PROGRAM_INFO_SOURCE with PROGRAM_INFO_IL.
Also make returns for this consistent across adapter implementations (i.e. actual IL if that's supported, otherwise return UNSUPPORTED_ENUMERATION). resolves #1138
1 parent 8d1486a commit 2621f1d

File tree

11 files changed

+15
-18
lines changed

11 files changed

+15
-18
lines changed

include/ur_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4270,7 +4270,8 @@ typedef enum ur_program_info_t {
42704270
UR_PROGRAM_INFO_NUM_DEVICES = 2, ///< [uint32_t] Return number of devices associated with Program.
42714271
UR_PROGRAM_INFO_DEVICES = 3, ///< [::ur_device_handle_t[]] Return list of devices associated with
42724272
///< Program.
4273-
UR_PROGRAM_INFO_SOURCE = 4, ///< [char[]] Return program source associated with Program.
4273+
UR_PROGRAM_INFO_IL = 4, ///< [char[]] Return program IL if the program was created with
4274+
///< ::urProgramCreateWithIL
42744275
UR_PROGRAM_INFO_BINARY_SIZES = 5, ///< [size_t[]] Return program binary sizes for each device.
42754276
UR_PROGRAM_INFO_BINARIES = 6, ///< [unsigned char[]] Return program binaries for all devices for this
42764277
///< Program.

include/ur_print.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7082,8 +7082,8 @@ inline std::ostream &operator<<(std::ostream &os, ur_program_info_t value) {
70827082
case UR_PROGRAM_INFO_DEVICES:
70837083
os << "UR_PROGRAM_INFO_DEVICES";
70847084
break;
7085-
case UR_PROGRAM_INFO_SOURCE:
7086-
os << "UR_PROGRAM_INFO_SOURCE";
7085+
case UR_PROGRAM_INFO_IL:
7086+
os << "UR_PROGRAM_INFO_IL";
70877087
break;
70887088
case UR_PROGRAM_INFO_BINARY_SIZES:
70897089
os << "UR_PROGRAM_INFO_BINARY_SIZES";
@@ -7165,7 +7165,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_program_inf
71657165
}
71667166
os << "}";
71677167
} break;
7168-
case UR_PROGRAM_INFO_SOURCE: {
7168+
case UR_PROGRAM_INFO_IL: {
71697169

71707170
const char *tptr = (const char *)ptr;
71717171
printPtr(os, tptr);

scripts/core/program.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ etors:
327327
desc: "[uint32_t] Return number of devices associated with Program."
328328
- name: DEVICES
329329
desc: "[$x_device_handle_t[]] Return list of devices associated with Program."
330-
- name: SOURCE
331-
desc: "[char[]] Return program source associated with Program."
330+
- name: IL
331+
desc: "[char[]] Return program IL if the program was created with $xProgramCreateWithIL"
332332
- name: BINARY_SIZES
333333
desc: "[size_t[]] Return program binary sizes for each device."
334334
- name: BINARIES

source/adapters/cuda/program.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,6 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
371371
return ReturnValue(1u);
372372
case UR_PROGRAM_INFO_DEVICES:
373373
return ReturnValue(&hProgram->Context->DeviceID, 1);
374-
case UR_PROGRAM_INFO_SOURCE:
375-
return ReturnValue(hProgram->Binary);
376374
case UR_PROGRAM_INFO_BINARY_SIZES:
377375
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
378376
case UR_PROGRAM_INFO_BINARIES:
@@ -382,6 +380,7 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
382380
UR_ASSERT(getKernelNames(hProgram), UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
383381
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
384382
case UR_PROGRAM_INFO_NUM_KERNELS:
383+
case UR_PROGRAM_INFO_IL:
385384
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
386385
default:
387386
break;

source/adapters/hip/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,14 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
328328
return ReturnValue(1u);
329329
case UR_PROGRAM_INFO_DEVICES:
330330
return ReturnValue(hProgram->getDevice(), 1);
331-
case UR_PROGRAM_INFO_SOURCE:
332-
return ReturnValue(hProgram->Binary);
333331
case UR_PROGRAM_INFO_BINARY_SIZES:
334332
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
335333
case UR_PROGRAM_INFO_BINARIES:
336334
return ReturnValue(&hProgram->Binary, 1);
337335
case UR_PROGRAM_INFO_KERNEL_NAMES:
338336
return getKernelNames(hProgram);
337+
case UR_PROGRAM_INFO_IL:
338+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
339339
default:
340340
break;
341341
}

source/adapters/native_cpu/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
146146
return returnValue(1u);
147147
case UR_PROGRAM_INFO_DEVICES:
148148
return returnValue(hProgram->_ctx->_device);
149-
case UR_PROGRAM_INFO_SOURCE:
150-
return returnValue(nullptr);
151149
case UR_PROGRAM_INFO_BINARY_SIZES:
152150
return returnValue("foo");
153151
case UR_PROGRAM_INFO_BINARIES:
154152
return returnValue("foo");
155153
case UR_PROGRAM_INFO_KERNEL_NAMES: {
156154
return returnValue("foo");
157155
}
156+
case UR_PROGRAM_INFO_IL:
157+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
158158
default:
159159
break;
160160
}

source/adapters/opencl/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ static cl_int mapURProgramInfoToCL(ur_program_info_t URPropName) {
159159
return CL_PROGRAM_NUM_DEVICES;
160160
case UR_PROGRAM_INFO_DEVICES:
161161
return CL_PROGRAM_DEVICES;
162-
case UR_PROGRAM_INFO_SOURCE:
163-
return CL_PROGRAM_SOURCE;
162+
case UR_PROGRAM_INFO_IL:
163+
return CL_PROGRAM_IL;
164164
case UR_PROGRAM_INFO_BINARY_SIZES:
165165
return CL_PROGRAM_BINARY_SIZES;
166166
case UR_PROGRAM_INFO_BINARIES:

test/conformance/program/program_adapter_cuda.match

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_CONTEXT
1616
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_DEVICES
1717
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_DEVICES
18-
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_SOURCE
1918
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARY_SIZES
2019
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARIES
2120
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_KERNELS

test/conformance/program/program_adapter_hip.match

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_CONTEXT
1717
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_DEVICES
1818
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_DEVICES
19-
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_SOURCE
2019
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARY_SIZES
2120
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARIES
2221
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_KERNELS

test/conformance/program/program_adapter_opencl.match

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ urProgramCreateWithBinaryTest.InvalidNullPointerProgram/Intel_R__OpenCL___{{.*}}
66
urProgramCreateWithBinaryTest.InvalidNullPointerMetadata/Intel_R__OpenCL___{{.*}}_
77
urProgramCreateWithBinaryTest.InvalidSizePropertyCount/Intel_R__OpenCL___{{.*}}_
88
urProgramGetFunctionPointerTest.InvalidFunctionName/Intel_R__OpenCL___{{.*}}_
9-
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_SOURCE
109
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_BINARIES

0 commit comments

Comments
 (0)