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
28 changes: 24 additions & 4 deletions src/topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,35 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,
props.CComputeIdLo = 0;
props.FComputeIdLo = 0;
props.Capability.ui32.ASICRevision = device->AsicRevision();
props.Capability.ui32.WatchPointsTotalBits =
std::log2(device->WatchPointsNum());
props.MaxWavesPerSIMD = device->WavePerCu() / device->SimdPerCu();
uint32_t watch_points_num = device->WatchPointsNum();
if (watch_points_num == 0) {
pr_warn(
"WatchPointsNum is 0 for node %u, forcing WatchPointsTotalBits to 0\n",
node_id);
props.Capability.ui32.WatchPointsTotalBits = 0;
} else {
props.Capability.ui32.WatchPointsTotalBits = std::log2(watch_points_num);
}
uint32_t simd_per_cu = device->SimdPerCu();
if (simd_per_cu == 0) {
pr_warn("SimdPerCu is 0 for node %u, forcing MaxWavesPerSIMD to 0\n",
node_id);
props.MaxWavesPerSIMD = 0;
} else {
props.MaxWavesPerSIMD = device->WavePerCu() / simd_per_cu;
}
props.LDSSizeInKB = device->LdsSize() / 1024;
props.GDSSizeInKB = 0;
props.WaveFrontSize = device->WavefrontSize();
props.NumShaderBanks = device->NumShaderEngine();
props.NumArrays = device->ShaderArrayPerShaderEngine();
props.NumCUPerArray = device->ComputeUnitCount() / props.NumArrays;
if (props.NumArrays == 0) {
pr_warn("NumArrays is 0 for node %u, forcing NumCUPerArray to 0\n",
node_id);
props.NumCUPerArray = 0;
} else {
props.NumCUPerArray = device->ComputeUnitCount() / props.NumArrays;
}
props.NumSIMDPerCU = device->SimdPerCu();
props.MaxSlotsScratchCU = device->MaxScratchSlotsPerCu();
props.VendorId = 0x1002;
Expand Down