Skip to content

Commit b08beab

Browse files
committed
resolved conflicts
1 parent 5991b3f commit b08beab

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

include/ur_api.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,9 +2198,11 @@ typedef enum ur_device_info_t {
21982198
/// to the `USMPool` entry points and usage of the `pool` parameter of the
21992199
/// USM alloc entry points.
22002200
UR_DEVICE_INFO_USM_POOL_SUPPORT = 119,
2201+
/// [uint32_t] the number of compute units for specific backend.
2202+
UR_DEVICE_INFO_NUM_COMPUTE_UNITS = 120,
22012203
/// [::ur_bool_t] support the ::urProgramSetSpecializationConstants entry
22022204
/// point
2203-
UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS = 120,
2205+
UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS = 121,
22042206
/// [::ur_bool_t] Returns true if the device supports the use of
22052207
/// command-buffers.
22062208
UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000,

include/ur_print.hpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2917,6 +2917,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
29172917
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
29182918
os << "UR_DEVICE_INFO_USM_POOL_SUPPORT";
29192919
break;
2920+
case UR_DEVICE_INFO_NUM_COMPUTE_UNITS:
2921+
os << "UR_DEVICE_INFO_NUM_COMPUTE_UNITS";
2922+
break;
29202923
case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS:
29212924
os << "UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS";
29222925
break;
@@ -4551,6 +4554,19 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr,
45514554

45524555
os << ")";
45534556
} break;
4557+
case UR_DEVICE_INFO_NUM_COMPUTE_UNITS: {
4558+
const uint32_t *tptr = (const uint32_t *)ptr;
4559+
if (sizeof(uint32_t) > size) {
4560+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t)
4561+
<< ")";
4562+
return UR_RESULT_ERROR_INVALID_SIZE;
4563+
}
4564+
os << (const void *)(tptr) << " (";
4565+
4566+
os << *tptr;
4567+
4568+
os << ")";
4569+
} break;
45544570
case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: {
45554571
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
45564572
if (sizeof(ur_bool_t) > size) {

tools/urinfo/urinfo.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ inline void printDeviceInfos(ur_device_handle_t hDevice,
327327
std::cout << prefix;
328328
printDeviceInfo<ur_bool_t>(hDevice, UR_DEVICE_INFO_USM_POOL_SUPPORT);
329329
std::cout << prefix;
330+
printDeviceInfo<uint32_t>(hDevice, UR_DEVICE_INFO_NUM_COMPUTE_UNITS);
331+
std::cout << prefix;
330332
printDeviceInfo<ur_bool_t>(
331333
hDevice, UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS);
332334
std::cout << prefix;

0 commit comments

Comments
 (0)