@@ -1226,7 +1226,8 @@ enum hwloc_memory_tier_type_e {
1226
1226
HWLOC_MEMORY_TIER_DRAM = 1UL <<1 ,
1227
1227
HWLOC_MEMORY_TIER_GPU = 1UL <<2 ,
1228
1228
HWLOC_MEMORY_TIER_SPM = 1UL <<3 , /* Specific-Purpose Memory is usually HBM, we'll use BW to confirm or force*/
1229
- HWLOC_MEMORY_TIER_NVM = 1UL <<4
1229
+ HWLOC_MEMORY_TIER_NVM = 1UL <<4 ,
1230
+ HWLOC_MEMORY_TIER_CXL = 1UL <<5
1230
1231
};
1231
1232
typedef unsigned long hwloc_memory_tier_type_t ;
1232
1233
#define HWLOC_MEMORY_TIER_UNKNOWN 0UL
@@ -1239,6 +1240,12 @@ static const char * hwloc_memory_tier_type_snprintf(hwloc_memory_tier_type_t typ
1239
1240
case HWLOC_MEMORY_TIER_GPU : return "GPUMemory" ;
1240
1241
case HWLOC_MEMORY_TIER_SPM : return "SPM" ;
1241
1242
case HWLOC_MEMORY_TIER_NVM : return "NVM" ;
1243
+ case HWLOC_MEMORY_TIER_CXL :
1244
+ case HWLOC_MEMORY_TIER_CXL |HWLOC_MEMORY_TIER_DRAM : return "CXL-DRAM" ;
1245
+ case HWLOC_MEMORY_TIER_CXL |HWLOC_MEMORY_TIER_HBM : return "CXL-HBM" ;
1246
+ case HWLOC_MEMORY_TIER_CXL |HWLOC_MEMORY_TIER_GPU : return "CXL-GPUMemory" ;
1247
+ case HWLOC_MEMORY_TIER_CXL |HWLOC_MEMORY_TIER_SPM : return "CXL-SPM" ;
1248
+ case HWLOC_MEMORY_TIER_CXL |HWLOC_MEMORY_TIER_NVM : return "CXL-NVM" ;
1242
1249
default : return NULL ;
1243
1250
}
1244
1251
}
@@ -1333,6 +1340,14 @@ hwloc__group_memory_tiers(hwloc_topology_t topology,
1333
1340
nodeinfos [i ].type = HWLOC_MEMORY_TIER_NVM ;
1334
1341
else if (daxtype && !strcmp (daxtype , "SPM" ))
1335
1342
nodeinfos [i ].type = HWLOC_MEMORY_TIER_SPM ;
1343
+ /* add CXL flag */
1344
+ if (hwloc_obj_get_info_by_name (node , "CXLDevice" ) != NULL ) {
1345
+ /* CXL is always SPM for now. HBM and DRAM not possible here yet.
1346
+ * Hence remove all but NVM first.
1347
+ */
1348
+ nodeinfos [i ].type &= HWLOC_MEMORY_TIER_NVM ;
1349
+ nodeinfos [i ].type |= HWLOC_MEMORY_TIER_CXL ;
1350
+ }
1336
1351
1337
1352
/* get local bandwidth */
1338
1353
imtg = NULL ;
0 commit comments