@@ -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,
@@ -293,6 +296,7 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_virtual_mem_access_fla
293296inline std::ostream &operator<<(std::ostream &os, enum ur_virtual_mem_info_t value);
294297inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_flag_t value);
295298inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_physical_mem_properties_t params);
299+ inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_info_t value);
296300inline std::ostream &operator<<(std::ostream &os, enum ur_program_metadata_type_t value);
297301inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_program_metadata_t params);
298302inline 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) {
962966 case UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT:
963967 os << "UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT";
964968 break;
969+ case UR_FUNCTION_PHYSICAL_MEM_GET_INFO:
970+ os << "UR_FUNCTION_PHYSICAL_MEM_GET_INFO";
971+ break;
965972 default:
966973 os << "unknown enumerator";
967974 break;
@@ -7434,6 +7441,51 @@ inline std::ostream &operator<<(std::ostream &os, const struct ur_physical_mem_p
74347441 os << "}";
74357442 return os;
74367443}
7444+ ///////////////////////////////////////////////////////////////////////////////
7445+ /// @brief Print operator for the ur_physical_mem_info_t type
7446+ /// @returns
7447+ /// std::ostream &
7448+ inline std::ostream &operator<<(std::ostream &os, enum ur_physical_mem_info_t value) {
7449+ switch (value) {
7450+ case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT:
7451+ os << "UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT";
7452+ break;
7453+ default:
7454+ os << "unknown enumerator";
7455+ break;
7456+ }
7457+ return os;
7458+ }
7459+ namespace ur::details {
7460+ ///////////////////////////////////////////////////////////////////////////////
7461+ /// @brief Print ur_physical_mem_info_t enum value
7462+ template <>
7463+ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_physical_mem_info_t value, size_t size) {
7464+ if (ptr == NULL) {
7465+ return printPtr(os, ptr);
7466+ }
7467+
7468+ switch (value) {
7469+ case UR_PHYSICAL_MEM_INFO_REFERENCE_COUNT: {
7470+ const uint32_t *tptr = (const uint32_t *)ptr;
7471+ if (sizeof(uint32_t) > size) {
7472+ os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
7473+ return UR_RESULT_ERROR_INVALID_SIZE;
7474+ }
7475+ os << (const void *)(tptr) << " (";
7476+
7477+ os << *tptr;
7478+
7479+ os << ")";
7480+ } break;
7481+ default:
7482+ os << "unknown enumerator";
7483+ return UR_RESULT_ERROR_INVALID_ENUMERATION;
7484+ }
7485+ return UR_RESULT_SUCCESS;
7486+ }
7487+ } // namespace ur::details
7488+
74377489///////////////////////////////////////////////////////////////////////////////
74387490/// @brief Print operator for the ur_program_metadata_type_t type
74397491/// @returns
@@ -13085,6 +13137,40 @@ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct
1308513137 return os;
1308613138}
1308713139
13140+ ///////////////////////////////////////////////////////////////////////////////
13141+ /// @brief Print operator for the ur_physical_mem_get_info_params_t type
13142+ /// @returns
13143+ /// std::ostream &
13144+ inline std::ostream &operator<<(std::ostream &os, [[maybe_unused]] const struct ur_physical_mem_get_info_params_t *params) {
13145+
13146+ os << ".hPhysicalMem = ";
13147+
13148+ ur::details::printPtr(os,
13149+ *(params->phPhysicalMem));
13150+
13151+ os << ", ";
13152+ os << ".propName = ";
13153+
13154+ os << *(params->ppropName);
13155+
13156+ os << ", ";
13157+ os << ".propSize = ";
13158+
13159+ os << *(params->ppropSize);
13160+
13161+ os << ", ";
13162+ os << ".pPropValue = ";
13163+ ur::details::printTagged(os, *(params->ppPropValue), *(params->ppropName), *(params->ppropSize));
13164+
13165+ os << ", ";
13166+ os << ".pPropSizeRet = ";
13167+
13168+ ur::details::printPtr(os,
13169+ *(params->ppPropSizeRet));
13170+
13171+ return os;
13172+ }
13173+
1308813174///////////////////////////////////////////////////////////////////////////////
1308913175/// @brief Print operator for the ur_adapter_get_params_t type
1309013176/// @returns
@@ -18528,6 +18614,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os, ur_function_
1852818614 case UR_FUNCTION_PHYSICAL_MEM_RELEASE: {
1852918615 os << (const struct ur_physical_mem_release_params_t *)params;
1853018616 } break;
18617+ case UR_FUNCTION_PHYSICAL_MEM_GET_INFO: {
18618+ os << (const struct ur_physical_mem_get_info_params_t *)params;
18619+ } break;
1853118620 case UR_FUNCTION_ADAPTER_GET: {
1853218621 os << (const struct ur_adapter_get_params_t *)params;
1853318622 } break;
0 commit comments