已合并
fix: fix clean code warnings #3941
likun104创建于 7月9日
fix: fix clean code warnings #3941
已合并
共 41 个文件变更+186-147
| @@ -43,7 +43,7 @@ class ExternalAllocatorDesc { | |||
| 43 | freeFunc(freeFunction), | 43 | freeFunc(freeFunction), |
| 44 | allocAdviseFunc(allocAdviseFunction), | 44 | allocAdviseFunc(allocAdviseFunction), |
| 45 | getAddrFromBlockFunc(getAddrFromBlockFunction) {} | 45 | getAddrFromBlockFunc(getAddrFromBlockFunction) {} |
| 46 | - ~ExternalAllocatorDesc() {} | 46 | + ~ExternalAllocatorDesc() = default; |
| 47 | bool operator==(const ExternalAllocatorDesc &allocatorDesc) const { | 47 | bool operator==(const ExternalAllocatorDesc &allocatorDesc) const { |
| 48 | return obj == allocatorDesc.obj && allocFunc == allocatorDesc.allocFunc && freeFunc == allocatorDesc.freeFunc && | 48 | return obj == allocatorDesc.obj && allocFunc == allocatorDesc.allocFunc && freeFunc == allocatorDesc.freeFunc && |
| 49 | allocAdviseFunc == allocatorDesc.allocAdviseFunc && | 49 | allocAdviseFunc == allocatorDesc.allocAdviseFunc && |
| @@ -25,7 +25,7 @@ | |||
| 25 | namespace acl { | 25 | namespace acl { |
| 26 | aclError AippScfSizeCheck(const aclmdlAIPP *const aippParmsSet, const size_t batchIndex); | 26 | aclError AippScfSizeCheck(const aclmdlAIPP *const aippParmsSet, const size_t batchIndex); |
| 27 | uint64_t GetSrcImageSize(const aclmdlAIPP *const aippParmsSet); | 27 | uint64_t GetSrcImageSize(const aclmdlAIPP *const aippParmsSet); |
| 28 | -aclError AippParamsCheck(const aclmdlAIPP *const aippParmsSet, const std::string &socVersion); | 28 | +aclError AippParamsCheck(const aclmdlAIPP *const aippParmsSet, const std::string &npuArch); |
| 29 | aclError GetAippOutputHW(const aclmdlAIPP *const aippParmsSet, const size_t batchIndex, const std::string &socVersion, | 29 | aclError GetAippOutputHW(const aclmdlAIPP *const aippParmsSet, const size_t batchIndex, const std::string &socVersion, |
| 30 | int32_t &aippOutputW, int32_t &aippOutputH); | 30 | int32_t &aippOutputW, int32_t &aippOutputH); |
| 31 | } // namespace acl | 31 | } // namespace acl |
| @@ -574,7 +574,7 @@ ACL_FUNC_VISIBILITY aclError SetIODims(const ge::InputOutputDims &oriDims, aclmd | |||
| 574 | return ACL_SUCCESS; | 574 | return ACL_SUCCESS; |
| 575 | } | 575 | } |
| 576 | 576 | ||
| 577 | -ACL_FUNC_VISIBILITY std::string AippInfoDebugString(const aclAippInfo *const aippInfo) { | 577 | +ACL_FUNC_VISIBILITY std::string AippInfoDebugString(const aclAippInfo *aippInfo) { |
| 578 | if (aippInfo == nullptr) { | 578 | if (aippInfo == nullptr) { |
| 579 | ACL_LOG_INNER_ERROR("[Check][aippInfo]param aippInfo must not be null"); | 579 | ACL_LOG_INNER_ERROR("[Check][aippInfo]param aippInfo must not be null"); |
| 580 | return ""; | 580 | return ""; |
| @@ -656,7 +656,7 @@ ACL_FUNC_VISIBILITY std::string DimsDebugString(const aclmdlIODims &ioDims) { | |||
| 656 | return ss.str(); | 656 | return ss.str(); |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | -ACL_FUNC_VISIBILITY std::string AippDimsDebugString(const aclAippDims *const aippDims, const size_t shapeCount) { | 659 | +ACL_FUNC_VISIBILITY std::string AippDimsDebugString(const aclAippDims *aippDims, size_t shapeCount) { |
| 660 | if (aippDims == nullptr) { | 660 | if (aippDims == nullptr) { |
| 661 | ACL_LOG_INNER_ERROR("[Check][aippDims]param aippDims must not be null"); | 661 | ACL_LOG_INNER_ERROR("[Check][aippDims]param aippDims must not be null"); |
| 662 | return ""; | 662 | return ""; |
| @@ -721,66 +721,66 @@ static float32_t Fp16ToFloat(const uint16_t val) { | |||
| 721 | return type_union.fVal; | 721 | return type_union.fVal; |
| 722 | } | 722 | } |
| 723 | 723 | ||
| 724 | -ACL_FUNC_VISIBILITY std::string AippParmsDebugString(const kAippDynamicPara &aipp_parms) { | 724 | +ACL_FUNC_VISIBILITY std::string AippParmsDebugString(const kAippDynamicPara &aippParms) { |
| 725 | std::stringstream ss; | 725 | std::stringstream ss; |
| 726 | ss << "kAippDynamicPara["; | 726 | ss << "kAippDynamicPara["; |
| 727 | - ss << " inputFormat:" << static_cast<uint32_t>(aipp_parms.inputFormat); | 727 | + ss << " inputFormat:" << static_cast<uint32_t>(aippParms.inputFormat); |
| 728 | - ss << " cscSwitch:" << static_cast<int32_t>(aipp_parms.cscSwitch); | 728 | + ss << " cscSwitch:" << static_cast<int32_t>(aippParms.cscSwitch); |
| 729 | - ss << " rbuvSwapSwitch:" << static_cast<int32_t>(aipp_parms.rbuvSwapSwitch); | 729 | + ss << " rbuvSwapSwitch:" << static_cast<int32_t>(aippParms.rbuvSwapSwitch); |
| 730 | - ss << " axSwapSwitch:" << static_cast<int32_t>(aipp_parms.axSwapSwitch); | 730 | + ss << " axSwapSwitch:" << static_cast<int32_t>(aippParms.axSwapSwitch); |
| 731 | - ss << " batchNum:" << static_cast<int32_t>(aipp_parms.batchNum); | 731 | + ss << " batchNum:" << static_cast<int32_t>(aippParms.batchNum); |
| 732 | - ss << " srcImageSizeW:" << aipp_parms.srcImageSizeW; | 732 | + ss << " srcImageSizeW:" << aippParms.srcImageSizeW; |
| 733 | - ss << " srcImageSizeH:" << aipp_parms.srcImageSizeH; | 733 | + ss << " srcImageSizeH:" << aippParms.srcImageSizeH; |
| 734 | - ss << " cscMatrixR0C0:" << static_cast<int32_t>(aipp_parms.cscMatrixR0C0); | 734 | + ss << " cscMatrixR0C0:" << static_cast<int32_t>(aippParms.cscMatrixR0C0); |
| 735 | - ss << " cscMatrixR0C1:" << static_cast<int32_t>(aipp_parms.cscMatrixR0C1); | 735 | + ss << " cscMatrixR0C1:" << static_cast<int32_t>(aippParms.cscMatrixR0C1); |
| 736 | - ss << " cscMatrixR0C2:" << static_cast<int32_t>(aipp_parms.cscMatrixR0C2); | 736 | + ss << " cscMatrixR0C2:" << static_cast<int32_t>(aippParms.cscMatrixR0C2); |
| 737 | - ss << " cscMatrixR1C0:" << static_cast<int32_t>(aipp_parms.cscMatrixR1C0); | 737 | + ss << " cscMatrixR1C0:" << static_cast<int32_t>(aippParms.cscMatrixR1C0); |
| 738 | - ss << " cscMatrixR1C1:" << static_cast<int32_t>(aipp_parms.cscMatrixR1C1); | 738 | + ss << " cscMatrixR1C1:" << static_cast<int32_t>(aippParms.cscMatrixR1C1); |
| 739 | - ss << " cscMatrixR1C2:" << static_cast<int32_t>(aipp_parms.cscMatrixR1C2); | 739 | + ss << " cscMatrixR1C2:" << static_cast<int32_t>(aippParms.cscMatrixR1C2); |
| 740 | - ss << " cscMatrixR2C0:" << static_cast<int32_t>(aipp_parms.cscMatrixR2C0); | 740 | + ss << " cscMatrixR2C0:" << static_cast<int32_t>(aippParms.cscMatrixR2C0); |
| 741 | - ss << " cscMatrixR2C1:" << static_cast<int32_t>(aipp_parms.cscMatrixR2C1); | 741 | + ss << " cscMatrixR2C1:" << static_cast<int32_t>(aippParms.cscMatrixR2C1); |
| 742 | - ss << " cscMatrixR2C2:" << static_cast<int32_t>(aipp_parms.cscMatrixR2C2); | 742 | + ss << " cscMatrixR2C2:" << static_cast<int32_t>(aippParms.cscMatrixR2C2); |
| 743 | - ss << " cscOutputBiasR0:" << static_cast<uint32_t>(aipp_parms.cscOutputBiasR0); | 743 | + ss << " cscOutputBiasR0:" << static_cast<uint32_t>(aippParms.cscOutputBiasR0); |
| 744 | - ss << " cscOutputBiasR1:" << static_cast<uint32_t>(aipp_parms.cscOutputBiasR1); | 744 | + ss << " cscOutputBiasR1:" << static_cast<uint32_t>(aippParms.cscOutputBiasR1); |
| 745 | - ss << " cscOutputBiasR2:" << static_cast<uint32_t>(aipp_parms.cscOutputBiasR2); | 745 | + ss << " cscOutputBiasR2:" << static_cast<uint32_t>(aippParms.cscOutputBiasR2); |
| 746 | - ss << " cscInputBiasR0:" << static_cast<uint32_t>(aipp_parms.cscInputBiasR0); | 746 | + ss << " cscInputBiasR0:" << static_cast<uint32_t>(aippParms.cscInputBiasR0); |
| 747 | - ss << " cscInputBiasR1:" << static_cast<uint32_t>(aipp_parms.cscInputBiasR1); | 747 | + ss << " cscInputBiasR1:" << static_cast<uint32_t>(aippParms.cscInputBiasR1); |
| 748 | - ss << " cscInputBiasR2:" << static_cast<uint32_t>(aipp_parms.cscInputBiasR2); | 748 | + ss << " cscInputBiasR2:" << static_cast<uint32_t>(aippParms.cscInputBiasR2); |
| 749 | ss << " ]"; | 749 | ss << " ]"; |
| 750 | return ss.str(); | 750 | return ss.str(); |
| 751 | } | 751 | } |
| 752 | 752 | ||
| 753 | -ACL_FUNC_VISIBILITY std::string AippBatchParaDebugString(const kAippDynamicBatchPara &aipp_batch_para) { | 753 | +ACL_FUNC_VISIBILITY std::string AippBatchParaDebugString(const kAippDynamicBatchPara &aippBatchPara) { |
| 754 | std::stringstream ss; | 754 | std::stringstream ss; |
| 755 | ss << "kAippDynamicBatchPara["; | 755 | ss << "kAippDynamicBatchPara["; |
| 756 | - ss << " cropSwitch:" << static_cast<int32_t>(aipp_batch_para.cropSwitch); | 756 | + ss << " cropSwitch:" << static_cast<int32_t>(aippBatchPara.cropSwitch); |
| 757 | - ss << " cropStartPosW:" << aipp_batch_para.cropStartPosW; | 757 | + ss << " cropStartPosW:" << aippBatchPara.cropStartPosW; |
| 758 | - ss << " cropStartPosH:" << aipp_batch_para.cropStartPosH; | 758 | + ss << " cropStartPosH:" << aippBatchPara.cropStartPosH; |
| 759 | - ss << " cropSizeW:" << aipp_batch_para.cropSizeW; | 759 | + ss << " cropSizeW:" << aippBatchPara.cropSizeW; |
| 760 | - ss << " cropSizeH:" << aipp_batch_para.cropSizeH; | 760 | + ss << " cropSizeH:" << aippBatchPara.cropSizeH; |
| 761 | - ss << " scfSwitch:" << static_cast<int32_t>(aipp_batch_para.scfSwitch); | 761 | + ss << " scfSwitch:" << static_cast<int32_t>(aippBatchPara.scfSwitch); |
| 762 | - ss << " scfInputSizeW:" << aipp_batch_para.scfInputSizeW; | 762 | + ss << " scfInputSizeW:" << aippBatchPara.scfInputSizeW; |
| 763 | - ss << " scfInputSizeH:" << aipp_batch_para.scfInputSizeH; | 763 | + ss << " scfInputSizeH:" << aippBatchPara.scfInputSizeH; |
| 764 | - ss << " scfOutputSizeW:" << aipp_batch_para.scfOutputSizeW; | 764 | + ss << " scfOutputSizeW:" << aippBatchPara.scfOutputSizeW; |
| 765 | - ss << " scfOutputSizeH:" << aipp_batch_para.scfOutputSizeH; | 765 | + ss << " scfOutputSizeH:" << aippBatchPara.scfOutputSizeH; |
| 766 | - ss << " paddingSwitch:" << static_cast<int32_t>(aipp_batch_para.paddingSwitch); | 766 | + ss << " paddingSwitch:" << static_cast<int32_t>(aippBatchPara.paddingSwitch); |
| 767 | - ss << " paddingSizeTop:" << aipp_batch_para.paddingSizeTop; | 767 | + ss << " paddingSizeTop:" << aippBatchPara.paddingSizeTop; |
| 768 | - ss << " paddingSizeBottom:" << aipp_batch_para.paddingSizeBottom; | 768 | + ss << " paddingSizeBottom:" << aippBatchPara.paddingSizeBottom; |
| 769 | - ss << " paddingSizeLeft:" << aipp_batch_para.paddingSizeLeft; | 769 | + ss << " paddingSizeLeft:" << aippBatchPara.paddingSizeLeft; |
| 770 | - ss << " paddingSizeRight:" << aipp_batch_para.paddingSizeRight; | 770 | + ss << " paddingSizeRight:" << aippBatchPara.paddingSizeRight; |
| 771 | - ss << " rotateSwitch:" << static_cast<int32_t>(aipp_batch_para.rotateSwitch); | 771 | + ss << " rotateSwitch:" << static_cast<int32_t>(aippBatchPara.rotateSwitch); |
| 772 | - ss << " dtcPixelMeanChn0:" << static_cast<int32_t>(aipp_batch_para.dtcPixelMeanChn0); | 772 | + ss << " dtcPixelMeanChn0:" << static_cast<int32_t>(aippBatchPara.dtcPixelMeanChn0); |
| 773 | - ss << " dtcPixelMeanChn1:" << static_cast<int32_t>(aipp_batch_para.dtcPixelMeanChn1); | 773 | + ss << " dtcPixelMeanChn1:" << static_cast<int32_t>(aippBatchPara.dtcPixelMeanChn1); |
| 774 | - ss << " dtcPixelMeanChn2:" << static_cast<int32_t>(aipp_batch_para.dtcPixelMeanChn2); | 774 | + ss << " dtcPixelMeanChn2:" << static_cast<int32_t>(aippBatchPara.dtcPixelMeanChn2); |
| 775 | - ss << " dtcPixelMeanChn3:" << static_cast<int32_t>(aipp_batch_para.dtcPixelMeanChn3); | 775 | + ss << " dtcPixelMeanChn3:" << static_cast<int32_t>(aippBatchPara.dtcPixelMeanChn3); |
| 776 | - ss << " dtcPixelMinChn0:" << static_cast<uint32_t>(aipp_batch_para.dtcPixelMinChn0); | 776 | + ss << " dtcPixelMinChn0:" << static_cast<uint32_t>(aippBatchPara.dtcPixelMinChn0); |
| 777 | - ss << " dtcPixelMinChn1:" << static_cast<uint32_t>(aipp_batch_para.dtcPixelMinChn1); | 777 | + ss << " dtcPixelMinChn1:" << static_cast<uint32_t>(aippBatchPara.dtcPixelMinChn1); |
| 778 | - ss << " dtcPixelMinChn2:" << static_cast<uint32_t>(aipp_batch_para.dtcPixelMinChn2); | 778 | + ss << " dtcPixelMinChn2:" << static_cast<uint32_t>(aippBatchPara.dtcPixelMinChn2); |
| 779 | - ss << " dtcPixelMinChn3:" << static_cast<uint32_t>(aipp_batch_para.dtcPixelMinChn3); | 779 | + ss << " dtcPixelMinChn3:" << static_cast<uint32_t>(aippBatchPara.dtcPixelMinChn3); |
| 780 | - ss << " dtcPixelVarReciChn0:" << Fp16ToFloat(aipp_batch_para.dtcPixelVarReciChn0); | 780 | + ss << " dtcPixelVarReciChn0:" << Fp16ToFloat(aippBatchPara.dtcPixelVarReciChn0); |
| 781 | - ss << " dtcPixelVarReciChn1:" << Fp16ToFloat(aipp_batch_para.dtcPixelVarReciChn1); | 781 | + ss << " dtcPixelVarReciChn1:" << Fp16ToFloat(aippBatchPara.dtcPixelVarReciChn1); |
| 782 | - ss << " dtcPixelVarReciChn2:" << Fp16ToFloat(aipp_batch_para.dtcPixelVarReciChn2); | 782 | + ss << " dtcPixelVarReciChn2:" << Fp16ToFloat(aippBatchPara.dtcPixelVarReciChn2); |
| 783 | - ss << " dtcPixelVarReciChn3:" << Fp16ToFloat(aipp_batch_para.dtcPixelVarReciChn3); | 783 | + ss << " dtcPixelVarReciChn3:" << Fp16ToFloat(aippBatchPara.dtcPixelVarReciChn3); |
| 784 | ss << " ]"; | 784 | ss << " ]"; |
| 785 | return ss.str(); | 785 | return ss.str(); |
| 786 | } | 786 | } |
| @@ -41,12 +41,12 @@ std::mutex aclLoadOpsProtoMutex; | |||
| 41 | } // namespace | 41 | } // namespace |
| 42 | 42 | ||
| 43 | struct aclopHandle { | 43 | struct aclopHandle { |
| 44 | - aclopHandle() : opHandle(nullptr) {} | 44 | + aclopHandle() {} |
| 45 | ~aclopHandle() { | 45 | ~aclopHandle() { |
| 46 | ACL_DELETE_AND_SET_NULL(opHandle); | 46 | ACL_DELETE_AND_SET_NULL(opHandle); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | - acl::OpHandle *opHandle; | 49 | + acl::OpHandle *opHandle = nullptr; |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | aclError aclopSetModelDirImpl(const char *modelDir) { | 52 | aclError aclopSetModelDirImpl(const char *modelDir) { |
| @@ -8,14 +8,9 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef ACL_UTILS_ATTR_UTILS_H_ | 11 | +#ifndef ACL_UTILS_ACL_ATTR_UTILS_H_ |
| 12 | -#define ACL_UTILS_ATTR_UTILS_H_ | 12 | +#define ACL_UTILS_ACL_ATTR_UTILS_H_ |
| 13 | 13 | ||
| 14 | - | ||
| 15 | - | ||
| 16 | - | ||
| 17 | - | ||
| 18 | - | ||
| 19 | 14 | ||
| 20 | 15 | ||
| 21 | 16 | ||
| @@ -49,4 +44,4 @@ bool IsListFloatEquals(const std::vector<float32_t> &lhsValue, const std::vector | |||
| 49 | } // namespace attr_utils | 44 | } // namespace attr_utils |
| 50 | } // namespace acl | 45 | } // namespace acl |
| 51 | 46 | ||
| 52 | -#endif // ACL_UTILS_ATTR_UTILS_H_ | 47 | +#endif // ACL_UTILS_ACL_ATTR_UTILS_H_ |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef ACL_UTILS_FILE_UTILS_H | 11 | +#ifndef ACL_UTILS_ACL_FILE_UTILS_H |
| 12 | -#define ACL_UTILS_FILE_UTILS_H | 12 | +#define ACL_UTILS_ACL_FILE_UTILS_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -25,4 +25,4 @@ aclError ListFiles(const std::string &dirName, FileNameFilterFn filter, std::vec | |||
| 25 | } // namespace file_utils | 25 | } // namespace file_utils |
| 26 | } // namespace acl | 26 | } // namespace acl |
| 27 | 27 | ||
| 28 | -#endif // ACL_UTILS_FILE_UTILS_H | 28 | +#endif // ACL_UTILS_ACL_FILE_UTILS_H |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef ACL_UTILS_HASH_UTILS_H | 11 | +#ifndef ACL_UTILS_ACL_HASH_UTILS_H |
| 12 | -#define ACL_UTILS_HASH_UTILS_H | 12 | +#define ACL_UTILS_ACL_HASH_UTILS_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -118,4 +118,4 @@ bool CheckModelAndAttrMatchDynamic(const AclOp &aclOp, const aclopAttr *const op | |||
| 118 | } // namespace hash_utils | 118 | } // namespace hash_utils |
| 119 | } // namespace acl | 119 | } // namespace acl |
| 120 | 120 | ||
| 121 | -#endif // ACL_UTILS_HASH_UTILS_H | 121 | +#endif // ACL_UTILS_ACL_HASH_UTILS_H |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_AICORE_KERBEL_HANDLES_MANAGER_H | 11 | +#ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_AICORE_KERNEL_HANDLES_MANAGER_H |
| 12 | -#define BASE_COMMON_KERNEL_HANDLES_MANAGER_AICORE_KERBEL_HANDLES_MANAGER_H | 12 | +#define BASE_COMMON_KERNEL_HANDLES_MANAGER_AICORE_KERNEL_HANDLES_MANAGER_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -25,4 +25,4 @@ class AicoreKernelHandlesManager : public KernelHandlesManager { | |||
| 25 | }; | 25 | }; |
| 26 | } // namespace ge | 26 | } // namespace ge |
| 27 | 27 | ||
| 28 | -#endif // BASE_COMMON_KERNEL_HANDLES_MANAGER_AICORE_KERBEL_HANDLES_MANAGER_H | 28 | +#endif // BASE_COMMON_KERNEL_HANDLES_MANAGER_AICORE_KERNEL_HANDLES_MANAGER_H |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_AICPU_KERBEL_HANDLES_MANAGER_H | 11 | +#ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_AICPU_KERNEL_HANDLES_MANAGER_H |
| 12 | -#define BASE_COMMON_KERNEL_HANDLES_MANAGER_AICPU_KERBEL_HANDLES_MANAGER_H | 12 | +#define BASE_COMMON_KERNEL_HANDLES_MANAGER_AICPU_KERNEL_HANDLES_MANAGER_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -25,4 +25,4 @@ class AicpuKernelHandlesManager : public KernelHandlesManager { | |||
| 25 | }; | 25 | }; |
| 26 | } // namespace ge | 26 | } // namespace ge |
| 27 | 27 | ||
| 28 | -#endif // BASE_COMMON_KERNEL_HANDLES_MANAGER_AICPU_KERBEL_HANDLES_MANAGER_H | 28 | +#endif // BASE_COMMON_KERNEL_HANDLES_MANAGER_AICPU_KERNEL_HANDLES_MANAGER_H |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_CUST_AICPU_KERBEL_HANDLES_MANAGER_H | 11 | +#ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_CUST_AICPU_KERNEL_HANDLES_MANAGER_H |
| 12 | -#define BASE_COMMON_KERNEL_HANDLES_MANAGER_CUST_AICPU_KERBEL_HANDLES_MANAGER_H | 12 | +#define BASE_COMMON_KERNEL_HANDLES_MANAGER_CUST_AICPU_KERNEL_HANDLES_MANAGER_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -25,4 +25,4 @@ class CustAicpuKernelHandlesManager : public KernelHandlesManager { | |||
| 25 | }; | 25 | }; |
| 26 | } // namespace ge | 26 | } // namespace ge |
| 27 | 27 | ||
| 28 | -#endif // BASE_COMMON_KERNEL_HANDLES_MANAGER_CUST_AICPU_KERBEL_HANDLES_MANAGER_H | 28 | +#endif // BASE_COMMON_KERNEL_HANDLES_MANAGER_CUST_AICPU_KERNEL_HANDLES_MANAGER_H |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef EXECUTOR_GRAPH_LOAD_MODEL_MANAGER_KERNEL_MANAGER_KERBEL_HANDLE_UTILS_H | 11 | +#ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_KERNEL_HANDLE_UTILS_H |
| 12 | -#define EXECUTOR_GRAPH_LOAD_MODEL_MANAGER_KERNEL_MANAGER_KERBEL_HANDLE_UTILS_H | 12 | +#define BASE_COMMON_KERNEL_HANDLES_MANAGER_KERNEL_HANDLE_UTILS_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -48,4 +48,4 @@ class KernelHandleUtils { | |||
| 48 | }; | 48 | }; |
| 49 | } // namespace ge | 49 | } // namespace ge |
| 50 | 50 | ||
| 51 | -#endif // #ifndef EXECUTOR_GRAPH_LOAD_MODEL_MANAGER_KERNEL_MANAGER_KERBEL_HANDLE_UTILS_H | 51 | +#endif // #ifndef BASE_COMMON_KERNEL_HANDLES_MANAGER_KERNEL_HANDLE_UTILS_H |
| @@ -131,7 +131,7 @@ void DSATaskCodeBuilder::InitBuildDataFields(const uint32_t task_type) { | |||
| 131 | build_data_.hbm_table_index = static_cast<uint32_t>(hbm_entry_.has_value() ? hbm_entry_->table_index : 0U); | 131 | build_data_.hbm_table_index = static_cast<uint32_t>(hbm_entry_.has_value() ? hbm_entry_->table_index : 0U); |
| 132 | build_data_.hbm_args_size = static_cast<uint32_t>(hbm_entry_.has_value() ? hbm_entry_->args_size : 0U); | 132 | build_data_.hbm_args_size = static_cast<uint32_t>(hbm_entry_.has_value() ? hbm_entry_->args_size : 0U); |
| 133 | build_data_.idx_output = num_inputs; | 133 | build_data_.idx_output = num_inputs; |
| 134 | - build_data_.state_addr_idx = state_from_ws ? ws_base : (num_inputs - 1U); | 134 | + build_data_.state_addr_idx = (state_from_ws > 0U) ? ws_base : (num_inputs - 1U); |
| 135 | build_data_.idx_seed = 1U; | 135 | build_data_.idx_seed = 1U; |
| 136 | build_data_.idx_count = 0U; | 136 | build_data_.idx_count = 0U; |
| 137 | build_data_.idx_input1 = kDSAInput1AddrIndex; | 137 | build_data_.idx_input1 = kDSAInput1AddrIndex; |
| @@ -169,7 +169,7 @@ Status DSATaskCodeBuilder::Contribute(TaskSemanticContributeContext &context) { | |||
| 169 | GELOGI("DSA Task Codegen: op[%s], sqe_type[%u], stream_id[%u].", header_.op_name.c_str(), build_data_.sqe_type, | 169 | GELOGI("DSA Task Codegen: op[%s], sqe_type[%u], stream_id[%u].", header_.op_name.c_str(), build_data_.sqe_type, |
| 170 | header_.stream_id); | 170 | header_.stream_id); |
| 171 | uint64_t current_args_offset = 0U; | 171 | uint64_t current_args_offset = 0U; |
| 172 | - auto add_addr_entries = [&](const std::vector<AddrSemantic> &addrs) { | 172 | + auto add_addr_entries = [¤t_args_offset, this](const std::vector<AddrSemantic> &addrs) { |
| 173 | for (const auto &addr : addrs) { | 173 | for (const auto &addr : addrs) { |
| 174 | OpArgDesc arg = TaskCodeBuilderUtil::ConvertAddrDesc(addr); | 174 | OpArgDesc arg = TaskCodeBuilderUtil::ConvertAddrDesc(addr); |
| 175 | arg.args_offset = current_args_offset; | 175 | arg.args_offset = current_args_offset; |
| @@ -226,7 +226,7 @@ Status DSATaskCodeBuilder::RenderDispatchFunc(std::vector<DeclNode *> &items) { | |||
| 226 | GE_ASSERT_SUCCESS(RenderSqeAddrFields(body, dsa_data, ctx, sqe, addrs)); | 226 | GE_ASSERT_SUCCESS(RenderSqeAddrFields(body, dsa_data, ctx, sqe, addrs)); |
| 227 | GE_ASSERT_SUCCESS(RenderHbmIoArgs(body, dsa_data, ctx, addrs)); | 227 | GE_ASSERT_SUCCESS(RenderHbmIoArgs(body, dsa_data, ctx, addrs)); |
| 228 | auto launch_begin = ast_.Var("uint64_t", "_launch_begin"); | 228 | auto launch_begin = ast_.Var("uint64_t", "_launch_begin"); |
| 229 | - body.emplace_back(ast_.VarDecl(launch_begin, ast_.Call("MsprofSysCycleTime", {}))); | 229 | + (void)body.emplace_back(ast_.VarDecl(launch_begin, ast_.Call("MsprofSysCycleTime", {}))); |
| 230 | GE_ASSERT_SUCCESS(RenderDispatchFuncLaunch(body, op, ctx, dsa_data, sqe)); | 230 | GE_ASSERT_SUCCESS(RenderDispatchFuncLaunch(body, op, ctx, dsa_data, sqe)); |
| 231 | GE_ASSERT_SUCCESS(RenderDispatchFuncReport(body, op, ctx, dsa_data, addrs, launch_begin)); | 231 | GE_ASSERT_SUCCESS(RenderDispatchFuncReport(body, op, ctx, dsa_data, addrs, launch_begin)); |
| 232 | 232 | ||
| @@ -426,7 +426,7 @@ Status DSATaskCodeBuilder::RenderDispatchFuncReportIo(std::vector<BodyItem> &bod | |||
| 426 | Status DSATaskCodeBuilder::RenderDispatchFuncReportSubmit( | 426 | Status DSATaskCodeBuilder::RenderDispatchFuncReportSubmit( |
| 427 | std::vector<BodyItem> &body, const VarRef &op, const VarRef &ctx, const ExprRef &dsa_data, | 427 | std::vector<BodyItem> &body, const VarRef &op, const VarRef &ctx, const ExprRef &dsa_data, |
| 428 | const VarRef &dsa_report_inputs, const VarRef &dsa_report_outputs, const VarRef &dsa_report_ws_addrs, | 428 | const VarRef &dsa_report_inputs, const VarRef &dsa_report_outputs, const VarRef &dsa_report_ws_addrs, |
| 429 | - const VarRef &dsa_report_ws_sizes, const VarRef &launch_begin) { | 429 | + const VarRef &dsa_report_ws_sizes, const VarRef &launch_begin) const { |
| 430 | auto hbm_ai = ast_.Var("ArgsInfo *", "hbm_ai"); | 430 | auto hbm_ai = ast_.Var("ArgsInfo *", "hbm_ai"); |
| 431 | (void)body.push_back( | 431 | (void)body.push_back( |
| 432 | ast_.VarDecl(hbm_ai, ctx.Attr("args_table").Attr("GetArgsInfo")(dsa_data.Attr("hbm_table_index")))); | 432 | ast_.VarDecl(hbm_ai, ctx.Attr("args_table").Attr("GetArgsInfo")(dsa_data.Attr("hbm_table_index")))); |
| @@ -81,7 +81,7 @@ class DSATaskCodeBuilder : public TaskCodeBuilder { | |||
| 81 | Status RenderDispatchFuncReportSubmit(std::vector<BodyItem> &body, const VarRef &op, const VarRef &ctx, | 81 | Status RenderDispatchFuncReportSubmit(std::vector<BodyItem> &body, const VarRef &op, const VarRef &ctx, |
| 82 | const ExprRef &dsa_data, const VarRef &dsa_report_inputs, | 82 | const ExprRef &dsa_data, const VarRef &dsa_report_inputs, |
| 83 | const VarRef &dsa_report_outputs, const VarRef &dsa_report_ws_addrs, | 83 | const VarRef &dsa_report_outputs, const VarRef &dsa_report_ws_addrs, |
| 84 | - const VarRef &dsa_report_ws_sizes, const VarRef &launch_begin); | 84 | + const VarRef &dsa_report_ws_sizes, const VarRef &launch_begin) const; |
| 85 | 85 | ||
| 86 | // Address semantics | 86 | // Address semantics |
| 87 | std::vector<AddrSemantic> input_addrs_; | 87 | std::vector<AddrSemantic> input_addrs_; |
| @@ -60,7 +60,7 @@ | |||
| 60 | 60 | ||
| 61 | AIPP_CONVERT_LIST_FORMAT(KEY, int64_t, REQUIRED, GeAttrValue::INT, PROTO_TYPE) | 61 | AIPP_CONVERT_LIST_FORMAT(KEY, int64_t, REQUIRED, GeAttrValue::INT, PROTO_TYPE) |
| 62 | 62 | ||
| 63 | -#define AIPP_CONVERT_LIST_BOOL(KEY, REQUIRED) AIPP_CONVERT_LIST_FORMAT(KEY, bool, REQUIRED, GeAttrValue::BOOL, bool) | 63 | +#define AIPP_CONVERT_LIST_BOOL(KEY, REQUIRED) AIPP_CONVERT_LIST_FORMAT((KEY), bool, (REQUIRED), GeAttrValue::BOOL, bool) |
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | AIPP_CONVERT_LIST_FORMAT(KEY, float32_t, REQUIRED, GeAttrValue::FLOAT, float32_t) | 66 | AIPP_CONVERT_LIST_FORMAT(KEY, float32_t, REQUIRED, GeAttrValue::FLOAT, float32_t) |
| @@ -303,7 +303,7 @@ std::vector<size_t> OverloadPlanner::CollectBaselineIndices(const size_t version | |||
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | bool OverloadPlanner::TryAdoptModeSignatures(const IrOpProto ¤t, const std::vector<const IrOpProto *> &versions, | 305 | bool OverloadPlanner::TryAdoptModeSignatures(const IrOpProto ¤t, const std::vector<const IrOpProto *> &versions, |
| 306 | - const std::vector<BoundaryInfo> &boundaries, const MultiBaselineMode mode, | 306 | + const std::vector<BoundaryInfo> &boundaries, MultiBaselineMode mode, |
| 307 | std::vector<Warning> *warnings, | 307 | std::vector<Warning> *warnings, |
| 308 | std::vector<Signature> &accepted_signatures) const { | 308 | std::vector<Signature> &accepted_signatures) const { |
| 309 | std::vector<Warning> mode_warnings; | 309 | std::vector<Warning> mode_warnings; |
| @@ -9,7 +9,6 @@ | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | - | ||
| 13 | 12 | ||
| 14 | 13 | ||
| 15 | 14 | ||
| @@ -10,7 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | - | ||
| 14 | 13 | ||
| 15 | 14 | ||
| 16 | 15 | ||
Mcompiler/graph/optimize/autofuse/autofuse/post_process/scheduler_adapter/asc_backend_scheduler_adapter.cpp+0-4
| @@ -41,10 +41,6 @@ Status AscBackendSchedulerAdapter::DoBeforePass(const ComputeGraphPtr &graph) co | |||
| 41 | // 把fp16和bf16的node改为fp32,以提高精度 | 41 | // 把fp16和bf16的node改为fp32,以提高精度 |
| 42 | GE_ASSERT_SUCCESS(PrecisionImprover::ImprovePrecisionToFp32(graph)); | 42 | GE_ASSERT_SUCCESS(PrecisionImprover::ImprovePrecisionToFp32(graph)); |
| 43 | 43 | ||
| 44 | - // 为scalar增加broadcast | ||
| 45 | - // GE_ASSERT_SUCCESS(asc_adapt::FallbackScalarToBroadcastWithoutCheckType(graph)); | ||
| 46 | - // 统一在OptimizedFallback中插入broadcast | ||
| 47 | - | ||
| 48 | return SUCCESS; | 44 | return SUCCESS; |
| 49 | } | 45 | } |
| 50 | 46 | ||
Mcompiler/graph/optimize/autofuse/temporary_dependencies/graph/ascendc_ir/ascendc_ir_core/serialization/attr_serializer.h+0-2
| @@ -18,8 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | - | ||
| 22 | - | ||
| 23 | namespace af { | 21 | namespace af { |
| 24 | using ge::AnyValue; | 22 | using ge::AnyValue; |
| 25 | using ge::GetTypeId; | 23 | using ge::GetTypeId; |
| @@ -1467,7 +1467,8 @@ void MemLayoutConflictUtil::ConstructSingleNodeSymbolTable(const std::string &in | |||
| 1467 | AnchorToSymbol &out_anchor_to_symbol, | 1467 | AnchorToSymbol &out_anchor_to_symbol, |
| 1468 | SymbolToAnchors &out_symbol_to_anchors) { | 1468 | SymbolToAnchors &out_symbol_to_anchors) { |
| 1469 | // 直接从 symbol_to_anchors 精确提取,不遍历整个 anchor_to_symbol | 1469 | // 直接从 symbol_to_anchors 精确提取,不遍历整个 anchor_to_symbol |
| 1470 | - auto copy_symbol_anchors = [&](const std::string &symbol, const std::string &target_symbol) { | 1470 | + auto copy_symbol_anchors = [&orig_symbol_to_anchors, &orig_anchor_to_symbol, &out_anchor_to_symbol, |
| 1471 | + &out_symbol_to_anchors](const std::string &symbol, const std::string &target_symbol) { | ||
| 1471 | auto sym_iter = orig_symbol_to_anchors.find(symbol); | 1472 | auto sym_iter = orig_symbol_to_anchors.find(symbol); |
| 1472 | if (sym_iter == orig_symbol_to_anchors.end()) { | 1473 | if (sym_iter == orig_symbol_to_anchors.end()) { |
| 1473 | return; | 1474 | return; |
| @@ -15,7 +15,6 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | - | ||
| 19 | 18 | ||
| 20 | 19 | ||
| 21 | 20 | ||
| @@ -13,7 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | - | ||
| 17 | 16 | ||
| 18 | 17 | ||
| 19 | 18 | ||
| @@ -41,29 +41,29 @@ bool RegisterFlowFunc(const char *flow_func_name, const FLOW_FUNC_CREATOR_FUNC & | |||
| 41 | return true; | 41 | return true; |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | -bool RegisterMultiFunc(const char *flow_func_name, const MULTI_FUNC_CREATOR_FUNC &func_creator) noexcept { | 44 | +bool RegisterMultiFunc(const char *flowFuncName, const MULTI_FUNC_CREATOR_FUNC &funcCreator) noexcept { |
| 45 | - if (flow_func_name == nullptr) { | 45 | + if (flowFuncName == nullptr) { |
| 46 | - UDF_LOG_ERROR("flow_func_name is null."); | 46 | + UDF_LOG_ERROR("flowFuncName is null."); |
| 47 | return false; | 47 | return false; |
| 48 | } | 48 | } |
| 49 | - if (func_creator == nullptr) { | 49 | + if (funcCreator == nullptr) { |
| 50 | - UDF_LOG_ERROR("func_creator is null, flow_func_name=%s.", flow_func_name); | 50 | + UDF_LOG_ERROR("funcCreator is null, flowFuncName=%s.", flowFuncName); |
| 51 | return false; | 51 | return false; |
| 52 | } | 52 | } |
| 53 | - FlowFuncManager::Instance().Register(flow_func_name, func_creator); | 53 | + FlowFuncManager::Instance().Register(flowFuncName, funcCreator); |
| 54 | return true; | 54 | return true; |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | -bool RegisterMultiFunc(const char *flow_func_name, const MULTI_FUNC_WITH_Q_CREATOR_FUNC &func_with_q_creator) noexcept { | 57 | +bool RegisterMultiFunc(const char *flowFuncName, const MULTI_FUNC_WITH_Q_CREATOR_FUNC &funcWithQCreator) noexcept { |
| 58 | - if (flow_func_name == nullptr) { | 58 | + if (flowFuncName == nullptr) { |
| 59 | - UDF_LOG_ERROR("flow_func_name is null."); | 59 | + UDF_LOG_ERROR("flowFuncName is null."); |
| 60 | return false; | 60 | return false; |
| 61 | } | 61 | } |
| 62 | - if (func_with_q_creator == nullptr) { | 62 | + if (funcWithQCreator == nullptr) { |
| 63 | - UDF_LOG_ERROR("func_creator is null, flow_func_name=%s.", flow_func_name); | 63 | + UDF_LOG_ERROR("funcCreator is null, flowFuncName=%s.", flowFuncName); |
| 64 | return false; | 64 | return false; |
| 65 | } | 65 | } |
| 66 | - FlowFuncManager::Instance().Register(flow_func_name, func_with_q_creator); | 66 | + FlowFuncManager::Instance().Register(flowFuncName, funcWithQCreator); |
| 67 | return true; | 67 | return true; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| @@ -196,6 +196,9 @@ target_link_libraries(graph_base | |||
| 196 | ) | 196 | ) |
| 197 | 197 | ||
| 198 | target_link_libraries(graph_base PRIVATE ascend_protobuf error_manager) | 198 | target_link_libraries(graph_base PRIVATE ascend_protobuf error_manager) |
| 199 | +if(TARGET third_party_json) | ||
| 200 | + add_dependencies(graph_base third_party_json) | ||
| 201 | +endif() | ||
| 199 | target_compile_options(graph_base PRIVATE ${OPTIMIZE_OPTION} -DNO_METADEF_ABI_COMPATIABLE) | 202 | target_compile_options(graph_base PRIVATE ${OPTIMIZE_OPTION} -DNO_METADEF_ABI_COMPATIABLE) |
| 200 | 203 | ||
| 201 | ######### libgraph_base.a ############# | 204 | ######### libgraph_base.a ############# |
| @@ -39,7 +39,7 @@ void ReportTracingRecordDuration(const ge::TracingModule stage); | |||
| 39 | 39 | ||
| 40 | // 记录函数级打点 | 40 | // 记录函数级打点 |
| 41 | 41 | ||
| 42 | - ge::ScopeTracingRecorder scope##__COUNTER__(module, std::vector<std::string>{__VA_ARGS__}) | 42 | + ge::ScopeTracingRecorder scope##__COUNTER__((module), std::vector<std::string>{__VA_ARGS__}) |
| 43 | 43 | ||
| 44 | // 记录代码片段耗时,START和END需要成对使用 | 44 | // 记录代码片段耗时,START和END需要成对使用 |
| 45 | 45 | ||
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef INC_EXTERNAL_ACL_ACL_BASE_MODEL_H_ | 11 | +#ifndef INC_EXTERNAL_ACL_ACL_BASE_MDL_H_ |
| 12 | -#define INC_EXTERNAL_ACL_ACL_BASE_MODEL_H_ | 12 | +#define INC_EXTERNAL_ACL_ACL_BASE_MDL_H_ |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -352,4 +352,4 @@ ACL_FUNC_VISIBILITY aclError aclSetTensorPlaceMent(aclTensorDesc *desc, aclMemTy | |||
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | 354 | ||
| 355 | -#endif // INC_EXTERNAL_ACL_ACL_BASE_MODEL_H_ | 355 | +#endif // INC_EXTERNAL_ACL_ACL_BASE_MDL_H_ |
| @@ -46,8 +46,8 @@ class GE_FUNC_VISIBILITY OpTypeContainer { | |||
| 46 | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char_t *var_name | 46 | FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char_t *var_name |
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | - const char_t *var_name = str_name; \ | 49 | + const char_t *var_name = (str_name); \ |
| 50 | - const bool VAR_UNUSED g_##var_name##_reg = OpTypeContainer::Instance()->Register(str_name) | 50 | + const bool VAR_UNUSED g_##var_name##_reg = OpTypeContainer::Instance()->Register((str_name)) |
| 51 | 51 | ||
| 52 | -#define IS_OPTYPE_EXISTING(str_name) (ge::OpTypeContainer::Instance()->IsExisting(str_name)) | 52 | +#define IS_OPTYPE_EXISTING(str_name) (ge::OpTypeContainer::Instance()->IsExisting((str_name))) |
| 53 | 53 | ||
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef CCE_RUNTIME_ACL_RT_MODEL_H | 11 | +#ifndef FRAMEWORK_COMMON_RUNTIME_MODEL_GE_H |
| 12 | -#define CCE_RUNTIME_ACL_RT_MODEL_H | 12 | +#define FRAMEWORK_COMMON_RUNTIME_MODEL_GE_H |
| 13 | 13 | ||
| 14 | typedef enum acltagModelTaskType { | 14 | typedef enum acltagModelTaskType { |
| 15 | ACL_RT_MODEL_TASK_KERNEL = 0, | 15 | ACL_RT_MODEL_TASK_KERNEL = 0, |
| @@ -111,5 +111,5 @@ typedef aclrtModelTaskType_t rtModelTaskType_t; | |||
| 111 | 111 | ||
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | -#endif | 114 | +#endif // CCE_RUNTIME_RT_MODEL_H |
| 115 | -#endif | 115 | +#endif // FRAMEWORK_COMMON_RUNTIME_MODEL_GE_H |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef B369E37D560547C2B8DC137404F9713E_H | 11 | +#ifndef INC_GRAPH_METADEF_REGISTER_KERNEL_REGISTRY_H |
| 12 | -#define B369E37D560547C2B8DC137404F9713E_H | 12 | +#define INC_GRAPH_METADEF_REGISTER_KERNEL_REGISTRY_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -89,4 +89,4 @@ class KernelRegisterV2 { | |||
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | 91 | ||
| 92 | -#endif | 92 | +#endif // INC_GRAPH_METADEF_REGISTER_KERNEL_REGISTRY_H |
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef INC_EXTERNAL_REGISTER_KERNEL_REGISTER_IMPL_H_ | 11 | +#ifndef INC_GRAPH_METADEF_REGISTER_KERNEL_REGISTRY_IMPL_H_ |
| 12 | -#define INC_EXTERNAL_REGISTER_KERNEL_REGISTER_IMPL_H_ | 12 | +#define INC_GRAPH_METADEF_REGISTER_KERNEL_REGISTRY_IMPL_H_ |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -30,4 +30,4 @@ class KernelRegistryImpl : public KernelRegistry { | |||
| 30 | }; | 30 | }; |
| 31 | } // namespace gert | 31 | } // namespace gert |
| 32 | 32 | ||
| 33 | -#endif // INC_EXTERNAL_REGISTER_KERNEL_REGISTER_IMPL_H_ | 33 | +#endif // INC_GRAPH_METADEF_REGISTER_KERNEL_REGISTRY_IMPL_H_ |
| @@ -47,5 +47,5 @@ class OpExtGenCalcParamRegister { | |||
| 47 | fe::OpExtGenCalcParamRegister(type, func) | 47 | fe::OpExtGenCalcParamRegister(type, func) |
| 48 | 48 | ||
| 49 | REGISTER_NODE_EXT_CALC_PARAM_COUNTER2(type, func, counter) | 49 | REGISTER_NODE_EXT_CALC_PARAM_COUNTER2(type, func, counter) |
| 50 | -#define REGISTER_NODE_EXT_CALC_PARAM(type, func) REGISTER_NODE_EXT_CALC_PARAM_COUNTER(type, func, __COUNTER__) | 50 | +#define REGISTER_NODE_EXT_CALC_PARAM(type, func) REGISTER_NODE_EXT_CALC_PARAM_COUNTER((type), (func), __COUNTER__) |
| 51 | 51 | ||
| @@ -8,8 +8,8 @@ | |||
| 8 | * See LICENSE in the root of the software repository for the full text of the License. | 8 | * See LICENSE in the root of the software repository for the full text of the License. |
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | -#ifndef INC_REGISTER_OP_EXTRA_GENTASK_REGISTRY_H | 11 | +#ifndef INC_GRAPH_METADEF_REGISTER_OP_EXT_GENTASK_REGISTRY_H |
| 12 | -#define INC_REGISTER_OP_EXTRA_GENTASK_REGISTRY_H | 12 | +#define INC_GRAPH_METADEF_REGISTER_OP_EXT_GENTASK_REGISTRY_H |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -68,19 +68,20 @@ class ExtTaskTypeRegister { | |||
| 68 | 68 | ||
| 69 | static const fe::OpExtGenTaskRegister g_reg_op_ext_gentask_# | 69 | static const fe::OpExtGenTaskRegister g_reg_op_ext_gentask_# |
| 70 | fe::OpExtGenTaskRegister(type, func) | 70 | fe::OpExtGenTaskRegister(type, func) |
| 71 | -#define REGISTER_NODE_EXT_GENTASK_COUNTER(type, func, counter) REGISTER_NODE_EXT_GENTASK_COUNTER2(type, func, counter) | 71 | +#define REGISTER_NODE_EXT_GENTASK_COUNTER(type, func, counter) \ |
| 72 | -#define REGISTER_NODE_EXT_GENTASK(type, func) REGISTER_NODE_EXT_GENTASK_COUNTER(type, func, __COUNTER__) | 72 | + REGISTER_NODE_EXT_GENTASK_COUNTER2((type), (func), counter) |
| 73 | + | ||
| 73 | 74 | ||
| 74 | 75 | ||
| 75 | static const fe::SKExtGenTaskRegister g_reg_op_ext_gentask_# | 76 | static const fe::SKExtGenTaskRegister g_reg_op_ext_gentask_# |
| 76 | fe::SKExtGenTaskRegister(type, func) | 77 | fe::SKExtGenTaskRegister(type, func) |
| 77 | -#define REGISTER_SK_EXT_GENTASK_COUNTER(type, func, counter) REGISTER_SK_EXT_GENTASK_COUNTER2(type, func, counter) | 78 | +#define REGISTER_SK_EXT_GENTASK_COUNTER(type, func, counter) REGISTER_SK_EXT_GENTASK_COUNTER2((type), (func), counter) |
| 78 | -#define REGISTER_SK_EXT_GENTASK(type, func) REGISTER_SK_EXT_GENTASK_COUNTER(type, func, __COUNTER__) | 79 | +#define REGISTER_SK_EXT_GENTASK(type, func) REGISTER_SK_EXT_GENTASK_COUNTER((type), (func), __COUNTER__) |
| 79 | 80 | ||
| 80 | 81 | ||
| 81 | static const fe::ExtTaskTypeRegister g_reg_op_ext_gentask_# | 82 | static const fe::ExtTaskTypeRegister g_reg_op_ext_gentask_# |
| 82 | fe::ExtTaskTypeRegister( | 83 | fe::ExtTaskTypeRegister( |
| 83 | 84 | ||
| 84 | REGISTER_EXT_TASK_TYPE_COUNTER2(type, task_type, counter) | 85 | REGISTER_EXT_TASK_TYPE_COUNTER2(type, task_type, counter) |
| 85 | -#define REGISTER_EXT_TASK_TYPE(type, task_type) REGISTER_EXT_TASK_TYPE_COUNTER(type, task_type, __COUNTER__) | 86 | +#define REGISTER_EXT_TASK_TYPE(type, task_type) REGISTER_EXT_TASK_TYPE_COUNTER(type, (task_type), __COUNTER__) |
| 86 | -#endif // INC_REGISTER_OP_EXTRA_GENTASK_REGISTRY_H | 87 | +#endif // INC_GRAPH_METADEF_REGISTER_OP_EXT_GENTASK_REGISTRY_H |
| @@ -17,7 +17,6 @@ | |||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | - | ||
| 21 | 20 | ||
| 22 | struct MsprofOptions { | 21 | struct MsprofOptions { |
| 23 | char jobId[2048]; | 22 | char jobId[2048]; |
| @@ -56,7 +56,6 @@ | |||
| 56 | 56 | ||
| 57 | 57 | ||
| 58 | 58 | ||
| 59 | - | ||
| 60 | 59 | ||
| 61 | namespace ge { | 60 | namespace ge { |
| 62 | constexpr uint32_t kAddrRefreshOpParamOffset = 48U; | 61 | constexpr uint32_t kAddrRefreshOpParamOffset = 48U; |
| @@ -71,6 +71,34 @@ TEST_F(FlowFuncManagerSTest, register_func_null) { | |||
| 71 | EXPECT_FALSE(ret); | 71 | EXPECT_FALSE(ret); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | +TEST_F(FlowFuncManagerSTest, register_multi_func_name_null) { | ||
| 75 | + MULTI_FUNC_CREATOR_FUNC func = [](std::shared_ptr<MetaMultiFunc> &, | ||
| 76 | + std::map<AscendString, PROC_FUNC_WITH_CONTEXT> &) -> int32_t { | ||
| 77 | + return FLOW_FUNC_SUCCESS; | ||
| 78 | + }; | ||
| 79 | + auto ret = RegisterMultiFunc(nullptr, func); | ||
| 80 | + EXPECT_FALSE(ret); | ||
| 81 | +} | ||
| 82 | + | ||
| 83 | +TEST_F(FlowFuncManagerSTest, register_multi_func_null) { | ||
| 84 | + auto ret = RegisterMultiFunc("test_multi_func_null", MULTI_FUNC_CREATOR_FUNC()); | ||
| 85 | + EXPECT_FALSE(ret); | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +TEST_F(FlowFuncManagerSTest, register_multi_func_with_q_name_null) { | ||
| 89 | + MULTI_FUNC_WITH_Q_CREATOR_FUNC func = [](std::shared_ptr<MetaMultiFunc> &, | ||
| 90 | + std::map<AscendString, PROC_FUNC_WITH_CONTEXT_Q> &) -> int32_t { | ||
| 91 | + return FLOW_FUNC_SUCCESS; | ||
| 92 | + }; | ||
| 93 | + auto ret = RegisterMultiFunc(nullptr, func); | ||
| 94 | + EXPECT_FALSE(ret); | ||
| 95 | +} | ||
| 96 | + | ||
| 97 | +TEST_F(FlowFuncManagerSTest, register_multi_func_with_q_null) { | ||
| 98 | + auto ret = RegisterMultiFunc("test_multi_func_with_q_null", MULTI_FUNC_WITH_Q_CREATOR_FUNC()); | ||
| 99 | + EXPECT_FALSE(ret); | ||
| 100 | +} | ||
| 101 | + | ||
| 74 | TEST_F(FlowFuncManagerSTest, not_register) { | 102 | TEST_F(FlowFuncManagerSTest, not_register) { |
| 75 | FlowFuncManager &instance = FlowFuncManager::Instance(); | 103 | FlowFuncManager &instance = FlowFuncManager::Instance(); |
| 76 | std::string instance_name = "pp0"; | 104 | std::string instance_name = "pp0"; |
| @@ -82,6 +82,34 @@ TEST_F(FlowFuncManagerUTest, register_func_null) { | |||
| 82 | EXPECT_FALSE(ret); | 82 | EXPECT_FALSE(ret); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | +TEST_F(FlowFuncManagerUTest, register_multi_func_name_null) { | ||
| 86 | + MULTI_FUNC_CREATOR_FUNC func = [](std::shared_ptr<MetaMultiFunc> &, | ||
| 87 | + std::map<AscendString, PROC_FUNC_WITH_CONTEXT> &) -> int32_t { | ||
| 88 | + return FLOW_FUNC_SUCCESS; | ||
| 89 | + }; | ||
| 90 | + auto ret = RegisterMultiFunc(nullptr, func); | ||
| 91 | + EXPECT_FALSE(ret); | ||
| 92 | +} | ||
| 93 | + | ||
| 94 | +TEST_F(FlowFuncManagerUTest, register_multi_func_null) { | ||
| 95 | + auto ret = RegisterMultiFunc("test_multi_func_null", MULTI_FUNC_CREATOR_FUNC()); | ||
| 96 | + EXPECT_FALSE(ret); | ||
| 97 | +} | ||
| 98 | + | ||
| 99 | +TEST_F(FlowFuncManagerUTest, register_multi_func_with_q_name_null) { | ||
| 100 | + MULTI_FUNC_WITH_Q_CREATOR_FUNC func = [](std::shared_ptr<MetaMultiFunc> &, | ||
| 101 | + std::map<AscendString, PROC_FUNC_WITH_CONTEXT_Q> &) -> int32_t { | ||
| 102 | + return FLOW_FUNC_SUCCESS; | ||
| 103 | + }; | ||
| 104 | + auto ret = RegisterMultiFunc(nullptr, func); | ||
| 105 | + EXPECT_FALSE(ret); | ||
| 106 | +} | ||
| 107 | + | ||
| 108 | +TEST_F(FlowFuncManagerUTest, register_multi_func_with_q_null) { | ||
| 109 | + auto ret = RegisterMultiFunc("test_multi_func_with_q_null", MULTI_FUNC_WITH_Q_CREATOR_FUNC()); | ||
| 110 | + EXPECT_FALSE(ret); | ||
| 111 | +} | ||
| 112 | + | ||
| 85 | TEST_F(FlowFuncManagerUTest, not_register) { | 113 | TEST_F(FlowFuncManagerUTest, not_register) { |
| 86 | FlowFuncManager &instance = FlowFuncManager::Instance(); | 114 | FlowFuncManager &instance = FlowFuncManager::Instance(); |
| 87 | std::string instance_name = "pp0"; | 115 | std::string instance_name = "pp0"; |