Skip to content

Commit 35ed823

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 5a23b18 commit 35ed823

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
@@ -4404,7 +4404,8 @@ typedef enum ur_program_info_t {
44044404
UR_PROGRAM_INFO_DEVICES = 3, ///< [::ur_device_handle_t[]] Return list of devices associated with a program.
44054405
///< This is either the list of devices associated with the context or a
44064406
///< subset of those devices when the program is created using ::urProgramCreateWithBinary.
4407-
UR_PROGRAM_INFO_SOURCE = 4, ///< [char[]] Return program source associated with Program.
4407+
UR_PROGRAM_INFO_IL = 4, ///< [char[]] Return program IL if the program was created with
4408+
///< ::urProgramCreateWithIL
44084409
UR_PROGRAM_INFO_BINARY_SIZES = 5, ///< [size_t[]] Return program binary sizes for each device.
44094410
UR_PROGRAM_INFO_BINARIES = 6, ///< [unsigned char[]] Return program binaries for all devices for this
44104411
///< Program.

include/ur_print.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7390,8 +7390,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_program_info_t value)
73907390
case UR_PROGRAM_INFO_DEVICES:
73917391
os << "UR_PROGRAM_INFO_DEVICES";
73927392
break;
7393-
case UR_PROGRAM_INFO_SOURCE:
7394-
os << "UR_PROGRAM_INFO_SOURCE";
7393+
case UR_PROGRAM_INFO_IL:
7394+
os << "UR_PROGRAM_INFO_IL";
73957395
break;
73967396
case UR_PROGRAM_INFO_BINARY_SIZES:
73977397
os << "UR_PROGRAM_INFO_BINARY_SIZES";
@@ -7473,7 +7473,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_program_inf
74737473
}
74747474
os << "}";
74757475
} break;
7476-
case UR_PROGRAM_INFO_SOURCE: {
7476+
case UR_PROGRAM_INFO_IL: {
74777477

74787478
const char *tptr = (const char *)ptr;
74797479
printPtr(os, tptr);

scripts/core/program.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ etors:
370370
desc: |
371371
[$x_device_handle_t[]] Return list of devices associated with a program.
372372
This is either the list of devices associated with the context or a subset of those devices when the program is created using $xProgramCreateWithBinary.
373-
- name: SOURCE
374-
desc: "[char[]] Return program source associated with Program."
373+
- name: IL
374+
desc: "[char[]] Return program IL if the program was created with $xProgramCreateWithIL"
375375
- name: BINARY_SIZES
376376
desc: "[size_t[]] Return program binary sizes for each device."
377377
- name: BINARIES

source/adapters/cuda/program.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,6 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
391391
return ReturnValue(1u);
392392
case UR_PROGRAM_INFO_DEVICES:
393393
return ReturnValue(&hProgram->Context->DeviceID, 1);
394-
case UR_PROGRAM_INFO_SOURCE:
395-
return ReturnValue(hProgram->Binary);
396394
case UR_PROGRAM_INFO_BINARY_SIZES:
397395
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
398396
case UR_PROGRAM_INFO_BINARIES:
@@ -402,6 +400,7 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
402400
UR_ASSERT(getKernelNames(hProgram), UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
403401
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
404402
case UR_PROGRAM_INFO_NUM_KERNELS:
403+
case UR_PROGRAM_INFO_IL:
405404
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
406405
default:
407406
break;

source/adapters/hip/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,14 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
369369
return ReturnValue(1u);
370370
case UR_PROGRAM_INFO_DEVICES:
371371
return ReturnValue(&hProgram->getContext()->getDevices()[0], 1);
372-
case UR_PROGRAM_INFO_SOURCE:
373-
return ReturnValue(hProgram->Binary);
374372
case UR_PROGRAM_INFO_BINARY_SIZES:
375373
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
376374
case UR_PROGRAM_INFO_BINARIES:
377375
return ReturnValue(&hProgram->Binary, 1);
378376
case UR_PROGRAM_INFO_KERNEL_NAMES:
379377
return getKernelNames(hProgram);
378+
case UR_PROGRAM_INFO_IL:
379+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
380380
default:
381381
break;
382382
}

source/adapters/native_cpu/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
158158
return returnValue(1u);
159159
case UR_PROGRAM_INFO_DEVICES:
160160
return returnValue(hProgram->_ctx->_device);
161-
case UR_PROGRAM_INFO_SOURCE:
162-
return returnValue(nullptr);
163161
case UR_PROGRAM_INFO_BINARY_SIZES:
164162
return returnValue("foo");
165163
case UR_PROGRAM_INFO_BINARIES:
166164
return returnValue("foo");
167165
case UR_PROGRAM_INFO_KERNEL_NAMES: {
168166
return returnValue("foo");
169167
}
168+
case UR_PROGRAM_INFO_IL:
169+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
170170
default:
171171
break;
172172
}

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
@@ -17,7 +17,6 @@ urProgramBuildTest.BuildFailure/NVIDIA_CUDA_BACKEND___{{.*}}_
1717
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_CONTEXT
1818
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_DEVICES
1919
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_DEVICES
20-
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_SOURCE
2120
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARY_SIZES
2221
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/NVIDIA_CUDA_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARIES
2322
{{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
@@ -17,7 +17,6 @@ urProgramBuildTest.BuildFailure/AMD_HIP_BACKEND___{{.*}}_
1717
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_CONTEXT
1818
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_NUM_DEVICES
1919
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_DEVICES
20-
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_SOURCE
2120
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARY_SIZES
2221
{{OPT}}urProgramGetInfoTest.InvalidNullHandleProgram/AMD_HIP_BACKEND___{{.*}}___UR_PROGRAM_INFO_BINARIES
2322
{{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,4 +1,3 @@
11
urProgramCreateWithILTest.BuildInvalidProgram/Intel_R__OpenCL___{{.*}}_
22
urProgramGetFunctionPointerTest.InvalidFunctionName/Intel_R__OpenCL___{{.*}}_
3-
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_SOURCE
43
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_BINARIES

0 commit comments

Comments
 (0)