Skip to content

Commit 2620159

Browse files
authored
Merge pull request #737 from kbenzie/benie/device-virtual-memory-support-query
[ur] Add missing virtual memory support query
2 parents c12d602 + f5fbb5e commit 2620159

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

include/ur.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@ class ur_device_info_v(IntEnum):
826826
IP_VERSION = 113 ## [uint32_t] The device IP version. The meaning of the device IP version
827827
## is implementation-defined, but newer devices should have a higher
828828
## version than older devices.
829+
VIRTUAL_MEMORY_SUPPORT = 114 ## [::ur_bool_t] return true if the device supports virtual memory.
829830
BINDLESS_IMAGES_SUPPORT_EXP = 0x2000 ## [::ur_bool_t] returns true if the device supports the creation of
830831
## bindless images
831832
BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP = 0x2001 ## [::ur_bool_t] returns true if the device supports the creation of

include/ur_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,7 @@ typedef enum ur_device_info_t {
14531453
UR_DEVICE_INFO_IP_VERSION = 113, ///< [uint32_t] The device IP version. The meaning of the device IP version
14541454
///< is implementation-defined, but newer devices should have a higher
14551455
///< version than older devices.
1456+
UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT = 114, ///< [::ur_bool_t] return true if the device supports virtual memory.
14561457
UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP = 0x2000, ///< [::ur_bool_t] returns true if the device supports the creation of
14571458
///< bindless images
14581459
UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP = 0x2001, ///< [::ur_bool_t] returns true if the device supports the creation of

scripts/core/device.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ etors:
383383
desc: "[uint32_t] The maximum number of registers available per block."
384384
- name: IP_VERSION
385385
desc: "[uint32_t] The device IP version. The meaning of the device IP version is implementation-defined, but newer devices should have a higher version than older devices."
386+
- name: VIRTUAL_MEMORY_SUPPORT
387+
desc: "[$x_bool_t] return true if the device supports virtual memory."
386388
--- #--------------------------------------------------------------------------
387389
type: function
388390
desc: "Retrieves various information about device"

source/common/ur_params.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,6 +2768,10 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
27682768
os << "UR_DEVICE_INFO_IP_VERSION";
27692769
break;
27702770

2771+
case UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT:
2772+
os << "UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT";
2773+
break;
2774+
27712775
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP:
27722776
os << "UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP";
27732777
break;
@@ -4392,6 +4396,20 @@ inline void serializeTagged(std::ostream &os, const void *ptr,
43924396
os << ")";
43934397
} break;
43944398

4399+
case UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT: {
4400+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4401+
if (sizeof(ur_bool_t) > size) {
4402+
os << "invalid size (is: " << size
4403+
<< ", expected: >=" << sizeof(ur_bool_t) << ")";
4404+
return;
4405+
}
4406+
os << (void *)(tptr) << " (";
4407+
4408+
os << *tptr;
4409+
4410+
os << ")";
4411+
} break;
4412+
43954413
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: {
43964414
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
43974415
if (sizeof(ur_bool_t) > size) {

test/conformance/device/urDeviceGetInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ INSTANTIATE_TEST_SUITE_P(
231231
UR_DEVICE_INFO_ASYNC_BARRIER, //
232232
UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT, //
233233
UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED, //
234-
UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP //
234+
UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP, //
235+
UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT //
235236
),
236237
[](const ::testing::TestParamInfo<ur_device_info_t> &info) {
237238
std::stringstream ss;

0 commit comments

Comments
 (0)