From 83d9a48ca581df2ce007ef895450d4723713956c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AF=9B=E6=B5=B7=E5=B9=B3?= Date: Thu, 16 Oct 2025 11:23:40 +0800 Subject: [PATCH] set mask & warning --- impl/kfc/kernel_kfc.h | 2 +- impl/normalization/deepnorm/deepnorm_common_impl.h | 4 ++-- impl/normalization/layernorm/layernorm_common_impl.h | 2 +- .../welfordfinalize/welfordfinalize_common_impl.h | 2 +- impl/sort/topk/topk_common_impl.h | 2 +- tests/activation/sigmoid/test_operator_vec_sigmoid.cpp | 4 ++-- tests/math/axpy/test_operator_axpy.cpp | 4 ++-- tests/math/tanh/test_operator_tanh.cpp | 4 ++-- tests/math/xor/test_operator_xor.cpp | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/impl/kfc/kernel_kfc.h b/impl/kfc/kernel_kfc.h index 147a9bf1..b11e3bbe 100644 --- a/impl/kfc/kernel_kfc.h +++ b/impl/kfc/kernel_kfc.h @@ -38,7 +38,7 @@ __aicore__ inline void clearWorkspace(__gm__ uint8_t *workspace) AscendC::ClearWorkspaceImpl(workspace); AscendC::NotifyEvent(WORKSPACE_SYNC_ID); } else { - AscendC::AscendCUtils::SetMask((uint64_t)-1, (uint64_t)-1); + SetVectorMask((uint64_t)-1, (uint64_t)-1); AscendC::SetMaskNorm(); } #endif diff --git a/impl/normalization/deepnorm/deepnorm_common_impl.h b/impl/normalization/deepnorm/deepnorm_common_impl.h index 33d3f8d8..fbb10ca2 100644 --- a/impl/normalization/deepnorm/deepnorm_common_impl.h +++ b/impl/normalization/deepnorm/deepnorm_common_impl.h @@ -38,8 +38,8 @@ __aicore__ inline bool IsDeepNormParamValid(DeepNormTiling& tiling) const bool bsDivBy8 = ((tiling.bLength * tiling.sLength) % BASIC_BLOCK_BSLENGTH == 0); if constexpr (isBasicBlock) { ASCENDC_ASSERT(hDivBy64 && bsDivBy8, - {KERNEL_LOG(KERNEL_ERROR, "In DeepNorm, when isBasicBlock is true, input must have hLength % 64 = 0, " \ - "originalHLegnth % 64 = 0 and (bLength * sLength) % 8 = 0 !");}); + {KERNEL_LOG(KERNEL_ERROR, "In DeepNorm, when isBasicBlock is true, input must have hLength %% 64 = 0, " \ + "originalHLegnth %% 64 = 0 and (bLength * sLength) % 8 = 0 !");}); } return true; diff --git a/impl/normalization/layernorm/layernorm_common_impl.h b/impl/normalization/layernorm/layernorm_common_impl.h index ae1aab74..2ec5cd5f 100644 --- a/impl/normalization/layernorm/layernorm_common_impl.h +++ b/impl/normalization/layernorm/layernorm_common_impl.h @@ -466,7 +466,7 @@ __aicore__ inline void WelfordUpdateImpl(const LocalTensor& outputMean, const }); ASCENDC_ASSERT((para.abComputeLength > 0), { KERNEL_LOG(KERNEL_ERROR, - "Failed to check para.abComputeLength, para.abComputeLength should be greater than 0.", + "Failed to check para.abComputeLength, para.abComputeLength (%u) should be greater than 0.", para.abComputeLength, para.abLength); }); ASCENDC_ASSERT((para.rnLength == 1), { diff --git a/impl/normalization/welfordfinalize/welfordfinalize_common_impl.h b/impl/normalization/welfordfinalize/welfordfinalize_common_impl.h index 08d405a3..c23609b1 100644 --- a/impl/normalization/welfordfinalize/welfordfinalize_common_impl.h +++ b/impl/normalization/welfordfinalize/welfordfinalize_common_impl.h @@ -421,7 +421,7 @@ __aicore__ inline void GetWelfordFinalizeTensorInfo(const LocalTensor &st // 0x2 indicates reserving two buffers for the storage of mean and variance const uint32_t minTmpOutSize = B32_LEN * 0x2; ASCENDC_ASSERT((stackBuffer.GetSize() >= (minTmpSize + minTmpOutSize)), - { KERNEL_LOG(KERNEL_ERROR, "sharedTmpBuffer size must >= %d Bytes!", (minTmpSize + minTmpOutSize) * sizeof(float)); }); + { KERNEL_LOG(KERNEL_ERROR, "sharedTmpBuffer size must >= %ld Bytes!", (minTmpSize + minTmpOutSize) * sizeof(float)); }); const uint32_t expFactor = (stackBuffer.GetSize() - minTmpOutSize) / minTmpSize; tiling.computeLength = expFactor * B32_LEN; diff --git a/impl/sort/topk/topk_common_impl.h b/impl/sort/topk/topk_common_impl.h index b29b0870..45fda042 100644 --- a/impl/sort/topk/topk_common_impl.h +++ b/impl/sort/topk/topk_common_impl.h @@ -123,7 +123,7 @@ __aicore__ inline void TopKNSmall(const LocalTensor &dstValueLocal, const Loc LocalTensor stackTensor; PopStackBuffer(stackTensor); ASCENDC_ASSERT((stackTensor.GetSize() / sizeof(T) >= tilling.tmpLocalSize), {KERNEL_LOG(KERNEL_ERROR, "The stack " - "buffer is insufficient, TopK api need %d, but only %d exists.", tilling.tmpLocalSize, + "buffer is insufficient, TopK api need %d, but only %ld exists.", tilling.tmpLocalSize, stackTensor.GetSize() / sizeof(T));}); stackTensor.SetSize(tilling.tmpLocalSize * sizeof(T)); diff --git a/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp b/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp index 4d387301..7a65331f 100644 --- a/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp +++ b/tests/activation/sigmoid/test_operator_vec_sigmoid.cpp @@ -30,14 +30,14 @@ void SigmoidKernel(__gm__ uint8_t* __restrict__ srcGm, __gm__ uint8_t* __restric tpipe.InitBuffer(tbuf2, dataSize * sizeof(T)); LocalTensor outputLocal = tbuf2.Get(); - AscendCUtils::SetMask(256); + SetVectorMask(256); DataCopy(inputLocal, inputGlobal, dataSize); event_t eventIdMTE2ToV = static_cast(GetTPipePtr()->FetchEventID(HardEvent::MTE2_V)); SetFlag(eventIdMTE2ToV); WaitFlag(eventIdMTE2ToV); - AscendCUtils::SetMask(128); + SetVectorMask(128); Sigmoid(outputLocal, inputLocal, dataSize); diff --git a/tests/math/axpy/test_operator_axpy.cpp b/tests/math/axpy/test_operator_axpy.cpp index 8a7126a1..ae348c64 100644 --- a/tests/math/axpy/test_operator_axpy.cpp +++ b/tests/math/axpy/test_operator_axpy.cpp @@ -35,11 +35,11 @@ void AxpyKernel(__gm__ uint8_t* __restrict__ srcGm, __gm__ uint8_t* __restrict__ LocalTensor outputLocal = vecOutQue.AllocTensor(); LocalTensor tmpLocal = vecTmpQue.AllocTensor(); - AscendCUtils::SetMask(256); + SetVectorMask(256); DataCopy(inputLocal, inputGlobal, dataSize); SetFlag(EVENT_ID0); - AscendCUtils::SetMask(128); + SetVectorMask(128); WaitFlag(EVENT_ID0); U scalar = 4; diff --git a/tests/math/tanh/test_operator_tanh.cpp b/tests/math/tanh/test_operator_tanh.cpp index 5a3abfd4..cba449a5 100644 --- a/tests/math/tanh/test_operator_tanh.cpp +++ b/tests/math/tanh/test_operator_tanh.cpp @@ -30,12 +30,12 @@ void TanhKernel(__gm__ uint8_t* __restrict__ srcGm, __gm__ uint8_t* __restrict__ tpipe.InitBuffer(tbuf2, dataSize * sizeof(T)); LocalTensor outputLocal = tbuf2.Get(); - AscendCUtils::SetMask(256); + SetVectorMask(256); DataCopy(inputLocal, inputGlobal, dataSize); SetFlag(EVENT_ID0); - AscendCUtils::SetMask(128); + SetVectorMask(128); WaitFlag(EVENT_ID0); Tanh(outputLocal, inputLocal, dataSize); diff --git a/tests/math/xor/test_operator_xor.cpp b/tests/math/xor/test_operator_xor.cpp index edba1b78..b3c3daa8 100644 --- a/tests/math/xor/test_operator_xor.cpp +++ b/tests/math/xor/test_operator_xor.cpp @@ -59,13 +59,13 @@ void main_vec_xor_level2_demo(__gm__ uint8_t* __restrict__ dstGm, input1_local.SetValue(i, 1); } - AscendCUtils::SetMask(256); + SetVectorMask(256); DataCopy(input0_local, input0Global, dataSize); DataCopy(input1_local, input1Global, dataSize); SetFlag(EVENT_ID0); - AscendCUtils::SetMask(128); + SetVectorMask(128); WaitFlag(EVENT_ID0); if (testMode == NORMAL_MODE) { -- Gitee