From 48d2720f45fdfe165842ca41d03b082a9a9780a1 Mon Sep 17 00:00:00 2001 From: LiuYuncheng Date: Tue, 18 Apr 2023 10:47:00 +0800 Subject: [PATCH] Match-id-fe46cf4dfbc78a5607a50116f5e469670d8d880d --- runtime/dcmi/dcmi.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 9e40c9d..acf8d98 100644 --- a/runtime/dcmi/dcmi.go +++ b/runtime/dcmi/dcmi.go @@ -31,6 +31,8 @@ const ( retError = -1 // hiAIMaxCardNum is the max number of cards hiAIMaxCardNum = 64 + // hiAIMaxCardID max card id for Ascend chip + hiAIMaxCardID = math.MaxInt32 // hiAIMaxDeviceNum is the max number of devices in a card hiAIMaxDeviceNum = 4 maxChipNameLen = 32 @@ -55,7 +57,7 @@ type NpuWorker struct { // isValidCardID valid card id func isValidCardID(cardID int32) bool { // for cardID, please watch the maximum value of the driver - return cardID >= 0 && cardID < hiAIMaxCardNum + return cardID >= 0 && cardID < hiAIMaxCardID } // isValidDeviceID valid device id -- Gitee