Skip to content

Commit 2a2f51c

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 40517d2 commit 2a2f51c

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
@@ -4273,7 +4273,8 @@ typedef enum ur_program_info_t {
42734273
UR_PROGRAM_INFO_NUM_DEVICES = 2, ///< [uint32_t] Return number of devices associated with Program.
42744274
UR_PROGRAM_INFO_DEVICES = 3, ///< [::ur_device_handle_t[]] Return list of devices associated with
42754275
///< Program.
4276-
UR_PROGRAM_INFO_SOURCE = 4, ///< [char[]] Return program source associated with Program.
4276+
UR_PROGRAM_INFO_IL = 4, ///< [char[]] Return program IL if the program was created with
4277+
///< ::urProgramCreateWithIL
42774278
UR_PROGRAM_INFO_BINARY_SIZES = 5, ///< [size_t[]] Return program binary sizes for each device.
42784279
UR_PROGRAM_INFO_BINARIES = 6, ///< [unsigned char[]] Return program binaries for all devices for this
42794280
///< 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
@@ -328,8 +328,8 @@ etors:
328328
desc: "[uint32_t] Return number of devices associated with Program."
329329
- name: DEVICES
330330
desc: "[$x_device_handle_t[]] Return list of devices associated with Program."
331-
- name: SOURCE
332-
desc: "[char[]] Return program source associated with Program."
331+
- name: IL
332+
desc: "[char[]] Return program IL if the program was created with $xProgramCreateWithIL"
333333
- name: BINARY_SIZES
334334
desc: "[size_t[]] Return program binary sizes for each device."
335335
- name: BINARIES

source/adapters/cuda/program.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,6 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
372372
return ReturnValue(1u);
373373
case UR_PROGRAM_INFO_DEVICES:
374374
return ReturnValue(&hProgram->Context->DeviceID, 1);
375-
case UR_PROGRAM_INFO_SOURCE:
376-
return ReturnValue(hProgram->Binary);
377375
case UR_PROGRAM_INFO_BINARY_SIZES:
378376
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
379377
case UR_PROGRAM_INFO_BINARIES:
@@ -383,6 +381,7 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
383381
UR_ASSERT(getKernelNames(hProgram), UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
384382
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
385383
case UR_PROGRAM_INFO_NUM_KERNELS:
384+
case UR_PROGRAM_INFO_IL:
386385
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
387386
default:
388387
break;

source/adapters/hip/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,14 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
350350
return ReturnValue(1u);
351351
case UR_PROGRAM_INFO_DEVICES:
352352
return ReturnValue(hProgram->getDevice(), 1);
353-
case UR_PROGRAM_INFO_SOURCE:
354-
return ReturnValue(hProgram->Binary);
355353
case UR_PROGRAM_INFO_BINARY_SIZES:
356354
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
357355
case UR_PROGRAM_INFO_BINARIES:
358356
return ReturnValue(&hProgram->Binary, 1);
359357
case UR_PROGRAM_INFO_KERNEL_NAMES:
360358
return getKernelNames(hProgram);
359+
case UR_PROGRAM_INFO_IL:
360+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
361361
default:
362362
break;
363363
}

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
@@ -15,7 +15,6 @@
1515
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_CONTEXT
1616
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_DEVICES
1717
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_DEVICES
18-
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_SOURCE
1918
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARY_SIZES
2019
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARIES
2120
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_KERNELS
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
urProgramGetFunctionPointerTest.InvalidFunctionName/Intel_R__OpenCL___{{.*}}_
2-
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_SOURCE
32
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_BINARIES

0 commit comments

Comments
 (0)