diff --git a/include/ur_api.h b/include/ur_api.h index 3205fcb207..a1a75c8a71 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -231,6 +231,7 @@ typedef enum ur_function_t { UR_FUNCTION_COMMAND_BUFFER_UPDATE_WAIT_EVENTS_EXP = 244, ///< Enumerator for ::urCommandBufferUpdateWaitEventsExp UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP = 245, ///< Enumerator for ::urBindlessImagesMapExternalLinearMemoryExp UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT = 246, ///< Enumerator for ::urEnqueueEventsWaitWithBarrierExt + UR_FUNCTION_PHYSICAL_MEM_GET_INFO = 247, ///< Enumerator for ::urPhysicalMemGetInfo /// @cond UR_FUNCTION_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -2518,7 +2519,7 @@ typedef enum ur_mem_type_t { /////////////////////////////////////////////////////////////////////////////// /// @brief Memory Information type typedef enum ur_mem_info_t { - UR_MEM_INFO_SIZE = 0, ///< [size_t] actual size of of memory object in bytes + UR_MEM_INFO_SIZE = 0, ///< [size_t] actual size of the memory object in bytes UR_MEM_INFO_CONTEXT = 1, ///< [::ur_context_handle_t] context in which the memory object was created UR_MEM_INFO_REFERENCE_COUNT = 2, ///< [uint32_t] Reference count of the memory object. ///< The reference count returned should be considered immediately stale. @@ -4126,6 +4127,50 @@ urPhysicalMemRelease( ur_physical_mem_handle_t hPhysicalMem ///< [in][release] handle of the physical memory object to release. ); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Physical memory range info queries. +typedef enum ur_physical_mem_info_t { + UR_PHYSICAL_MEM_INFO_CONTEXT = 0, ///< [::ur_context_handle_t] context in which the physical memory object + ///< was created. + UR_PHYSICAL_MEM_INFO_DEVICE = 1, ///< [::ur_device_handle_t] device associated with this physical memory + ///< object. + UR_PHYSICAL_MEM_INFO_SIZE = 2, ///< [size_t] actual size of the physical memory object in bytes. + UR_PHYSICAL_MEM_INFO_PROPERTIES = 3, ///< [::ur_physical_mem_properties_t] properties set when creating this + ///< physical memory object. + UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT = 4, ///< [uint32_t] Reference count of the physical memory object. + ///< The reference count returned should be considered immediately stale. + ///< It is unsuitable for general use in applications. This feature is + ///< provided for identifying memory leaks. + /// @cond + UR_PHYSICAL_MEM_INFO_FORCE_UINT32 = 0x7fffffff + /// @endcond + +} ur_physical_mem_info_t; + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get information about a physical memory object. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPhysicalMem` +/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION +/// + `::UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT < propName` +UR_APIEXPORT ur_result_t UR_APICALL +urPhysicalMemGetInfo( + ur_physical_mem_handle_t hPhysicalMem, ///< [in] handle of the physical memory object to query. + ur_physical_mem_info_t propName, ///< [in] type of the info to query. + size_t propSize, ///< [in] size in bytes of the memory pointed to by pPropValue. + void *pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding + ///< the info. If propSize is less than the real number of bytes needed to + ///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pPropValue is not used. + size_t *pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName." +); + #if !defined(__GNUC__) #pragma endregion #endif @@ -11072,6 +11117,18 @@ typedef struct ur_physical_mem_release_params_t { ur_physical_mem_handle_t *phPhysicalMem; } ur_physical_mem_release_params_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function parameters for urPhysicalMemGetInfo +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct ur_physical_mem_get_info_params_t { + ur_physical_mem_handle_t *phPhysicalMem; + ur_physical_mem_info_t *ppropName; + size_t *ppropSize; + void **ppPropValue; + size_t **ppPropSizeRet; +} ur_physical_mem_get_info_params_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Function parameters for urAdapterGet /// @details Each entry is a pointer to the parameter passed to the function; diff --git a/include/ur_api_funcs.def b/include/ur_api_funcs.def index 4920245369..2ff12042be 100644 --- a/include/ur_api_funcs.def +++ b/include/ur_api_funcs.def @@ -96,6 +96,7 @@ _UR_API(urMemImageGetInfo) _UR_API(urPhysicalMemCreate) _UR_API(urPhysicalMemRetain) _UR_API(urPhysicalMemRelease) +_UR_API(urPhysicalMemGetInfo) _UR_API(urAdapterGet) _UR_API(urAdapterRelease) _UR_API(urAdapterRetain) diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 40a6c5c269..fc359428b4 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -977,12 +977,22 @@ typedef ur_result_t(UR_APICALL *ur_pfnPhysicalMemRetain_t)( typedef ur_result_t(UR_APICALL *ur_pfnPhysicalMemRelease_t)( ur_physical_mem_handle_t); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for urPhysicalMemGetInfo +typedef ur_result_t(UR_APICALL *ur_pfnPhysicalMemGetInfo_t)( + ur_physical_mem_handle_t, + ur_physical_mem_info_t, + size_t, + void *, + size_t *); + /////////////////////////////////////////////////////////////////////////////// /// @brief Table of PhysicalMem functions pointers typedef struct ur_physical_mem_dditable_t { ur_pfnPhysicalMemCreate_t pfnCreate; ur_pfnPhysicalMemRetain_t pfnRetain; ur_pfnPhysicalMemRelease_t pfnRelease; + ur_pfnPhysicalMemGetInfo_t pfnGetInfo; } ur_physical_mem_dditable_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ur_print.h b/include/ur_print.h index 93597d232f..eae8a6d7f3 100644 --- a/include/ur_print.h +++ b/include/ur_print.h @@ -594,6 +594,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemFlags(enum ur_physical_mem /// - `buff_size < out_size` UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemProperties(const struct ur_physical_mem_properties_t params, char *buffer, const size_t buff_size, size_t *out_size); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Print ur_physical_mem_info_t enum +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_INVALID_SIZE +/// - `buff_size < out_size` +UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemInfo(enum ur_physical_mem_info_t value, char *buffer, const size_t buff_size, size_t *out_size); + /////////////////////////////////////////////////////////////////////////////// /// @brief Print ur_program_metadata_type_t enum /// @returns @@ -1802,6 +1810,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemRetainParams(const struct /// - `buff_size < out_size` UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemReleaseParams(const struct ur_physical_mem_release_params_t *params, char *buffer, const size_t buff_size, size_t *out_size); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Print ur_physical_mem_get_info_params_t struct +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_INVALID_SIZE +/// - `buff_size < out_size` +UR_APIEXPORT ur_result_t UR_APICALL urPrintPhysicalMemGetInfoParams(const struct ur_physical_mem_get_info_params_t *params, char *buffer, const size_t buff_size, size_t *out_size); + /////////////////////////////////////////////////////////////////////////////// /// @brief Print ur_adapter_get_params_t struct /// @returns diff --git a/include/ur_print.hpp b/include/ur_print.hpp index 1d28b8eac0..482095bf0e 100644 --- a/include/ur_print.hpp +++ b/include/ur_print.hpp @@ -153,6 +153,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_virtual_mem template <> inline ur_result_t printFlag(std::ostream &os, uint32_t flag); +template <> +inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_physical_mem_info_t value, size_t size); + inline ur_result_t printUnion( std::ostream &os, const union ur_program_metadata_value_t params, @@ -293,6 +296,7 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_virtual_mem_access_fla inline std::ostream &operator<<(std::ostream &os, enum ur_virtual_mem_info_t value); inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_flag_t value); inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_physical_mem_properties_t params); +inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_info_t value); inline std::ostream &operator<<(std::ostream &os, enum ur_program_metadata_type_t value); inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_program_metadata_t params); inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_program_properties_t params); @@ -962,6 +966,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) { case UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT: os << "UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT"; break; + case UR_FUNCTION_PHYSICAL_MEM_GET_INFO: + os << "UR_FUNCTION_PHYSICAL_MEM_GET_INFO"; + break; default: os << "unknown enumerator"; break; @@ -7435,6 +7442,113 @@ inline std::ostream &operator<<(std::ostream &os, const struct ur_physical_mem_p os << "}"; return os; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Print operator for the ur_physical_mem_info_t type +/// @returns +/// std::ostream & +inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_info_t value) { + switch (value) { + case UR_PHYSICAL_MEM_INFO_CONTEXT: + os << "UR_PHYSICAL_MEM_INFO_CONTEXT"; + break; + case UR_PHYSICAL_MEM_INFO_DEVICE: + os << "UR_PHYSICAL_MEM_INFO_DEVICE"; + break; + case UR_PHYSICAL_MEM_INFO_SIZE: + os << "UR_PHYSICAL_MEM_INFO_SIZE"; + break; + case UR_PHYSICAL_MEM_INFO_PROPERTIES: + os << "UR_PHYSICAL_MEM_INFO_PROPERTIES"; + break; + case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: + os << "UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT"; + break; + default: + os << "unknown enumerator"; + break; + } + return os; +} +namespace ur::details { +/////////////////////////////////////////////////////////////////////////////// +/// @brief Print ur_physical_mem_info_t enum value +template <> +inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_physical_mem_info_t value, size_t size) { + if (ptr == NULL) { + return printPtr(os, ptr); + } + + switch (value) { + case UR_PHYSICAL_MEM_INFO_CONTEXT: { + const ur_context_handle_t *tptr = (const ur_context_handle_t *)ptr; + if (sizeof(ur_context_handle_t) > size) { + os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_context_handle_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + ur::details::printPtr(os, + *tptr); + + os << ")"; + } break; + case UR_PHYSICAL_MEM_INFO_DEVICE: { + const ur_device_handle_t *tptr = (const ur_device_handle_t *)ptr; + if (sizeof(ur_device_handle_t) > size) { + os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_device_handle_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + ur::details::printPtr(os, + *tptr); + + os << ")"; + } break; + case UR_PHYSICAL_MEM_INFO_SIZE: { + const size_t *tptr = (const size_t *)ptr; + if (sizeof(size_t) > size) { + os << "invalid size (is: " << size << ", expected: >=" << sizeof(size_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; + case UR_PHYSICAL_MEM_INFO_PROPERTIES: { + const ur_physical_mem_properties_t *tptr = (const ur_physical_mem_properties_t *)ptr; + if (sizeof(ur_physical_mem_properties_t) > size) { + os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_physical_mem_properties_t) << ")"; + return UR_RESULT_ERROR_INVALID_SIZE; + } + os << (const void *)(tptr) << " ("; + + os << *tptr; + + os << ")"; + } break; + case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: { + 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; + default: + os << "unknown enumerator"; + return UR_RESULT_ERROR_INVALID_ENUMERATION; + } + return UR_RESULT_SUCCESS; +} +} // namespace ur::details + /////////////////////////////////////////////////////////////////////////////// /// @brief Print operator for the ur_program_metadata_type_t type /// @returns @@ -13170,6 +13284,40 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct return os; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Print operator for the ur_physical_mem_get_info_params_t type +/// @returns +/// std::ostream & +inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_physical_mem_get_info_params_t *params) { + + os << ".hPhysicalMem = "; + + ur::details::printPtr(os, + *(params->phPhysicalMem)); + + os << ", "; + os << ".propName = "; + + os << *(params->ppropName); + + os << ", "; + os << ".propSize = "; + + os << *(params->ppropSize); + + os << ", "; + os << ".pPropValue = "; + ur::details::printTagged(os, *(params->ppPropValue), *(params->ppropName), *(params->ppropSize)); + + os << ", "; + os << ".pPropSizeRet = "; + + ur::details::printPtr(os, + *(params->ppPropSizeRet)); + + return os; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Print operator for the ur_adapter_get_params_t type /// @returns @@ -18825,6 +18973,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os, ur_function_ case UR_FUNCTION_PHYSICAL_MEM_RELEASE: { os << (const struct ur_physical_mem_release_params_t *)params; } break; + case UR_FUNCTION_PHYSICAL_MEM_GET_INFO: { + os << (const struct ur_physical_mem_get_info_params_t *)params; + } break; case UR_FUNCTION_ADAPTER_GET: { os << (const struct ur_adapter_get_params_t *)params; } break; diff --git a/scripts/core/memory.yml b/scripts/core/memory.yml index 7cc7467da4..467e10d749 100644 --- a/scripts/core/memory.yml +++ b/scripts/core/memory.yml @@ -59,7 +59,7 @@ name: $x_mem_info_t typed_etors: True etors: - name: SIZE - desc: "[size_t] actual size of of memory object in bytes" + desc: "[size_t] actual size of the memory object in bytes" - name: CONTEXT desc: "[$x_context_handle_t] context in which the memory object was created" - name: REFERENCE_COUNT diff --git a/scripts/core/registry.yml b/scripts/core/registry.yml index 2133e1c889..62bd43d4d6 100644 --- a/scripts/core/registry.yml +++ b/scripts/core/registry.yml @@ -607,6 +607,9 @@ etors: - name: ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT desc: Enumerator for $xEnqueueEventsWaitWithBarrierExt value: '246' +- name: PHYSICAL_MEM_GET_INFO + desc: Enumerator for $xPhysicalMemGetInfo + value: '247' --- type: enum desc: Defines structure types diff --git a/scripts/core/virtual_memory.yml b/scripts/core/virtual_memory.yml index 133266de64..a6b580a5a9 100644 --- a/scripts/core/virtual_memory.yml +++ b/scripts/core/virtual_memory.yml @@ -303,3 +303,52 @@ params: - type: $x_physical_mem_handle_t name: hPhysicalMem desc: "[in][release] handle of the physical memory object to release." + +--- #-------------------------------------------------------------------------- +type: enum +desc: "Physical memory range info queries." +class: $xPhysicalMem +name: $x_physical_mem_info_t +typed_etors: True +etors: + - name: CONTEXT + desc: "[$x_context_handle_t] context in which the physical memory object was created." + - name: DEVICE + desc: "[$x_device_handle_t] device associated with this physical memory object." + - name: SIZE + desc: "[size_t] actual size of the physical memory object in bytes." + - name: PROPERTIES + desc: "[$x_physical_mem_properties_t] properties set when creating this physical memory object." + - name: REFERENCE_COUNT + desc: | + [uint32_t] Reference count of the physical memory object. + The reference count returned should be considered immediately stale. + It is unsuitable for general use in applications. This feature is provided for identifying memory leaks. + +--- #-------------------------------------------------------------------------- +type: function +desc: "Get information about a physical memory object." +class: $xPhysicalMem +name: GetInfo +params: + - type: $x_physical_mem_handle_t + name: hPhysicalMem + desc: "[in] handle of the physical memory object to query." + - type: $x_physical_mem_info_t + name: propName + desc: "[in] type of the info to query." + - type: size_t + name: propSize + desc: "[in] size in bytes of the memory pointed to by pPropValue." + - type: void* + name: pPropValue + desc: > + [out][optional][typename(propName, propSize)] array of bytes holding + the info. If propSize is less than the real number of bytes needed to + return the info then the $X_RESULT_ERROR_INVALID_SIZE error is + returned and pPropValue is not used. + - type: size_t* + name: pPropSizeRet + desc: > + [out][optional] pointer to the actual size in bytes of the queried + propName." diff --git a/source/adapters/cuda/physical_mem.cpp b/source/adapters/cuda/physical_mem.cpp index 28b9312176..71bf596acb 100644 --- a/source/adapters/cuda/physical_mem.cpp +++ b/source/adapters/cuda/physical_mem.cpp @@ -33,8 +33,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urPhysicalMemCreate( UR_CHECK_ERROR(Result); } try { - *phPhysicalMem = - new ur_physical_mem_handle_t_(ResHandle, hContext, hDevice); + *phPhysicalMem = new ur_physical_mem_handle_t_( + ResHandle, hContext, hDevice, size, + pProperties ? *pProperties : ur_physical_mem_properties_t{}); } catch (std::bad_alloc &) { return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY; } catch (...) { @@ -66,3 +67,30 @@ urPhysicalMemRelease(ur_physical_mem_handle_t hPhysicalMem) { } return UR_RESULT_SUCCESS; } + +UR_APIEXPORT ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t hPhysicalMem, ur_physical_mem_info_t propName, + size_t propSize, void *pPropValue, size_t *pPropSizeRet) { + + UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); + + switch (propName) { + case UR_PHYSICAL_MEM_INFO_CONTEXT: { + return ReturnValue(hPhysicalMem->getContext()); + } + case UR_PHYSICAL_MEM_INFO_DEVICE: { + return ReturnValue(hPhysicalMem->getDevice()); + } + case UR_PHYSICAL_MEM_INFO_SIZE: { + return ReturnValue(hPhysicalMem->getSize()); + } + case UR_PHYSICAL_MEM_INFO_PROPERTIES: { + return ReturnValue(hPhysicalMem->getProperties()); + } + case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: { + return ReturnValue(hPhysicalMem->getReferenceCount()); + } + default: + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + } +} diff --git a/source/adapters/cuda/physical_mem.hpp b/source/adapters/cuda/physical_mem.hpp index c77ad0d547..7e38e1be9e 100644 --- a/source/adapters/cuda/physical_mem.hpp +++ b/source/adapters/cuda/physical_mem.hpp @@ -27,10 +27,14 @@ struct ur_physical_mem_handle_t_ { native_type PhysicalMem; ur_context_handle_t_ *Context; ur_device_handle_t Device; + size_t Size; + ur_physical_mem_properties_t Properties; ur_physical_mem_handle_t_(native_type PhysMem, ur_context_handle_t_ *Ctx, - ur_device_handle_t Device) - : RefCount(1), PhysicalMem(PhysMem), Context(Ctx), Device(Device) { + ur_device_handle_t Device, size_t Size, + ur_physical_mem_properties_t Properties) + : RefCount(1), PhysicalMem(PhysMem), Context(Ctx), Device(Device), + Size(Size), Properties(Properties) { urContextRetain(Context); urDeviceRetain(Device); } @@ -51,4 +55,10 @@ struct ur_physical_mem_handle_t_ { uint32_t decrementReferenceCount() noexcept { return --RefCount; } uint32_t getReferenceCount() const noexcept { return RefCount; } + + size_t getSize() const noexcept { return Size; } + + ur_physical_mem_properties_t getProperties() const noexcept { + return Properties; + } }; diff --git a/source/adapters/cuda/ur_interface_loader.cpp b/source/adapters/cuda/ur_interface_loader.cpp index a9559eb188..d9bd0e2fcc 100644 --- a/source/adapters/cuda/ur_interface_loader.cpp +++ b/source/adapters/cuda/ur_interface_loader.cpp @@ -400,6 +400,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( pDdiTable->pfnCreate = urPhysicalMemCreate; pDdiTable->pfnRelease = urPhysicalMemRelease; pDdiTable->pfnRetain = urPhysicalMemRetain; + pDdiTable->pfnGetInfo = urPhysicalMemGetInfo; return retVal; } diff --git a/source/adapters/hip/physical_mem.cpp b/source/adapters/hip/physical_mem.cpp index f0003b6c00..87fe716d48 100644 --- a/source/adapters/hip/physical_mem.cpp +++ b/source/adapters/hip/physical_mem.cpp @@ -28,3 +28,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urPhysicalMemRelease(ur_physical_mem_handle_t) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } + +UR_APIEXPORT ur_result_t UR_APICALL +urPhysicalMemGetInfo(ur_physical_mem_handle_t, ur_physical_mem_info_t, size_t, + void *, size_t *) { + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/source/adapters/hip/ur_interface_loader.cpp b/source/adapters/hip/ur_interface_loader.cpp index 1454ddfdf1..c8f3b85daa 100644 --- a/source/adapters/hip/ur_interface_loader.cpp +++ b/source/adapters/hip/ur_interface_loader.cpp @@ -367,6 +367,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( pDdiTable->pfnCreate = urPhysicalMemCreate; pDdiTable->pfnRelease = urPhysicalMemRelease; pDdiTable->pfnRetain = urPhysicalMemRetain; + pDdiTable->pfnGetInfo = urPhysicalMemGetInfo; return retVal; } diff --git a/source/adapters/level_zero/physical_mem.cpp b/source/adapters/level_zero/physical_mem.cpp index e7bb498859..e28b876905 100644 --- a/source/adapters/level_zero/physical_mem.cpp +++ b/source/adapters/level_zero/physical_mem.cpp @@ -52,4 +52,21 @@ ur_result_t urPhysicalMemRelease(ur_physical_mem_handle_t hPhysicalMem) { return UR_RESULT_SUCCESS; } + +UR_APIEXPORT ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t hPhysicalMem, ur_physical_mem_info_t propName, + size_t propSize, void *pPropValue, size_t *pPropSizeRet) { + + UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); + + switch (propName) { + case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: { + return ReturnValue(hPhysicalMem->RefCount.load()); + } + default: + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + } + return UR_RESULT_SUCCESS; +} + } // namespace ur::level_zero diff --git a/source/adapters/level_zero/ur_interface_loader.cpp b/source/adapters/level_zero/ur_interface_loader.cpp index 0a36b3ecad..74e2df334d 100644 --- a/source/adapters/level_zero/ur_interface_loader.cpp +++ b/source/adapters/level_zero/ur_interface_loader.cpp @@ -320,6 +320,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( pDdiTable->pfnCreate = ur::level_zero::urPhysicalMemCreate; pDdiTable->pfnRetain = ur::level_zero::urPhysicalMemRetain; pDdiTable->pfnRelease = ur::level_zero::urPhysicalMemRelease; + pDdiTable->pfnGetInfo = ur::level_zero::urPhysicalMemGetInfo; return result; } diff --git a/source/adapters/level_zero/ur_interface_loader.hpp b/source/adapters/level_zero/ur_interface_loader.hpp index 1215d6449e..91d72bfbc3 100644 --- a/source/adapters/level_zero/ur_interface_loader.hpp +++ b/source/adapters/level_zero/ur_interface_loader.hpp @@ -182,6 +182,10 @@ ur_result_t urPhysicalMemCreate(ur_context_handle_t hContext, ur_physical_mem_handle_t *phPhysicalMem); ur_result_t urPhysicalMemRetain(ur_physical_mem_handle_t hPhysicalMem); ur_result_t urPhysicalMemRelease(ur_physical_mem_handle_t hPhysicalMem); +ur_result_t urPhysicalMemGetInfo(ur_physical_mem_handle_t hPhysicalMem, + ur_physical_mem_info_t propName, + size_t propSize, void *pPropValue, + size_t *pPropSizeRet); ur_result_t urProgramCreateWithIL(ur_context_handle_t hContext, const void *pIL, size_t length, const ur_program_properties_t *pProperties, diff --git a/source/adapters/level_zero/v2/api.cpp b/source/adapters/level_zero/v2/api.cpp index e4a70df811..283bfc7c32 100644 --- a/source/adapters/level_zero/v2/api.cpp +++ b/source/adapters/level_zero/v2/api.cpp @@ -156,6 +156,13 @@ ur_result_t urPhysicalMemRelease(ur_physical_mem_handle_t hPhysicalMem) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } +UR_APIEXPORT ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t hPhysicalMem, ur_physical_mem_info_t propName, + size_t propSize, void *pPropValue, size_t *pPropSizeRet) { + logger::error("{} function not implemented!", __FUNCTION__); + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} + ur_result_t urKernelSetArgSampler(ur_kernel_handle_t hKernel, uint32_t argIndex, const ur_kernel_arg_sampler_properties_t *pProperties, diff --git a/source/adapters/mock/ur_mockddi.cpp b/source/adapters/mock/ur_mockddi.cpp index 42c342444d..829ed93d1d 100644 --- a/source/adapters/mock/ur_mockddi.cpp +++ b/source/adapters/mock/ur_mockddi.cpp @@ -3103,6 +3103,60 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( return exceptionToResult(std::current_exception()); } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urPhysicalMemGetInfo +__urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t + hPhysicalMem, ///< [in] handle of the physical memory object to query. + ur_physical_mem_info_t propName, ///< [in] type of the info to query. + size_t + propSize, ///< [in] size in bytes of the memory pointed to by pPropValue. + void * + pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding + ///< the info. If propSize is less than the real number of bytes needed to + ///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pPropValue is not used. + size_t * + pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName." + ) try { + ur_result_t result = UR_RESULT_SUCCESS; + + ur_physical_mem_get_info_params_t params = { + &hPhysicalMem, &propName, &propSize, &pPropValue, &pPropSizeRet}; + + auto beforeCallback = reinterpret_cast( + mock::getCallbacks().get_before_callback("urPhysicalMemGetInfo")); + if (beforeCallback) { + result = beforeCallback(¶ms); + if (result != UR_RESULT_SUCCESS) { + return result; + } + } + + auto replaceCallback = reinterpret_cast( + mock::getCallbacks().get_replace_callback("urPhysicalMemGetInfo")); + if (replaceCallback) { + result = replaceCallback(¶ms); + } else { + + result = UR_RESULT_SUCCESS; + } + + if (result != UR_RESULT_SUCCESS) { + return result; + } + + auto afterCallback = reinterpret_cast( + mock::getCallbacks().get_after_callback("urPhysicalMemGetInfo")); + if (afterCallback) { + return afterCallback(¶ms); + } + + return result; +} catch (...) { + return exceptionToResult(std::current_exception()); +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urProgramCreateWithIL __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( @@ -11325,6 +11379,8 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( pDdiTable->pfnRelease = driver::urPhysicalMemRelease; + pDdiTable->pfnGetInfo = driver::urPhysicalMemGetInfo; + return result; } catch (...) { return exceptionToResult(std::current_exception()); diff --git a/source/adapters/native_cpu/physical_mem.cpp b/source/adapters/native_cpu/physical_mem.cpp index 7c535bfcca..a5a1c6411c 100644 --- a/source/adapters/native_cpu/physical_mem.cpp +++ b/source/adapters/native_cpu/physical_mem.cpp @@ -27,3 +27,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urPhysicalMemRelease(ur_physical_mem_handle_t) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } + +UR_APIEXPORT ur_result_t UR_APICALL +urPhysicalMemGetInfo(ur_physical_mem_handle_t, ur_physical_mem_info_t, size_t, + void *, size_t *) { + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/source/adapters/native_cpu/ur_interface_loader.cpp b/source/adapters/native_cpu/ur_interface_loader.cpp index 94c6c4a03e..97247e4902 100644 --- a/source/adapters/native_cpu/ur_interface_loader.cpp +++ b/source/adapters/native_cpu/ur_interface_loader.cpp @@ -356,6 +356,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( pDdiTable->pfnCreate = urPhysicalMemCreate; pDdiTable->pfnRelease = urPhysicalMemRelease; pDdiTable->pfnRetain = urPhysicalMemRetain; + pDdiTable->pfnGetInfo = urPhysicalMemGetInfo; return retVal; } diff --git a/source/adapters/opencl/physical_mem.cpp b/source/adapters/opencl/physical_mem.cpp index 9fffd0f979..791804f0ac 100644 --- a/source/adapters/opencl/physical_mem.cpp +++ b/source/adapters/opencl/physical_mem.cpp @@ -27,3 +27,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urPhysicalMemRelease(ur_physical_mem_handle_t) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } + +UR_APIEXPORT ur_result_t UR_APICALL +urPhysicalMemGetInfo(ur_physical_mem_handle_t, ur_physical_mem_info_t, size_t, + void *, size_t *) { + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +} diff --git a/source/adapters/opencl/ur_interface_loader.cpp b/source/adapters/opencl/ur_interface_loader.cpp index cba90ee152..d6aebdf79e 100644 --- a/source/adapters/opencl/ur_interface_loader.cpp +++ b/source/adapters/opencl/ur_interface_loader.cpp @@ -393,6 +393,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( pDdiTable->pfnCreate = urPhysicalMemCreate; pDdiTable->pfnRelease = urPhysicalMemRelease; pDdiTable->pfnRetain = urPhysicalMemRetain; + pDdiTable->pfnGetInfo = urPhysicalMemGetInfo; return retVal; } diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index 64489c39ac..7b56127576 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -2603,6 +2603,54 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urPhysicalMemGetInfo +__urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t + hPhysicalMem, ///< [in] handle of the physical memory object to query. + ur_physical_mem_info_t propName, ///< [in] type of the info to query. + size_t + propSize, ///< [in] size in bytes of the memory pointed to by pPropValue. + void * + pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding + ///< the info. If propSize is less than the real number of bytes needed to + ///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pPropValue is not used. + size_t * + pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName." +) { + auto pfnGetInfo = getContext()->urDdiTable.PhysicalMem.pfnGetInfo; + + if (nullptr == pfnGetInfo) { + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; + } + + ur_physical_mem_get_info_params_t params = { + &hPhysicalMem, &propName, &propSize, &pPropValue, &pPropSizeRet}; + uint64_t instance = getContext()->notify_begin( + UR_FUNCTION_PHYSICAL_MEM_GET_INFO, "urPhysicalMemGetInfo", ¶ms); + + auto &logger = getContext()->logger; + logger.info(" ---> urPhysicalMemGetInfo\n"); + + ur_result_t result = + pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); + + getContext()->notify_end(UR_FUNCTION_PHYSICAL_MEM_GET_INFO, + "urPhysicalMemGetInfo", ¶ms, &result, + instance); + + if (logger.getLevel() <= logger::Level::INFO) { + std::ostringstream args_str; + ur::extras::printFunctionParams( + args_str, UR_FUNCTION_PHYSICAL_MEM_GET_INFO, ¶ms); + logger.info(" <--- urPhysicalMemGetInfo({}) -> {};\n", args_str.str(), + result); + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urProgramCreateWithIL __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( @@ -9991,6 +10039,9 @@ __urdlllocal ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( dditable.pfnRelease = pDdiTable->pfnRelease; pDdiTable->pfnRelease = ur_tracing_layer::urPhysicalMemRelease; + dditable.pfnGetInfo = pDdiTable->pfnGetInfo; + pDdiTable->pfnGetInfo = ur_tracing_layer::urPhysicalMemGetInfo; + return result; } /////////////////////////////////////////////////////////////////////////////// diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 195c1d3c69..e137cc158b 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -2665,6 +2665,49 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urPhysicalMemGetInfo +__urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t + hPhysicalMem, ///< [in] handle of the physical memory object to query. + ur_physical_mem_info_t propName, ///< [in] type of the info to query. + size_t + propSize, ///< [in] size in bytes of the memory pointed to by pPropValue. + void * + pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding + ///< the info. If propSize is less than the real number of bytes needed to + ///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pPropValue is not used. + size_t * + pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName." +) { + auto pfnGetInfo = getContext()->urDdiTable.PhysicalMem.pfnGetInfo; + + if (nullptr == pfnGetInfo) { + return UR_RESULT_ERROR_UNINITIALIZED; + } + + if (getContext()->enableParameterValidation) { + if (NULL == hPhysicalMem) { + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + } + + if (UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT < propName) { + return UR_RESULT_ERROR_INVALID_ENUMERATION; + } + } + + if (getContext()->enableLifetimeValidation && + !getContext()->refCountContext->isReferenceValid(hPhysicalMem)) { + getContext()->refCountContext->logInvalidReference(hPhysicalMem); + } + + ur_result_t result = + pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urProgramCreateWithIL __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( @@ -11061,6 +11104,9 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( dditable.pfnRelease = pDdiTable->pfnRelease; pDdiTable->pfnRelease = ur_validation_layer::urPhysicalMemRelease; + dditable.pfnGetInfo = pDdiTable->pfnGetInfo; + pDdiTable->pfnGetInfo = ur_validation_layer::urPhysicalMemGetInfo; + return result; } diff --git a/source/loader/loader.def.in b/source/loader/loader.def.in index b5c3bde6ea..beeb80d2a3 100644 --- a/source/loader/loader.def.in +++ b/source/loader/loader.def.in @@ -160,6 +160,7 @@ EXPORTS urMemRelease urMemRetain urPhysicalMemCreate + urPhysicalMemGetInfo urPhysicalMemRelease urPhysicalMemRetain urPlatformCreateWithNativeHandle @@ -396,6 +397,8 @@ EXPORTS urPrintMemoryScopeCapabilityFlags urPrintPhysicalMemCreateParams urPrintPhysicalMemFlags + urPrintPhysicalMemGetInfoParams + urPrintPhysicalMemInfo urPrintPhysicalMemProperties urPrintPhysicalMemReleaseParams urPrintPhysicalMemRetainParams diff --git a/source/loader/loader.map.in b/source/loader/loader.map.in index 778a5da065..43ac804e5d 100644 --- a/source/loader/loader.map.in +++ b/source/loader/loader.map.in @@ -160,6 +160,7 @@ urMemRelease; urMemRetain; urPhysicalMemCreate; + urPhysicalMemGetInfo; urPhysicalMemRelease; urPhysicalMemRetain; urPlatformCreateWithNativeHandle; @@ -396,6 +397,8 @@ urPrintMemoryScopeCapabilityFlags; urPrintPhysicalMemCreateParams; urPrintPhysicalMemFlags; + urPrintPhysicalMemGetInfoParams; + urPrintPhysicalMemInfo; urPrintPhysicalMemProperties; urPrintPhysicalMemReleaseParams; urPrintPhysicalMemRetainParams; diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index 86a6ad95a0..514050fae3 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -2515,6 +2515,90 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urPhysicalMemGetInfo +__urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t + hPhysicalMem, ///< [in] handle of the physical memory object to query. + ur_physical_mem_info_t propName, ///< [in] type of the info to query. + size_t + propSize, ///< [in] size in bytes of the memory pointed to by pPropValue. + void * + pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding + ///< the info. If propSize is less than the real number of bytes needed to + ///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pPropValue is not used. + size_t * + pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName." +) { + ur_result_t result = UR_RESULT_SUCCESS; + + [[maybe_unused]] auto context = getContext(); + + // extract platform's function pointer table + auto dditable = + reinterpret_cast(hPhysicalMem)->dditable; + auto pfnGetInfo = dditable->ur.PhysicalMem.pfnGetInfo; + if (nullptr == pfnGetInfo) { + return UR_RESULT_ERROR_UNINITIALIZED; + } + + // convert loader handle to platform handle + hPhysicalMem = + reinterpret_cast(hPhysicalMem)->handle; + + // this value is needed for converting adapter handles to loader handles + size_t sizeret = 0; + if (pPropSizeRet == NULL) { + pPropSizeRet = &sizeret; + } + + // forward to device-platform + result = + pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); + + if (UR_RESULT_SUCCESS != result) { + return result; + } + + try { + if (pPropValue != nullptr) { + switch (propName) { + case UR_PHYSICAL_MEM_INFO_CONTEXT: { + ur_context_handle_t *handles = + reinterpret_cast(pPropValue); + size_t nelements = *pPropSizeRet / sizeof(ur_context_handle_t); + for (size_t i = 0; i < nelements; ++i) { + if (handles[i] != nullptr) { + handles[i] = reinterpret_cast( + context->factories.ur_context_factory.getInstance( + handles[i], dditable)); + } + } + } break; + case UR_PHYSICAL_MEM_INFO_DEVICE: { + ur_device_handle_t *handles = + reinterpret_cast(pPropValue); + size_t nelements = *pPropSizeRet / sizeof(ur_device_handle_t); + for (size_t i = 0; i < nelements; ++i) { + if (handles[i] != nullptr) { + handles[i] = reinterpret_cast( + context->factories.ur_device_factory.getInstance( + handles[i], dditable)); + } + } + } break; + default: { + } break; + } + } + } catch (std::bad_alloc &) { + result = UR_RESULT_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urProgramCreateWithIL __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( @@ -10179,6 +10263,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable( pDdiTable->pfnCreate = ur_loader::urPhysicalMemCreate; pDdiTable->pfnRetain = ur_loader::urPhysicalMemRetain; pDdiTable->pfnRelease = ur_loader::urPhysicalMemRelease; + pDdiTable->pfnGetInfo = ur_loader::urPhysicalMemGetInfo; } else { // return pointers directly to platform's DDIs *pDdiTable = ur_loader::getContext() diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 8dca26d4ba..e7b232e8f2 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -2956,6 +2956,43 @@ ur_result_t UR_APICALL urPhysicalMemRelease( return exceptionToResult(std::current_exception()); } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get information about a physical memory object. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPhysicalMem` +/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION +/// + `::UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT < propName` +ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t + hPhysicalMem, ///< [in] handle of the physical memory object to query. + ur_physical_mem_info_t propName, ///< [in] type of the info to query. + size_t + propSize, ///< [in] size in bytes of the memory pointed to by pPropValue. + void * + pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding + ///< the info. If propSize is less than the real number of bytes needed to + ///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pPropValue is not used. + size_t * + pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName." + ) try { + auto pfnGetInfo = ur_lib::getContext()->urDdiTable.PhysicalMem.pfnGetInfo; + if (nullptr == pfnGetInfo) { + return UR_RESULT_ERROR_UNINITIALIZED; + } + + return pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, + pPropSizeRet); +} catch (...) { + return exceptionToResult(std::current_exception()); +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Create a program object from input intermediate language. /// diff --git a/source/loader/ur_print.cpp b/source/loader/ur_print.cpp index d8206edb3f..72d158b27d 100644 --- a/source/loader/ur_print.cpp +++ b/source/loader/ur_print.cpp @@ -604,6 +604,14 @@ urPrintPhysicalMemProperties(const struct ur_physical_mem_properties_t params, return str_copy(&ss, buffer, buff_size, out_size); } +ur_result_t urPrintPhysicalMemInfo(enum ur_physical_mem_info_t value, + char *buffer, const size_t buff_size, + size_t *out_size) { + std::stringstream ss; + ss << value; + return str_copy(&ss, buffer, buff_size, out_size); +} + ur_result_t urPrintProgramMetadataType(enum ur_program_metadata_type_t value, char *buffer, const size_t buff_size, size_t *out_size) { @@ -2184,6 +2192,14 @@ ur_result_t urPrintPhysicalMemReleaseParams( return str_copy(&ss, buffer, buff_size, out_size); } +ur_result_t urPrintPhysicalMemGetInfoParams( + const struct ur_physical_mem_get_info_params_t *params, char *buffer, + const size_t buff_size, size_t *out_size) { + std::stringstream ss; + ss << params; + return str_copy(&ss, buffer, buff_size, out_size); +} + ur_result_t urPrintPlatformGetParams(const struct ur_platform_get_params_t *params, char *buffer, const size_t buff_size, diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 22c76f122e..e0a699617d 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -2530,6 +2530,36 @@ ur_result_t UR_APICALL urPhysicalMemRelease( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Get information about a physical memory object. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPhysicalMem` +/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION +/// + `::UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT < propName` +ur_result_t UR_APICALL urPhysicalMemGetInfo( + ur_physical_mem_handle_t + hPhysicalMem, ///< [in] handle of the physical memory object to query. + ur_physical_mem_info_t propName, ///< [in] type of the info to query. + size_t + propSize, ///< [in] size in bytes of the memory pointed to by pPropValue. + void * + pPropValue, ///< [out][optional][typename(propName, propSize)] array of bytes holding + ///< the info. If propSize is less than the real number of bytes needed to + ///< return the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is + ///< returned and pPropValue is not used. + size_t * + pPropSizeRet ///< [out][optional] pointer to the actual size in bytes of the queried propName." +) { + ur_result_t result = UR_RESULT_SUCCESS; + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Create a program object from input intermediate language. /// diff --git a/test/conformance/testing/include/uur/fixtures.h b/test/conformance/testing/include/uur/fixtures.h index 436e7821a9..a8839818d0 100644 --- a/test/conformance/testing/include/uur/fixtures.h +++ b/test/conformance/testing/include/uur/fixtures.h @@ -941,13 +941,9 @@ struct urPhysicalMemTest : urVirtualMemGranularityTest { void SetUp() override { UUR_RETURN_ON_FATAL_FAILURE(urVirtualMemGranularityTest::SetUp()); size = granularity * 256; - ur_physical_mem_properties_t props{ - UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES, - nullptr, - 0 /*flags*/, - }; - ASSERT_SUCCESS( - urPhysicalMemCreate(context, device, size, &props, &physical_mem)); + + ASSERT_SUCCESS(urPhysicalMemCreate(context, device, size, &properties, + &physical_mem)); ASSERT_NE(physical_mem, nullptr); } @@ -960,6 +956,11 @@ struct urPhysicalMemTest : urVirtualMemGranularityTest { size_t size = 0; ur_physical_mem_handle_t physical_mem = nullptr; + ur_physical_mem_properties_t properties{ + UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES, + nullptr, + 0 /*flags*/, + }; }; template diff --git a/test/conformance/virtual_memory/CMakeLists.txt b/test/conformance/virtual_memory/CMakeLists.txt index 6ae27f443b..d05db83bd5 100644 --- a/test/conformance/virtual_memory/CMakeLists.txt +++ b/test/conformance/virtual_memory/CMakeLists.txt @@ -7,6 +7,7 @@ add_conformance_test_with_devices_environment(virtual_memory urPhysicalMemCreate.cpp urPhysicalMemRelease.cpp urPhysicalMemRetain.cpp + urPhysicalMemGetInfo.cpp urVirtualMemFree.cpp urVirtualMemGetInfo.cpp urVirtualMemGranularityGetInfo.cpp diff --git a/test/conformance/virtual_memory/urPhysicalMemCreate.cpp b/test/conformance/virtual_memory/urPhysicalMemCreate.cpp index 236450a1ab..e7867a8a72 100644 --- a/test/conformance/virtual_memory/urPhysicalMemCreate.cpp +++ b/test/conformance/virtual_memory/urPhysicalMemCreate.cpp @@ -25,15 +25,49 @@ struct urPhysicalMemCreateTest ur_physical_mem_handle_t physical_mem = nullptr; }; -UUR_TEST_SUITE_P(urPhysicalMemCreateTest, ::testing::Values(1, 2, 3, 7, 12, 44), +using urPhysicalMemCreateWithSizeParamTest = urPhysicalMemCreateTest; +UUR_TEST_SUITE_P(urPhysicalMemCreateWithSizeParamTest, + ::testing::Values(1, 2, 3, 7, 12, 44), uur::deviceTestWithParamPrinter); -TEST_P(urPhysicalMemCreateTest, Success) { +TEST_P(urPhysicalMemCreateWithSizeParamTest, Success) { ASSERT_SUCCESS( urPhysicalMemCreate(context, device, size, nullptr, &physical_mem)); ASSERT_NE(physical_mem, nullptr); } +TEST_P(urPhysicalMemCreateWithSizeParamTest, InvalidSize) { + if (granularity == 1) { + GTEST_SKIP() + << "A granularity of 1 means that any size will be accepted."; + } + size_t invalid_size = size - 1; + ASSERT_EQ_RESULT(urPhysicalMemCreate(context, device, invalid_size, nullptr, + &physical_mem), + UR_RESULT_ERROR_INVALID_SIZE); +} + +using urPhysicalMemCreateWithFlagsParamTest = + uur::urPhysicalMemTestWithParam; +UUR_TEST_SUITE_P(urPhysicalMemCreateWithFlagsParamTest, + ::testing::Values(UR_PHYSICAL_MEM_FLAG_TBD), + uur::deviceTestWithParamPrinter); + +TEST_P(urPhysicalMemCreateWithFlagsParamTest, Success) { + ur_physical_mem_properties_t properties; + properties.stype = UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES; + properties.pNext = nullptr; + properties.flags = getParam(); + + ASSERT_SUCCESS( + urPhysicalMemCreate(context, device, size, &properties, &physical_mem)); + ASSERT_NE(physical_mem, nullptr); +} + +using urPhysicalMemCreateTest = urPhysicalMemCreateTest; +UUR_TEST_SUITE_P(urPhysicalMemCreateTest, ::testing::Values(1), + uur::deviceTestWithParamPrinter); + TEST_P(urPhysicalMemCreateTest, InvalidNullHandleContext) { ASSERT_EQ_RESULT( urPhysicalMemCreate(nullptr, device, size, nullptr, &physical_mem), @@ -52,13 +86,13 @@ TEST_P(urPhysicalMemCreateTest, InvalidNullPointerPhysicalMem) { UR_RESULT_ERROR_INVALID_NULL_POINTER); } -TEST_P(urPhysicalMemCreateTest, InvalidSize) { - if (granularity == 1) { - GTEST_SKIP() - << "A granularity of 1 means that any size will be accepted."; - } - size_t invalid_size = size - 1; - ASSERT_EQ_RESULT(urPhysicalMemCreate(context, device, invalid_size, nullptr, - &physical_mem), - UR_RESULT_ERROR_INVALID_SIZE); +TEST_P(urPhysicalMemCreateTest, InvalidEnumeration) { + ur_physical_mem_properties_t properties; + properties.stype = UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES; + properties.pNext = nullptr; + properties.flags = UR_PHYSICAL_MEM_FLAG_FORCE_UINT32; + + ASSERT_EQ_RESULT( + urPhysicalMemCreate(context, device, size, &properties, &physical_mem), + UR_RESULT_ERROR_INVALID_ENUMERATION); } diff --git a/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp b/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp new file mode 100644 index 0000000000..ca2595d0fa --- /dev/null +++ b/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp @@ -0,0 +1,93 @@ +// Copyright (C) 2024 Intel Corporation +// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. +// See LICENSE.TXT +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include + +using urPhysicalMemGetInfoTest = uur::urPhysicalMemTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urPhysicalMemGetInfoTest); + +TEST_P(urPhysicalMemGetInfoTest, Context) { + size_t info_size = 0; + + ASSERT_SUCCESS(urPhysicalMemGetInfo( + physical_mem, UR_PHYSICAL_MEM_INFO_CONTEXT, 0, nullptr, &info_size)); + ASSERT_NE(info_size, 0); + + std::vector data(info_size); + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, + UR_PHYSICAL_MEM_INFO_CONTEXT, + data.size(), data.data(), nullptr)); + + auto returned_context = + reinterpret_cast(data.data()); + ASSERT_EQ(context, *returned_context); +} + +TEST_P(urPhysicalMemGetInfoTest, Device) { + size_t info_size = 0; + + ASSERT_SUCCESS(urPhysicalMemGetInfo( + physical_mem, UR_PHYSICAL_MEM_INFO_DEVICE, 0, nullptr, &info_size)); + ASSERT_NE(info_size, 0); + + std::vector data(info_size); + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, + UR_PHYSICAL_MEM_INFO_DEVICE, + data.size(), data.data(), nullptr)); + + auto returned_device = reinterpret_cast(data.data()); + ASSERT_EQ(device, *returned_device); +} + +TEST_P(urPhysicalMemGetInfoTest, Size) { + size_t info_size = 0; + + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_SIZE, + 0, nullptr, &info_size)); + ASSERT_NE(info_size, 0); + + std::vector data(info_size); + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_SIZE, + data.size(), data.data(), nullptr)); + + auto returned_size = reinterpret_cast(data.data()); + ASSERT_EQ(size, *returned_size); +} + +TEST_P(urPhysicalMemGetInfoTest, Properties) { + size_t info_size = 0; + + ASSERT_SUCCESS(urPhysicalMemGetInfo( + physical_mem, UR_PHYSICAL_MEM_INFO_PROPERTIES, 0, nullptr, &info_size)); + ASSERT_NE(info_size, 0); + + std::vector data(info_size); + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, + UR_PHYSICAL_MEM_INFO_PROPERTIES, + data.size(), data.data(), nullptr)); + + auto returned_properties = + reinterpret_cast(data.data()); + ASSERT_EQ(properties.stype, returned_properties->stype); + ASSERT_EQ(properties.pNext, returned_properties->pNext); + ASSERT_EQ(properties.flags, returned_properties->flags); +} + +TEST_P(urPhysicalMemGetInfoTest, ReferenceCount) { + size_t info_size = 0; + + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, + UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, 0, + nullptr, &info_size)); + ASSERT_NE(info_size, 0); + + std::vector data(info_size); + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, + UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, + data.size(), data.data(), nullptr)); + + const size_t ReferenceCount = + *reinterpret_cast(data.data()); + ASSERT_EQ(ReferenceCount, 1); +} diff --git a/test/conformance/virtual_memory/urPhysicalMemRelease.cpp b/test/conformance/virtual_memory/urPhysicalMemRelease.cpp index 834a15e50f..e7a7e3855c 100644 --- a/test/conformance/virtual_memory/urPhysicalMemRelease.cpp +++ b/test/conformance/virtual_memory/urPhysicalMemRelease.cpp @@ -8,8 +8,23 @@ using urPhysicalMemReleaseTest = uur::urPhysicalMemTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urPhysicalMemReleaseTest); TEST_P(urPhysicalMemReleaseTest, Success) { + uint32_t referenceCount = 0; + ASSERT_SUCCESS( + urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, + sizeof(referenceCount), &referenceCount, nullptr)); + ASSERT_GE(referenceCount, 1); + ASSERT_SUCCESS(urPhysicalMemRetain(physical_mem)); + ASSERT_SUCCESS( + urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, + sizeof(referenceCount), &referenceCount, nullptr)); + ASSERT_EQ(referenceCount, 2); + ASSERT_SUCCESS(urPhysicalMemRelease(physical_mem)); + ASSERT_SUCCESS( + urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, + sizeof(referenceCount), &referenceCount, nullptr)); + ASSERT_EQ(referenceCount, 1); } TEST_P(urPhysicalMemReleaseTest, InvalidNullHandlePhysicalMem) { diff --git a/test/conformance/virtual_memory/urPhysicalMemRetain.cpp b/test/conformance/virtual_memory/urPhysicalMemRetain.cpp index a438e1072d..4e8883fa2c 100644 --- a/test/conformance/virtual_memory/urPhysicalMemRetain.cpp +++ b/test/conformance/virtual_memory/urPhysicalMemRetain.cpp @@ -8,8 +8,23 @@ using urPhysicalMemRetainTest = uur::urPhysicalMemTest; UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urPhysicalMemRetainTest); TEST_P(urPhysicalMemRetainTest, Success) { + uint32_t referenceCount = 0; + ASSERT_SUCCESS( + urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, + sizeof(referenceCount), &referenceCount, nullptr)); + ASSERT_GE(referenceCount, 1); + ASSERT_SUCCESS(urPhysicalMemRetain(physical_mem)); + ASSERT_SUCCESS( + urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, + sizeof(referenceCount), &referenceCount, nullptr)); + ASSERT_EQ(referenceCount, 2); + ASSERT_SUCCESS(urPhysicalMemRelease(physical_mem)); + ASSERT_SUCCESS( + urPhysicalMemGetInfo(physical_mem, UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT, + sizeof(referenceCount), &referenceCount, nullptr)); + ASSERT_EQ(referenceCount, 1); } TEST_P(urPhysicalMemRetainTest, InvalidNullHandlePhysicalMem) { diff --git a/test/conformance/virtual_memory/urVirtualMemMap.cpp b/test/conformance/virtual_memory/urVirtualMemMap.cpp index bed65e2018..f6ed600e0a 100644 --- a/test/conformance/virtual_memory/urVirtualMemMap.cpp +++ b/test/conformance/virtual_memory/urVirtualMemMap.cpp @@ -4,15 +4,23 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urVirtualMemMapTest = uur::urVirtualMemTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urVirtualMemMapTest); +using urVirtualMemMapWithFlagsTest = + uur::urVirtualMemTestWithParam; +UUR_TEST_SUITE_P(urVirtualMemMapWithFlagsTest, + ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); -TEST_P(urVirtualMemMapTest, Success) { +TEST_P(urVirtualMemMapWithFlagsTest, Success) { ASSERT_SUCCESS(urVirtualMemMap(context, virtual_ptr, size, physical_mem, 0, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE)); + getParam())); EXPECT_SUCCESS(urVirtualMemUnmap(context, virtual_ptr, size)); } +using urVirtualMemMapTest = uur::urVirtualMemTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urVirtualMemMapTest); + TEST_P(urVirtualMemMapTest, InvalidNullHandleContext) { ASSERT_EQ_RESULT(urVirtualMemMap(nullptr, virtual_ptr, size, physical_mem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE), diff --git a/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp b/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp index 7b06ffb6ba..2010bbd9fc 100644 --- a/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp +++ b/test/conformance/virtual_memory/urVirtualMemSetAccess.cpp @@ -4,20 +4,32 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include -using urVirtualMemSetAccessTest = uur::urVirtualMemMappedTest; -UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urVirtualMemSetAccessTest); +using urVirtualMemSetAccessWithFlagsTest = + uur::urVirtualMemMappedTestWithParam; +UUR_TEST_SUITE_P(urVirtualMemSetAccessWithFlagsTest, + ::testing::Values(UR_VIRTUAL_MEM_ACCESS_FLAG_NONE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE, + UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), + uur::deviceTestWithParamPrinter); -TEST_P(urVirtualMemSetAccessTest, Success) { - ASSERT_SUCCESS(urVirtualMemSetAccess(context, virtual_ptr, size, - UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY)); +TEST_P(urVirtualMemSetAccessWithFlagsTest, Success) { + ASSERT_SUCCESS( + urVirtualMemSetAccess(context, virtual_ptr, size, getParam())); ur_virtual_mem_access_flags_t flags = 0; ASSERT_SUCCESS(urVirtualMemGetInfo(context, virtual_ptr, size, UR_VIRTUAL_MEM_INFO_ACCESS_MODE, sizeof(flags), &flags, nullptr)); - ASSERT_TRUE(flags & UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY); + if (getParam() == UR_VIRTUAL_MEM_ACCESS_FLAG_NONE) { + ASSERT_TRUE(flags == 0 || flags == UR_VIRTUAL_MEM_ACCESS_FLAG_NONE); + } else { + ASSERT_TRUE(flags & getParam()); + } } +using urVirtualMemSetAccessTest = uur::urVirtualMemMappedTest; +UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urVirtualMemSetAccessTest); + TEST_P(urVirtualMemSetAccessTest, InvalidNullHandleContext) { ASSERT_EQ_RESULT( urVirtualMemSetAccess(nullptr, virtual_ptr, size, @@ -31,3 +43,10 @@ TEST_P(urVirtualMemSetAccessTest, InvalidNullPointerStart) { UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY), UR_RESULT_ERROR_INVALID_NULL_POINTER); } + +TEST_P(urVirtualMemSetAccessTest, InvalidEnumeration) { + ASSERT_EQ_RESULT( + urVirtualMemSetAccess(context, virtual_ptr, size, + UR_VIRTUAL_MEM_ACCESS_FLAG_FORCE_UINT32), + UR_RESULT_ERROR_INVALID_ENUMERATION); +} diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match index 627d8eaa78..633aa41f90 100644 --- a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match +++ b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match @@ -1,5 +1,6 @@ -{{OPT}}urPhysicalMemCreateTest.Success/*__3 -{{OPT}}urPhysicalMemCreateTest.Success/*__7 -{{OPT}}urPhysicalMemCreateTest.Success/*__12 -urPhysicalMemCreateTest.Success/*__44 -urPhysicalMemCreateTest.InvalidSize/* +{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/* +urPhysicalMemCreateWithSizeParamTest.InvalidSize/* +urPhysicalMemGetInfoTest.Context/* +urPhysicalMemGetInfoTest.Device/* +urPhysicalMemGetInfoTest.Size/* +urPhysicalMemGetInfoTest.Properties/* diff --git a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match index ec7be06f7e..531773a246 100644 --- a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match +++ b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero_v2.match @@ -1,12 +1,19 @@ -urPhysicalMemCreateTest.Success/* +urPhysicalMemCreateWithSizeParamTest.Success/* +urPhysicalMemCreateWithFlagsParamTest.Success/* urPhysicalMemCreateTest.InvalidNullHandleContext/* urPhysicalMemCreateTest.InvalidNullHandleDevice/* urPhysicalMemCreateTest.InvalidNullPointerPhysicalMem/* -urPhysicalMemCreateTest.InvalidSize/* +urPhysicalMemCreateTest.InvalidEnumeration/* +urPhysicalMemCreateWithSizeParamTest.InvalidSize/* urPhysicalMemReleaseTest.Success/* urPhysicalMemReleaseTest.InvalidNullHandlePhysicalMem/* urPhysicalMemRetainTest.Success/* urPhysicalMemRetainTest.InvalidNullHandlePhysicalMem/* +urPhysicalMemGetInfoTest.Context/* +urPhysicalMemGetInfoTest.Device/* +urPhysicalMemGetInfoTest.Size/* +urPhysicalMemGetInfoTest.Properties/* +urPhysicalMemGetInfoTest.ReferenceCount/* urVirtualMemFreeTest.Success/* urVirtualMemFreeTest.InvalidNullHandleContext/* urVirtualMemFreeTest.InvalidNullPointerStart/* @@ -17,7 +24,7 @@ urVirtualMemGetInfoTest.InvalidEnumerationInfo/* urVirtualMemGranularityGetInfoTest.Success/*__UR_VIRTUAL_MEM_GRANULARITY_INFO_MINIMUM urVirtualMemGranularityGetInfoTest.Success/*__UR_VIRTUAL_MEM_GRANULARITY_INFO_RECOMMENDED urVirtualMemGranularityGetInfoNegativeTest.InvalidSizePropSizeSmall/* -urVirtualMemMapTest.Success/* +urVirtualMemMapWithFlagsTest.Success/* urVirtualMemMapTest.InvalidNullHandleContext/* urVirtualMemMapTest.InvalidNullHandlePhysicalMem/* urVirtualMemMapTest.InvalidNullPointerStart/* @@ -26,9 +33,10 @@ urVirtualMemReserveTestWithParam.SuccessNoStartPointer/* urVirtualMemReserveTestWithParam.SuccessWithStartPointer/* urVirtualMemReserveTest.InvalidNullHandleContext/* urVirtualMemReserveTest.InvalidNullPointer/* -urVirtualMemSetAccessTest.Success/* +urVirtualMemSetAccessWithFlagsTest.Success/* urVirtualMemSetAccessTest.InvalidNullHandleContext/* urVirtualMemSetAccessTest.InvalidNullPointerStart/* +urVirtualMemSetAccessTest.InvalidEnumeration/* urVirtualMemUnmapTest.Success/* urVirtualMemUnmapTest.InvalidNullHandleContext/* urVirtualMemUnmapTest.InvalidNullPointerStart/*