已合并
参数格式修改为小驼峰 #3750
weike创建于 7月3日
参数格式修改为小驼峰 #3750
已合并
共 1 个文件变更+10-11
| @@ -46,11 +46,10 @@ static bool CheckNotNull(const aclTensor* self, const aclTensor* other, const ac | |||
| 46 | 46 | ||
| 47 | static bool CheckDtypeValid(const aclTensor* self, const aclTensor* other) | 47 | static bool CheckDtypeValid(const aclTensor* self, const aclTensor* other) |
| 48 | { | 48 | { |
| 49 | - bool isBf16Support = | 49 | + bool isBf16Support = (GetCurrentPlatformInfo().GetSocVersion() >= SocVersion::ASCEND910B && |
| 50 | - (GetCurrentPlatformInfo().GetSocVersion() >= SocVersion::ASCEND910B && | 50 | + GetCurrentPlatformInfo().GetSocVersion() <= SocVersion::ASCEND910E); |
| 51 | - GetCurrentPlatformInfo().GetSocVersion() <= SocVersion::ASCEND910E); | 51 | + const std::initializer_list<op::DataType> dtypeSupportList = isBf16Support ? DTYPE_SUPPORT_LIST_910B : |
| 52 | - const std::initializer_list<op::DataType> dtypeSupportList = | 52 | + DTYPE_SUPPORT_LIST_910; |
| 53 | - isBf16Support ? DTYPE_SUPPORT_LIST_910B : DTYPE_SUPPORT_LIST_910; | ||
| 54 | 53 | ||
| 55 | // 检查self的数据类型是否在支持列表内 | 54 | // 检查self的数据类型是否在支持列表内 |
| 56 | OP_CHECK_DTYPE_NOT_SUPPORT(self, dtypeSupportList, return false); | 55 | OP_CHECK_DTYPE_NOT_SUPPORT(self, dtypeSupportList, return false); |
| @@ -94,13 +93,13 @@ static aclnnStatus CheckParams(const aclTensor* self, const aclTensor* other, co | |||
| 94 | return ACLNN_SUCCESS; | 93 | return ACLNN_SUCCESS; |
| 95 | } | 94 | } |
| 96 | 95 | ||
| 97 | -aclnnStatus aclnnIsCloseGetWorkspaceSize( | 96 | +aclnnStatus aclnnIsCloseGetWorkspaceSize(const aclTensor* self, const aclTensor* other, double rtol, double atol, |
| 98 | - const aclTensor* self, const aclTensor* other, double rtol, double atol, bool equal_nan, aclTensor* out, | 97 | + bool equalNan, aclTensor* out, uint64_t* workspaceSize, |
| 99 | - uint64_t* workspaceSize, aclOpExecutor** executor) | 98 | + aclOpExecutor** executor) |
| 100 | { | 99 | { |
| 101 | OP_CHECK_COMM_INPUT(workspaceSize, executor); | 100 | OP_CHECK_COMM_INPUT(workspaceSize, executor); |
| 102 | 101 | ||
| 103 | - L2_DFX_PHASE_1(aclnnIsClose, DFX_IN(self, other, rtol, atol, equal_nan), DFX_OUT(out)); | 102 | + L2_DFX_PHASE_1(aclnnIsClose, DFX_IN(self, other, rtol, atol, equalNan), DFX_OUT(out)); |
| 104 | 103 | ||
| 105 | // 固定写法,参数检查 | 104 | // 固定写法,参数检查 |
| 106 | auto ret = CheckParams(self, other, out); | 105 | auto ret = CheckParams(self, other, out); |
| @@ -133,8 +132,8 @@ aclnnStatus aclnnIsCloseGetWorkspaceSize( | |||
| 133 | CHECK_RET(otherContiguous != nullptr, ACLNN_ERR_INNER_NULLPTR); | 132 | CHECK_RET(otherContiguous != nullptr, ACLNN_ERR_INNER_NULLPTR); |
| 134 | 133 | ||
| 135 | // 调用IsClose算子kernel | 134 | // 调用IsClose算子kernel |
| 136 | - auto isCloseOpOut = | 135 | + auto isCloseOpOut = l0op::IsClose(selfContiguous, otherContiguous, rtol_fp32, atol_fp32, equalNan, out, |
| 137 | - l0op::IsClose(selfContiguous, otherContiguous, rtol_fp32, atol_fp32, equal_nan, out, uniqueExecutor.get()); | 136 | + uniqueExecutor.get()); |
| 138 | CHECK_RET(isCloseOpOut != nullptr, ACLNN_ERR_INNER_NULLPTR); | 137 | CHECK_RET(isCloseOpOut != nullptr, ACLNN_ERR_INNER_NULLPTR); |
| 139 | 138 | ||
| 140 | // 固定写法,将计算结果拷贝到输出out上,out可能是非连续的tensor | 139 | // 固定写法,将计算结果拷贝到输出out上,out可能是非连续的tensor |
其他变量命名也统一一下吧