From 25b5bfe58dd03f8c43c9b3636882a146be213330 Mon Sep 17 00:00:00 2001 From: Martin Morrison-Grant Date: Wed, 30 Oct 2024 16:54:42 +0000 Subject: [PATCH] Improvements to align CTS and Spec for Virtual Memory: - UR_RESULT_ERROR_INVALID_ENUMERATION test for urVirtualMemSetAccess - Add test for urVirtualMemMap with different access flags - Add test for urVirtualMemSetAccess with different access flags - InvalidEnumeration test for urPhysicalMemCreate and changed some tests to only run once - different size values were not needed for these - Add test for urPhysicalMemCreate with different flags (only one placeholder is available, this is just a fixture for future additions) - Add new urPhysicalMemGetInfo entry point along with a reference count enum. Added adapter implementations for this - Add a test for urPhysicalMemGetInfo and modified urPhysicalMemRelease/Retain to use GetInfo to verify reference count is updated accordingly --- include/ur_api.h | 50 +++++++++++ include/ur_api_funcs.def | 1 + include/ur_ddi.h | 10 +++ include/ur_print.h | 16 ++++ include/ur_print.hpp | 89 +++++++++++++++++++ scripts/core/registry.yml | 3 + scripts/core/virtual_memory.yml | 42 +++++++++ source/adapters/cuda/physical_mem.cpp | 16 ++++ source/adapters/cuda/ur_interface_loader.cpp | 1 + source/adapters/hip/physical_mem.cpp | 6 ++ source/adapters/hip/ur_interface_loader.cpp | 1 + source/adapters/level_zero/physical_mem.cpp | 17 ++++ .../level_zero/ur_interface_loader.cpp | 1 + .../level_zero/ur_interface_loader.hpp | 4 + source/adapters/level_zero/v2/api.cpp | 7 ++ source/adapters/mock/ur_mockddi.cpp | 56 ++++++++++++ source/adapters/native_cpu/physical_mem.cpp | 6 ++ .../native_cpu/ur_interface_loader.cpp | 1 + source/adapters/opencl/physical_mem.cpp | 6 ++ .../adapters/opencl/ur_interface_loader.cpp | 1 + source/loader/layers/tracing/ur_trcddi.cpp | 51 +++++++++++ source/loader/layers/validation/ur_valddi.cpp | 46 ++++++++++ source/loader/loader.def.in | 3 + source/loader/loader.map.in | 3 + source/loader/ur_ldrddi.cpp | 40 +++++++++ source/loader/ur_libapi.cpp | 37 ++++++++ source/loader/ur_print.cpp | 16 ++++ source/ur_api.cpp | 30 +++++++ .../conformance/virtual_memory/CMakeLists.txt | 1 + .../virtual_memory/urPhysicalMemCreate.cpp | 56 +++++++++--- .../virtual_memory/urPhysicalMemGetInfo.cpp | 35 ++++++++ .../virtual_memory/urPhysicalMemRelease.cpp | 15 ++++ .../virtual_memory/urPhysicalMemRetain.cpp | 15 ++++ .../virtual_memory/urVirtualMemMap.cpp | 16 +++- .../virtual_memory/urVirtualMemSetAccess.cpp | 31 +++++-- .../virtual_memory_adapter_level_zero.match | 20 ++--- ...virtual_memory_adapter_level_zero_v2.match | 51 +++++------ 37 files changed, 740 insertions(+), 60 deletions(-) create mode 100644 test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp diff --git a/include/ur_api.h b/include/ur_api.h index db1c47b2d5..e0f3c05e1c 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -230,6 +230,7 @@ typedef enum ur_function_t { UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP = 243, ///< Enumerator for ::urCommandBufferUpdateSignalEventExp 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_PHYSICAL_MEM_GET_INFO = 246, ///< Enumerator for ::urPhysicalMemGetInfo /// @cond UR_FUNCTION_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -4107,6 +4108,43 @@ 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_REFERENCE_COUNT = 0, ///< [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 @@ -10966,6 +11004,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 a7ca4d88a0..c757b7790d 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 80a0003fca..4e7d5a1b69 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 1dd874e5a5..32ca8eb8d9 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 @@ -1786,6 +1794,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 0439a12642..791fe19181 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, @@ -290,6 +293,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); @@ -954,6 +958,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) { case UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP: os << "UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP"; break; + case UR_FUNCTION_PHYSICAL_MEM_GET_INFO: + os << "UR_FUNCTION_PHYSICAL_MEM_GET_INFO"; + break; default: os << "unknown enumerator"; break; @@ -7373,6 +7380,51 @@ 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_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_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 @@ -12940,6 +12992,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 @@ -18340,6 +18426,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/registry.yml b/scripts/core/registry.yml index f4ba983bfc..8f25e233dd 100644 --- a/scripts/core/registry.yml +++ b/scripts/core/registry.yml @@ -604,6 +604,9 @@ etors: - name: BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP desc: Enumerator for $xBindlessImagesMapExternalLinearMemoryExp value: '245' +- name: PHYSICAL_MEM_GET_INFO + desc: Enumerator for $xPhysicalMemGetInfo + value: '246' --- type: enum desc: Defines structure types diff --git a/scripts/core/virtual_memory.yml b/scripts/core/virtual_memory.yml index 133266de64..6b1334dce1 100644 --- a/scripts/core/virtual_memory.yml +++ b/scripts/core/virtual_memory.yml @@ -303,3 +303,45 @@ 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: +# properties and size too + - 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..e37d771b31 100644 --- a/source/adapters/cuda/physical_mem.cpp +++ b/source/adapters/cuda/physical_mem.cpp @@ -66,3 +66,19 @@ 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->getReferenceCount()); + } + default: + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + } + return UR_RESULT_SUCCESS; +} 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 1c2f68c07c..cedbf5dacd 100644 --- a/source/adapters/level_zero/ur_interface_loader.cpp +++ b/source/adapters/level_zero/ur_interface_loader.cpp @@ -318,6 +318,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 1207f7776b..068445c026 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 dea28a4658..8d5ad221bf 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( @@ -11258,6 +11312,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 6cd69d84d3..8d62337b66 100644 --- a/source/adapters/opencl/ur_interface_loader.cpp +++ b/source/adapters/opencl/ur_interface_loader.cpp @@ -392,6 +392,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 9cc18c66c4..3495c059b7 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( @@ -9932,6 +9980,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 ef7bb019ea..b78aa2eed2 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -2661,6 +2661,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( @@ -10989,6 +11032,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 c34bde6fd2..3c78d854d3 100644 --- a/source/loader/loader.def.in +++ b/source/loader/loader.def.in @@ -159,6 +159,7 @@ EXPORTS urMemRelease urMemRetain urPhysicalMemCreate + urPhysicalMemGetInfo urPhysicalMemRelease urPhysicalMemRetain urPlatformCreateWithNativeHandle @@ -392,6 +393,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 8333ee2fa4..484c4da961 100644 --- a/source/loader/loader.map.in +++ b/source/loader/loader.map.in @@ -159,6 +159,7 @@ urMemRelease; urMemRetain; urPhysicalMemCreate; + urPhysicalMemGetInfo; urPhysicalMemRelease; urPhysicalMemRetain; urPlatformCreateWithNativeHandle; @@ -392,6 +393,8 @@ urPrintMemoryScopeCapabilityFlags; urPrintPhysicalMemCreateParams; urPrintPhysicalMemFlags; + urPrintPhysicalMemGetInfoParams; + urPrintPhysicalMemInfo; urPrintPhysicalMemProperties; urPrintPhysicalMemReleaseParams; urPrintPhysicalMemRetainParams; diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index a67879a9eb..6d136845d7 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -2515,6 +2515,45 @@ __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; + + // forward to device-platform + result = + pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urProgramCreateWithIL __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( @@ -10112,6 +10151,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 574e81103c..207729fffd 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -2947,6 +2947,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 3a14d9a9de..cc00d1d6ca 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) { @@ -2160,6 +2168,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 79aadc6090..b7e37a7d4a 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -2521,6 +2521,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/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..169d3dfc55 --- /dev/null +++ b/test/conformance/virtual_memory/urPhysicalMemGetInfo.cpp @@ -0,0 +1,35 @@ +// Copyright (C) 2023 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 urPhysicalMemGetInfoWithFlagsParamTest = + uur::urPhysicalMemTestWithParam; +UUR_TEST_SUITE_P(urPhysicalMemGetInfoWithFlagsParamTest, + ::testing::Values(UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT), + uur::deviceTestWithParamPrinter); + +TEST_P(urPhysicalMemGetInfoWithFlagsParamTest, Success) { + size_t info_size = 0; + ur_physical_mem_info_t info = getParam(); + ASSERT_SUCCESS( + urPhysicalMemGetInfo(physical_mem, info, 0, nullptr, &info_size)); + ASSERT_NE(info_size, 0); + + std::vector data(info_size); + ASSERT_SUCCESS(urPhysicalMemGetInfo(physical_mem, info, data.size(), + data.data(), nullptr)); + + switch (info) { + case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: { + const size_t ReferenceCount = + *reinterpret_cast(data.data()); + ASSERT_EQ(ReferenceCount, 1); + } break; + + default: + FAIL() << "Unhandled ur_physical_mem_info_t enumeration: " << info; + break; + } +} diff --git a/test/conformance/virtual_memory/urPhysicalMemRelease.cpp b/test/conformance/virtual_memory/urPhysicalMemRelease.cpp index 834a15e50f..1b86193058 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_EQ(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..240f35cbaa 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_EQ(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 bf8c7ce279..af7666974e 100644 --- a/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match +++ b/test/conformance/virtual_memory/virtual_memory_adapter_level_zero.match @@ -1,11 +1,11 @@ {{NONDETERMINISTIC}} -{{OPT}}urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 -{{OPT}}urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 -{{OPT}}urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 -urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 +{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 +{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 +{{OPT}}urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 +urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 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 1c83fd1e2a..2f3ba36cab 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,38 +1,26 @@ {{NONDETERMINISTIC}} -urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 -urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 -urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 -urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 -urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 -urPhysicalMemCreateTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 +urPhysicalMemCreateWithFlagsParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 +urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 +urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 +urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 +urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 +urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 +urPhysicalMemCreateWithSizeParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 +urPhysicalMemCreateWithSizeParamTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 urPhysicalMemCreateTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 -urPhysicalMemCreateTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 -urPhysicalMemCreateTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 -urPhysicalMemCreateTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 -urPhysicalMemCreateTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 -urPhysicalMemCreateTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 urPhysicalMemCreateTest.InvalidNullHandleDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 -urPhysicalMemCreateTest.InvalidNullHandleDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 -urPhysicalMemCreateTest.InvalidNullHandleDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 -urPhysicalMemCreateTest.InvalidNullHandleDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 -urPhysicalMemCreateTest.InvalidNullHandleDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 -urPhysicalMemCreateTest.InvalidNullHandleDevice/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 urPhysicalMemCreateTest.InvalidNullPointerPhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 -urPhysicalMemCreateTest.InvalidNullPointerPhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 -urPhysicalMemCreateTest.InvalidNullPointerPhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 -urPhysicalMemCreateTest.InvalidNullPointerPhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 -urPhysicalMemCreateTest.InvalidNullPointerPhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 -urPhysicalMemCreateTest.InvalidNullPointerPhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___2 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___3 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___7 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___12 -urPhysicalMemCreateTest.InvalidSize/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___44 +urPhysicalMemCreateTest.InvalidEnumeration/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___1 urPhysicalMemReleaseTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urPhysicalMemReleaseTest.InvalidNullHandlePhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urPhysicalMemRetainTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urPhysicalMemRetainTest.InvalidNullHandlePhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urPhysicalMemGetInfoWithFlagsParamTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT urVirtualMemFreeTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemFreeTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemFreeTest.InvalidNullPointerStart/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ @@ -43,7 +31,9 @@ urVirtualMemGetInfoTest.InvalidEnumerationInfo/Intel_R__oneAPI_Unified_Runtime_o urVirtualMemGranularityGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_GRANULARITY_INFO_MINIMUM urVirtualMemGranularityGetInfoTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_GRANULARITY_INFO_RECOMMENDED urVirtualMemGranularityGetInfoNegativeTest.InvalidSizePropSizeSmall/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urVirtualMemMapTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urVirtualMemMapWithFlagsTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_ACCESS_FLAG_NONE +urVirtualMemMapWithFlagsTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE +urVirtualMemMapWithFlagsTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY urVirtualMemMapTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemMapTest.InvalidNullHandlePhysicalMem/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemMapTest.InvalidNullPointerStart/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ @@ -76,9 +66,12 @@ urVirtualMemReserveTestWithParam.SuccessWithStartPointer/Intel_R__oneAPI_Unified urVirtualMemReserveTestWithParam.SuccessWithStartPointer/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___100000 urVirtualMemReserveTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemReserveTest.InvalidNullPointer/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ -urVirtualMemSetAccessTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemSetAccessTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemSetAccessTest.InvalidNullPointerStart/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urVirtualMemSetAccessTest.InvalidEnumeration/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemUnmapTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemUnmapTest.InvalidNullHandleContext/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ urVirtualMemUnmapTest.InvalidNullPointerStart/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}_ +urVirtualMemSetAccessWithFlagsTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_ACCESS_FLAG_NONE +urVirtualMemSetAccessWithFlagsTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE +urVirtualMemSetAccessWithFlagsTest.Success/Intel_R__oneAPI_Unified_Runtime_over_Level_Zero___{{.*}}___UR_VIRTUAL_MEM_ACCESS_FLAG_READ_ONLY