Fix wrong loop termination condition
Compare with gpu_mem_count instead of deprecated NUM_OF_SUPPORTED_GPUS
to prevent overflows in case no dGPUs are present.
Change-Id: I71fcb7503ba4c20bffadbdb04cefc4e4027a7df7
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
[ROCm/ROCR-Runtime commit: d3228f363e]
此提交包含在:
@@ -223,11 +223,11 @@ static void print_device_id_array(uint32_t *device_id_array, uint32_t device_id_
|
||||
|
||||
static int32_t find_first_dgpu(HSAuint32 *gpu_id)
|
||||
{
|
||||
int32_t i;
|
||||
uint32_t i;
|
||||
|
||||
*gpu_id = NON_VALID_GPU_ID;
|
||||
|
||||
for (i = 0; i < NUM_OF_SUPPORTED_GPUS; i++) {
|
||||
for (i = 0; i < gpu_mem_count; i++) {
|
||||
if (gpu_mem[i].gpu_id == NON_VALID_GPU_ID)
|
||||
continue;
|
||||
if (!topology_is_dgpu(gpu_mem[i].device_id))
|
||||
|
||||
新增問題並參考
封鎖使用者