@@ -153,6 +153,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_virtual_mem
153153template <>
154154inline ur_result_t printFlag<ur_physical_mem_flag_t>(std::ostream &os, uint32_t flag);
155155
156+ template <>
157+ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_physical_mem_info_t value, size_t size);
158+
156159inline ur_result_t printUnion(
157160 std::ostream &os,
158161 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
290293inline std::ostream &operator<<(std::ostream &os, enum ur_virtual_mem_info_t value);
291294inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_flag_t value);
292295inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_physical_mem_properties_t params);
296+ inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_info_t value);
293297inline std::ostream &operator<<(std::ostream &os, enum ur_program_metadata_type_t value);
294298inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_program_metadata_t params);
295299inline 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) {
954958 case UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP:
955959 os << "UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP";
956960 break;
961+ case UR_FUNCTION_PHYSICAL_MEM_GET_INFO:
962+ os << "UR_FUNCTION_PHYSICAL_MEM_GET_INFO";
963+ break;
957964 default:
958965 os << "unknown enumerator";
959966 break;
@@ -7373,6 +7380,51 @@ inline std::ostream &operator<<(std::ostream &os, const struct ur_physical_mem_p
73737380 os << "}";
73747381 return os;
73757382}
7383+ ///////////////////////////////////////////////////////////////////////////////
7384+ /// @brief Print operator for the ur_physical_mem_info_t type
7385+ /// @returns
7386+ /// std::ostream &
7387+ inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_info_t value) {
7388+ switch (value) {
7389+ case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT:
7390+ os << "UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT";
7391+ break;
7392+ default:
7393+ os << "unknown enumerator";
7394+ break;
7395+ }
7396+ return os;
7397+ }
7398+ namespace ur::details {
7399+ ///////////////////////////////////////////////////////////////////////////////
7400+ /// @brief Print ur_physical_mem_info_t enum value
7401+ template <>
7402+ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_physical_mem_info_t value, size_t size) {
7403+ if (ptr == NULL) {
7404+ return printPtr(os, ptr);
7405+ }
7406+
7407+ switch (value) {
7408+ case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: {
7409+ const uint32_t *tptr = (const uint32_t *)ptr;
7410+ if (sizeof(uint32_t) > size) {
7411+ os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
7412+ return UR_RESULT_ERROR_INVALID_SIZE;
7413+ }
7414+ os << (const void *)(tptr) << " (";
7415+
7416+ os << *tptr;
7417+
7418+ os << ")";
7419+ } break;
7420+ default:
7421+ os << "unknown enumerator";
7422+ return UR_RESULT_ERROR_INVALID_ENUMERATION;
7423+ }
7424+ return UR_RESULT_SUCCESS;
7425+ }
7426+ } // namespace ur::details
7427+
73767428///////////////////////////////////////////////////////////////////////////////
73777429/// @brief Print operator for the ur_program_metadata_type_t type
73787430/// @returns
@@ -12940,6 +12992,40 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1294012992 return os;
1294112993}
1294212994
12995+ ///////////////////////////////////////////////////////////////////////////////
12996+ /// @brief Print operator for the ur_physical_mem_get_info_params_t type
12997+ /// @returns
12998+ /// std::ostream &
12999+ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_physical_mem_get_info_params_t *params) {
13000+
13001+ os << ".hPhysicalMem = ";
13002+
13003+ ur::details::printPtr(os,
13004+ *(params->phPhysicalMem));
13005+
13006+ os << ", ";
13007+ os << ".propName = ";
13008+
13009+ os << *(params->ppropName);
13010+
13011+ os << ", ";
13012+ os << ".propSize = ";
13013+
13014+ os << *(params->ppropSize);
13015+
13016+ os << ", ";
13017+ os << ".pPropValue = ";
13018+ ur::details::printTagged(os, *(params->ppPropValue), *(params->ppropName), *(params->ppropSize));
13019+
13020+ os << ", ";
13021+ os << ".pPropSizeRet = ";
13022+
13023+ ur::details::printPtr(os,
13024+ *(params->ppPropSizeRet));
13025+
13026+ return os;
13027+ }
13028+
1294313029///////////////////////////////////////////////////////////////////////////////
1294413030/// @brief Print operator for the ur_adapter_get_params_t type
1294513031/// @returns
@@ -18340,6 +18426,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os, ur_function_
1834018426 case UR_FUNCTION_PHYSICAL_MEM_RELEASE: {
1834118427 os << (const struct ur_physical_mem_release_params_t *)params;
1834218428 } break;
18429+ case UR_FUNCTION_PHYSICAL_MEM_GET_INFO: {
18430+ os << (const struct ur_physical_mem_get_info_params_t *)params;
18431+ } break;
1834318432 case UR_FUNCTION_ADAPTER_GET: {
1834418433 os << (const struct ur_adapter_get_params_t *)params;
1834518434 } break;
0 commit comments