From 76c0c340f928eeb0c6efd2a63e9ca1c2846f1f7f Mon Sep 17 00:00:00 2001 From: Jesse Zhang Date: Thu, 13 Apr 2023 17:23:45 +0800 Subject: [PATCH] libhsakmt: Add compute core check for APU We should check compute core instead of cpu core, in order to exclude the case of APU. Signed-off-by: Jesse zhang Change-Id: I2ec2a6807f51f49f80e0e500f5d9af81c2efae37 [ROCm/ROCR-Runtime commit: 4d54d6e70666a6aea049a03fc9c3a27a61cbe7ce] --- projects/rocr-runtime/src/topology.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/rocr-runtime/src/topology.c b/projects/rocr-runtime/src/topology.c index ba5802da86..8b0b786b9a 100644 --- a/projects/rocr-runtime/src/topology.c +++ b/projects/rocr-runtime/src/topology.c @@ -1098,7 +1098,7 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id, read_size = fread(read_buf, 1, PAGE_SIZE, fd); if (read_size <= 0) { ret = HSAKMT_STATUS_ERROR; - goto err; + goto out; } /* Since we're using the buffer as a string, we make sure the string terminates */ @@ -1193,8 +1193,8 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id, } /* Bail out early, if a CPU node */ - if (props->NumCPUCores) - goto err; + if (!props->NumFComputeCores) + goto out; if (props->NumArrays != 0) props->NumShaderBanks = simd_arrays_count/props->NumArrays; @@ -1214,7 +1214,7 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id, pr_err("HSA_OVERRIDE_GFX_VERSION %s is invalid\n", envvar); ret = HSAKMT_STATUS_ERROR; - goto err; + goto out; } props->EngineId.ui32.Major = major & 0x3f; props->EngineId.ui32.Minor = minor & 0xff; @@ -1263,7 +1263,7 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id, if (!props->NumXcc) props->NumXcc = 1; -err: +out: free(read_buf); fclose(fd); return ret;