Skip to content

Commit

Permalink
resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dyniols committed Jan 21, 2025
1 parent 21c109d commit 46b4a75
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2198,9 +2198,11 @@ typedef enum ur_device_info_t {
/// to the `USMPool` entry points and usage of the `pool` parameter of the
/// USM alloc entry points.
UR_DEVICE_INFO_USM_POOL_SUPPORT = 119,
/// [uint32_t] the number of compute units for specific backend.
UR_DEVICE_INFO_NUM_COMPUTE_UNITS = 120,
/// [::ur_bool_t] support the ::urProgramSetSpecializationConstants entry
/// point
UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS = 120,
UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS = 121,
/// [::ur_bool_t] Returns true if the device supports the use of
/// command-buffers.
UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000,
Expand Down
16 changes: 16 additions & 0 deletions include/ur_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2917,6 +2917,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
os << "UR_DEVICE_INFO_USM_POOL_SUPPORT";
break;
case UR_DEVICE_INFO_NUM_COMPUTE_UNITS:
os << "UR_DEVICE_INFO_NUM_COMPUTE_UNITS";
break;
case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS:
os << "UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS";
break;
Expand Down Expand Up @@ -4551,6 +4554,19 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr,

os << ")";
} break;
case UR_DEVICE_INFO_NUM_COMPUTE_UNITS: {
const uint32_t *tptr = (const uint32_t *)ptr;
if (sizeof(uint32_t) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t)
<< ")";
return UR_RESULT_ERROR_INVALID_SIZE;
}
os << (const void *)(tptr) << " (";

os << *tptr;

os << ")";
} break;
case UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS: {
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
if (sizeof(ur_bool_t) > size) {
Expand Down
2 changes: 2 additions & 0 deletions tools/urinfo/urinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ inline void printDeviceInfos(ur_device_handle_t hDevice,
std::cout << prefix;
printDeviceInfo<ur_bool_t>(hDevice, UR_DEVICE_INFO_USM_POOL_SUPPORT);
std::cout << prefix;
printDeviceInfo<uint32_t>(hDevice, UR_DEVICE_INFO_NUM_COMPUTE_UNITS);
std::cout << prefix;
printDeviceInfo<ur_bool_t>(
hDevice, UR_DEVICE_INFO_PROGRAM_SET_SPECIALIZATION_CONSTANTS);
std::cout << prefix;
Expand Down

0 comments on commit 46b4a75

Please sign in to comment.