wsl/hsakmt: drop duplicated MIN&MAX

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: lyndonli <Lyndon.Li@amd.com>
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/5>
This commit is contained in:
Flora Cui
2024-11-05 13:23:58 +08:00
committed by Frank Min
parent 0e6b5e4f9e
commit 31e133ae49
2 changed files with 3 additions and 10 deletions
-8
View File
@@ -163,14 +163,6 @@ void topology_setup_is_dgpu_param(HsaNodeProperties *props);
HSAuint32 PageSizeFromFlags(unsigned int pageSizeFlags);
#define MIN(a, b) ({ \
typeof(a) tmp1 = (a), tmp2 = (b); \
tmp1 < tmp2 ? tmp1 : tmp2; })
#define MAX(a, b) ({ \
typeof(a) tmp1 = (a), tmp2 = (b); \
tmp1 > tmp2 ? tmp1 : tmp2; })
uint32_t get_num_sysfs_nodes(void);
bool is_forked_child(void);
+3 -2
View File
@@ -40,6 +40,7 @@
#include "libhsakmt.h"
#include "inc/wddm/types.h"
#include "inc/wddm/device.h"
#include "util/utils.h"
/* Number of memory banks added by thunk on top of topology
* This only includes static heaps like LDS, scratch and SVM,
@@ -1522,7 +1523,7 @@ hsaKmtGetNodeMemoryProperties(HSAuint32 NodeId, HSAuint32 NumBanks,
pthread_mutex_lock(&hsakmt_mutex);
memset(MemoryProperties, 0, NumBanks * sizeof(HsaMemoryProperties));
for (i = 0; i < MIN(g_props[NodeId].node.NumMemoryBanks, NumBanks); i++) {
for (i = 0; i < wsl::Min(g_props[NodeId].node.NumMemoryBanks, NumBanks); i++) {
assert(g_props[NodeId].mem);
MemoryProperties[i] = g_props[NodeId].mem[i];
}
@@ -1576,7 +1577,7 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtGetNodeCacheProperties(
goto out;
}
for (i = 0; i < MIN(g_props[NodeId].node.NumCaches, NumCaches); i++) {
for (i = 0; i < wsl::Min(g_props[NodeId].node.NumCaches, NumCaches); i++) {
assert(g_props[NodeId].cache);
CacheProperties[i] = g_props[NodeId].cache[i];
}