Skip to content

Commit 6c98e93

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 06c4cd0 commit 6c98e93

File tree

9 files changed

+17
-16
lines changed

9 files changed

+17
-16
lines changed

include/ur_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4490,7 +4490,8 @@ typedef enum ur_program_info_t {
44904490
UR_PROGRAM_INFO_DEVICES = 3, ///< [::ur_device_handle_t[]] Return list of devices associated with a program.
44914491
///< This is either the list of devices associated with the context or a
44924492
///< subset of those devices when the program is created using ::urProgramCreateWithBinary.
4493-
UR_PROGRAM_INFO_SOURCE = 4, ///< [char[]] Return program source associated with Program.
4493+
UR_PROGRAM_INFO_IL = 4, ///< [char[]] Return program IL if the program was created with
4494+
///< ::urProgramCreateWithIL
44944495
UR_PROGRAM_INFO_BINARY_SIZES = 5, ///< [size_t[]] Return program binary sizes for each device.
44954496
UR_PROGRAM_INFO_BINARIES = 6, ///< [unsigned char[]] Return program binaries for all devices for this
44964497
///< Program.

include/ur_print.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7501,8 +7501,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_program_info_t value)
75017501
case UR_PROGRAM_INFO_DEVICES:
75027502
os << "UR_PROGRAM_INFO_DEVICES";
75037503
break;
7504-
case UR_PROGRAM_INFO_SOURCE:
7505-
os << "UR_PROGRAM_INFO_SOURCE";
7504+
case UR_PROGRAM_INFO_IL:
7505+
os << "UR_PROGRAM_INFO_IL";
75067506
break;
75077507
case UR_PROGRAM_INFO_BINARY_SIZES:
75087508
os << "UR_PROGRAM_INFO_BINARY_SIZES";
@@ -7584,7 +7584,7 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_program_inf
75847584
}
75857585
os << "}";
75867586
} break;
7587-
case UR_PROGRAM_INFO_SOURCE: {
7587+
case UR_PROGRAM_INFO_IL: {
75887588

75897589
const char *tptr = (const char *)ptr;
75907590
printPtr(os, tptr);

scripts/core/program.yml

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

source/adapters/cuda/program.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,6 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
399399
return ReturnValue(1u);
400400
case UR_PROGRAM_INFO_DEVICES:
401401
return ReturnValue(&hProgram->Device, 1);
402-
case UR_PROGRAM_INFO_SOURCE:
403-
return ReturnValue(hProgram->Binary);
404402
case UR_PROGRAM_INFO_BINARY_SIZES:
405403
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
406404
case UR_PROGRAM_INFO_BINARIES:
@@ -410,6 +408,7 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
410408
UR_ASSERT(getKernelNames(hProgram), UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
411409
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
412410
case UR_PROGRAM_INFO_NUM_KERNELS:
411+
case UR_PROGRAM_INFO_IL:
413412
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
414413
default:
415414
break;

source/adapters/hip/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,14 +403,14 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
403403
return ReturnValue(1u);
404404
case UR_PROGRAM_INFO_DEVICES:
405405
return ReturnValue(&hProgram->getContext()->getDevices()[0], 1);
406-
case UR_PROGRAM_INFO_SOURCE:
407-
return ReturnValue(hProgram->Binary);
408406
case UR_PROGRAM_INFO_BINARY_SIZES:
409407
return ReturnValue(&hProgram->BinarySizeInBytes, 1);
410408
case UR_PROGRAM_INFO_BINARIES:
411409
return ReturnValue(&hProgram->Binary, 1);
412410
case UR_PROGRAM_INFO_KERNEL_NAMES:
413411
return getKernelNames(hProgram);
412+
case UR_PROGRAM_INFO_IL:
413+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
414414
default:
415415
break;
416416
}

source/adapters/native_cpu/program.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
204204
return returnValue(1u);
205205
case UR_PROGRAM_INFO_DEVICES:
206206
return returnValue(hProgram->_ctx->_device);
207-
case UR_PROGRAM_INFO_SOURCE:
208-
return returnValue(nullptr);
209207
case UR_PROGRAM_INFO_BINARY_SIZES:
210208
return returnValue("foo");
211209
case UR_PROGRAM_INFO_BINARIES:
212210
return returnValue("foo");
213211
case UR_PROGRAM_INFO_KERNEL_NAMES: {
214212
return returnValue("foo");
215213
}
214+
case UR_PROGRAM_INFO_IL:
215+
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
216216
default:
217217
break;
218218
}

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:
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
urProgramCreateWithILTest.BuildInvalidProgram/Intel_R__OpenCL___{{.*}}_
2-
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_SOURCE
2+
urProgramGetFunctionPointerTest.InvalidFunctionName/Intel_R__OpenCL___{{.*}}_
3+
urProgramGetInfoTest.Success/Intel_R__OpenCL___{{.*}}___UR_PROGRAM_INFO_BINARIES

test/conformance/program/urProgramGetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ UUR_TEST_SUITE_P(
1818
urProgramGetInfoTest,
1919
::testing::Values(UR_PROGRAM_INFO_REFERENCE_COUNT, UR_PROGRAM_INFO_CONTEXT,
2020
UR_PROGRAM_INFO_NUM_DEVICES, UR_PROGRAM_INFO_DEVICES,
21-
UR_PROGRAM_INFO_SOURCE, UR_PROGRAM_INFO_BINARY_SIZES,
21+
UR_PROGRAM_INFO_IL, UR_PROGRAM_INFO_BINARY_SIZES,
2222
UR_PROGRAM_INFO_BINARIES, UR_PROGRAM_INFO_NUM_KERNELS,
2323
UR_PROGRAM_INFO_KERNEL_NAMES),
2424
uur::deviceTestWithParamPrinter<ur_program_info_t>);

0 commit comments

Comments
 (0)