diff --git a/runtime/dcmi/dcmi.go b/runtime/dcmi/dcmi.go index 9e40c9d6978062d3ad25f308ee0646e1cd3ad008..acf8d98abe394ff19f1dad7d43b16b20c07dee25 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