@@ -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;
@@ -7403,6 +7410,51 @@ inline std::ostream &operator<<(std::ostream &os, const struct ur_physical_mem_p
74037410 os << "}";
74047411 return os;
74057412}
7413+ ///////////////////////////////////////////////////////////////////////////////
7414+ /// @brief Print operator for the ur_physical_mem_info_t type
7415+ /// @returns
7416+ /// std::ostream &
7417+ inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_info_t value) {
7418+ switch (value) {
7419+ case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT:
7420+ os << "UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT";
7421+ break;
7422+ default:
7423+ os << "unknown enumerator";
7424+ break;
7425+ }
7426+ return os;
7427+ }
7428+ namespace ur::details {
7429+ ///////////////////////////////////////////////////////////////////////////////
7430+ /// @brief Print ur_physical_mem_info_t enum value
7431+ template <>
7432+ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_physical_mem_info_t value, size_t size) {
7433+ if (ptr == NULL) {
7434+ return printPtr(os, ptr);
7435+ }
7436+
7437+ switch (value) {
7438+ case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: {
7439+ const uint32_t *tptr = (const uint32_t *)ptr;
7440+ if (sizeof(uint32_t) > size) {
7441+ os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
7442+ return UR_RESULT_ERROR_INVALID_SIZE;
7443+ }
7444+ os << (const void *)(tptr) << " (";
7445+
7446+ os << *tptr;
7447+
7448+ os << ")";
7449+ } break;
7450+ default:
7451+ os << "unknown enumerator";
7452+ return UR_RESULT_ERROR_INVALID_ENUMERATION;
7453+ }
7454+ return UR_RESULT_SUCCESS;
7455+ }
7456+ } // namespace ur::details
7457+
74067458///////////////////////////////////////////////////////////////////////////////
74077459/// @brief Print operator for the ur_program_metadata_type_t type
74087460/// @returns
@@ -12970,6 +13022,40 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1297013022 return os;
1297113023}
1297213024
13025+ ///////////////////////////////////////////////////////////////////////////////
13026+ /// @brief Print operator for the ur_physical_mem_get_info_params_t type
13027+ /// @returns
13028+ /// std::ostream &
13029+ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_physical_mem_get_info_params_t *params) {
13030+
13031+ os << ".hPhysicalMem = ";
13032+
13033+ ur::details::printPtr(os,
13034+ *(params->phPhysicalMem));
13035+
13036+ os << ", ";
13037+ os << ".propName = ";
13038+
13039+ os << *(params->ppropName);
13040+
13041+ os << ", ";
13042+ os << ".propSize = ";
13043+
13044+ os << *(params->ppropSize);
13045+
13046+ os << ", ";
13047+ os << ".pPropValue = ";
13048+ ur::details::printTagged(os, *(params->ppPropValue), *(params->ppropName), *(params->ppropSize));
13049+
13050+ os << ", ";
13051+ os << ".pPropSizeRet = ";
13052+
13053+ ur::details::printPtr(os,
13054+ *(params->ppPropSizeRet));
13055+
13056+ return os;
13057+ }
13058+
1297313059///////////////////////////////////////////////////////////////////////////////
1297413060/// @brief Print operator for the ur_adapter_get_params_t type
1297513061/// @returns
@@ -18370,6 +18456,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os, ur_function_
1837018456 case UR_FUNCTION_PHYSICAL_MEM_RELEASE: {
1837118457 os << (const struct ur_physical_mem_release_params_t *)params;
1837218458 } break;
18459+ case UR_FUNCTION_PHYSICAL_MEM_GET_INFO: {
18460+ os << (const struct ur_physical_mem_get_info_params_t *)params;
18461+ } break;
1837318462 case UR_FUNCTION_ADAPTER_GET: {
1837418463 os << (const struct ur_adapter_get_params_t *)params;
1837518464 } break;
0 commit comments