diff --git a/source/libgpuinfo.cpp b/source/libgpuinfo.cpp index d1adae8..c695c44 100644 --- a/source/libgpuinfo.cpp +++ b/source/libgpuinfo.cpp @@ -852,6 +852,8 @@ class prop_decoder { bool decode(gpuinfo& info) { bool success = true; + // Zero init things we can read out-of-order + info.shader_core_mask = 0; uint64_t raw_gpu_id {}; uint64_t raw_core_features {}; uint64_t raw_thread_features {}; @@ -893,14 +895,19 @@ class prop_decoder { assert(value == 1); break; case prop_id_t::coherency_group_0: - info.num_shader_cores = __builtin_popcount(value); - info.shader_core_mask = value; + case prop_id_t::coherency_group_1: + case prop_id_t::coherency_group_2: + case prop_id_t::coherency_group_3: + info.shader_core_mask |= value; break; default: break; } } + // Accumulate this after all shader core bitmasks are merged + info.num_shader_cores = __builtin_popcount(info.shader_core_mask); + // Decode architecture versions constexpr uint64_t bits4 { 0xF }; constexpr uint64_t bits8 { 0xFF };