Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions source/libgpuinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down Expand Up @@ -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 };
Expand Down