@@ -2146,6 +2146,23 @@ hwloc__xml_export_object_contents (hwloc__xml_export_state_t state, hwloc_topolo
2146
2146
2147
2147
for (i = 0 ; i < obj -> infos_count ; i ++ )
2148
2148
hwloc__xml_export_info_attr (state , obj -> infos [i ].name , obj -> infos [i ].value );
2149
+
2150
+ if (v2export && obj -> type == HWLOC_OBJ_OS_DEVICE && obj -> subtype && !hwloc_obj_get_info_by_name (obj , "Backend" )) {
2151
+ /* v2 gpus had Backend inside the object itself */
2152
+ if (!strcmp (obj -> subtype , "CUDA" )) {
2153
+ hwloc__xml_export_info_attr_safe (state , "Backend" , "CUDA" );
2154
+ } else if (!strcmp (obj -> subtype , "NVML" )) {
2155
+ hwloc__xml_export_info_attr_safe (state , "Backend" , "NVML" );
2156
+ } else if (!strcmp (obj -> subtype , "OpenCL" )) {
2157
+ hwloc__xml_export_info_attr_safe (state , "Backend" , "OpenCL" );
2158
+ } else if (!strcmp (obj -> subtype , "RSMI" )) {
2159
+ hwloc__xml_export_info_attr_safe (state , "Backend" , "RSMI" );
2160
+ } else if (!strcmp (obj -> subtype , "LevelZero" )) {
2161
+ hwloc__xml_export_info_attr_safe (state , "Backend" , "LevelZero" );
2162
+ } else if (!strcmp (obj -> subtype , "Display" )) {
2163
+ hwloc__xml_export_info_attr_safe (state , "Backend" , "GL" );
2164
+ }
2165
+ }
2149
2166
if (obj -> userdata && topology -> userdata_export_cb )
2150
2167
topology -> userdata_export_cb ((void * ) state , topology , obj );
2151
2168
}
0 commit comments