diff --git a/include/ur.py b/include/ur.py index 867e04a6cc..d498f17107 100644 --- a/include/ur.py +++ b/include/ur.py @@ -565,6 +565,9 @@ class ur_device_info_v(IntEnum): HOST_PIPE_READ_WRITE_SUPPORTED = 111 ## [::ur_bool_t] Return true if the device supports enqueing commands to ## read and write pipes from the host. MAX_REGISTERS_PER_WORK_GROUP = 112 ## [uint32_t] The maximum number of registers available per block. + IP_VERSION = 113 ## [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. class ur_device_info_t(c_int): def __str__(self): diff --git a/include/ur_api.h b/include/ur_api.h index 79b732acdd..9e6430f4ad 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -925,6 +925,9 @@ typedef enum ur_device_info_t { UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED = 111, ///< [::ur_bool_t] Return true if the device supports enqueing commands to ///< read and write pipes from the host. UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP = 112, ///< [uint32_t] The maximum number of registers available per block. + UR_DEVICE_INFO_IP_VERSION = 113, ///< [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. /// @cond UR_DEVICE_INFO_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -949,7 +952,7 @@ typedef enum ur_device_info_t { /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP < propName` +/// + `::UR_DEVICE_INFO_IP_VERSION < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/scripts/core/device.yml b/scripts/core/device.yml index 2e8caa20c6..fc34bcc6fa 100644 --- a/scripts/core/device.yml +++ b/scripts/core/device.yml @@ -383,6 +383,8 @@ etors: desc: "[$x_bool_t] Return true if the device supports enqueing commands to read and write pipes from the host." - name: MAX_REGISTERS_PER_WORK_GROUP desc: "[uint32_t] The maximum number of registers available per block." + - name: IP_VERSION + 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." --- #-------------------------------------------------------------------------- type: function desc: "Retrieves various information about device" diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index 783d9ef03b..4174456a0f 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -1732,6 +1732,10 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) { case UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP: os << "UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP"; break; + + case UR_DEVICE_INFO_IP_VERSION: + os << "UR_DEVICE_INFO_IP_VERSION"; + break; default: os << "unknown enumerator"; break; @@ -3278,6 +3282,20 @@ inline void serializeTagged(std::ostream &os, const void *ptr, os << ")"; } break; + + case UR_DEVICE_INFO_IP_VERSION: { + const uint32_t *tptr = (const uint32_t *)ptr; + if (sizeof(uint32_t) > size) { + os << "invalid size (is: " << size + << ", expected: >=" << sizeof(uint32_t) << ")"; + return; + } + os << (void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; default: os << "unknown enumerator"; break; diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index fe9d22d3a7..68dcbbc045 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -369,7 +369,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - if (UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP < propName) { + if (UR_DEVICE_INFO_IP_VERSION < propName) { return UR_RESULT_ERROR_INVALID_ENUMERATION; } diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 5bbd16a6c2..61f702087e 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -436,7 +436,7 @@ ur_result_t UR_APICALL urDeviceGet( /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP < propName` +/// + `::UR_DEVICE_INFO_IP_VERSION < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 6584106e66..7a8071457a 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -360,7 +360,7 @@ ur_result_t UR_APICALL urDeviceGet( /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE /// + `NULL == hDevice` /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION -/// + `::UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP < propName` +/// + `::UR_DEVICE_INFO_IP_VERSION < propName` /// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_SIZE