@@ -157,7 +157,7 @@ Status DataTypeTransfer::TransDataType(const CastArgs &args, TransResult &result | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, | ||||
"[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", total_size, args.src_data_size); | "[Allocate][DSTMemory]Failed, memory for dst buf %zu, data size %zu", total_size, args.src_data_size); | ||||
REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", | REPORT_CALL_ERROR("E19999", "Failed to allocate memory for dst buf %zu, data size %zu", | ||||
total_size, args.src_data_size); | |||||
total_size, args.src_data_size); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
@@ -78,12 +78,12 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, | ||||
"[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", | "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", | ||||
total_size, ShapeToString(args.dst_shape).c_str(), | total_size, ShapeToString(args.dst_shape).c_str(), | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld, shape %s when trans format from %s to %s", | ||||
total_size, ShapeToString(args.dst_shape).c_str(), | total_size, ShapeToString(args.dst_shape).c_str(), | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
@@ -126,10 +126,10 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size | |||||
"[Operate][Memory]Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " | "[Operate][Memory]Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " | ||||
"HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", | "HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", | ||||
c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); | c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, h_idx, w_idx, c_idx, n_idx, dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " | |||||
"HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", | |||||
c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, | |||||
h_idx, w_idx, c_idx, n_idx, dst_offset, ret); | |||||
REPORT_CALL_ERROR("E19999", "Failed to copy data from C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld to " | |||||
"HWCN[%ld, %ld, %ld, %ld] offset %ld, err-code %d", | |||||
c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, src_offset, | |||||
h_idx, w_idx, c_idx, n_idx, dst_offset, ret); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -158,7 +158,7 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu | |||||
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, src shape %s.", | GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, src shape %s.", | ||||
total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); | total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); | ||||
REPORT_CALL_ERROR("E19999", "Get shape faield, total size %ld from dst shape %s, src shape %s.", | REPORT_CALL_ERROR("E19999", "Get shape faield, total size %ld from dst shape %s, src shape %s.", | ||||
total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); | |||||
total_size, ShapeToString(args.dst_shape).c_str(), ShapeToString(args.src_shape).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
GELOGD("Begin to trans format from C1HWNCoC0 to HWCN, src shape %s, data type %s, dst shape %s, memory size %ld.", | GELOGD("Begin to trans format from C1HWNCoC0 to HWCN, src shape %s, data type %s, dst shape %s, memory size %ld.", | ||||
@@ -171,9 +171,9 @@ Status FormatTransferC1hwncoc0Hwcn::TransFormat(const TransArgs &args, TransResu | |||||
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), | ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), | ||||
ShapeToString(args.dst_shape).c_str(), total_size, ret); | ShapeToString(args.dst_shape).c_str(), total_size, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, " | REPORT_CALL_ERROR("E19999", "Failed to get data after trans, src shape %s, data type %s, " | ||||
"dst shape %s, memory size %ld, error_code %u", | |||||
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), total_size, ret); | |||||
"dst shape %s, memory size %ld, error_code %u", | |||||
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), total_size, ret); | |||||
return ret; | return ret; | ||||
} | } | ||||
return SUCCESS; | return SUCCESS; | ||||
@@ -1,4 +1,4 @@ | |||||
/**` | |||||
/** | |||||
* Copyright 2020 Huawei Technologies Co., Ltd | * Copyright 2020 Huawei Technologies Co., Ltd | ||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
@@ -97,10 +97,10 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | "when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
@@ -127,9 +127,9 @@ Status TransFormatDhwckToFz3D(const TransArgs &args, TransResult &result) { | |||||
} | } | ||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " | ||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " | |||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " | |||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -96,12 +96,12 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul | |||||
std::shared_ptr<uint8_t> dst(new (std::nothrow) uint8_t[dst_size], std::default_delete<uint8_t[]>()); | std::shared_ptr<uint8_t> dst(new (std::nothrow) uint8_t[dst_size], std::default_delete<uint8_t[]>()); | ||||
if (dst == nullptr) { | if (dst == nullptr) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | |||||
"when trans format from %s to %s", | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
@@ -128,9 +128,9 @@ Status TransFormatDhwncToFz3DTranspose(const TransArgs &args, TransResult &resul | |||||
} | } | ||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, " | ||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " | |||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, " | |||||
"error-code %d, pad mode %d", dst_offset, ret, pad_zero); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -88,8 +88,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap | |||||
hw_shape.push_back(src_shape[kNdDimIndexN]); | hw_shape.push_back(src_shape[kNdDimIndexN]); | ||||
if (!IsShapeValid(dst_shape)) { | if (!IsShapeValid(dst_shape)) { | ||||
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", | GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", | ||||
ShapeToString(dst_shape).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); | |||||
ShapeToString(dst_shape).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
return SUCCESS; | return SUCCESS; | ||||
@@ -108,9 +108,9 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap | |||||
hw_shape.push_back(src_shape[size - kNdDimCountBackwardsWH]); | hw_shape.push_back(src_shape[size - kNdDimCountBackwardsWH]); | ||||
hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); | hw_shape.push_back(src_shape[size - kNdDimCountBackwardsW]); | ||||
if (!IsShapeValid(dst_shape)) { | if (!IsShapeValid(dst_shape)) { | ||||
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", | |||||
ShapeToString(dst_shape).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); | |||||
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][DSTShape]Failed, dst shape %s", | |||||
ShapeToString(dst_shape).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
return SUCCESS; | return SUCCESS; | ||||
@@ -122,7 +122,7 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { | |||||
auto ret = TransShapeToFracNz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); | auto ret = TransShapeToFracNz(args.dst_shape, args.src_data_type, expect_src_shape, hw_shape); | ||||
if (ret != SUCCESS) { | if (ret != SUCCESS) { | ||||
GELOGE(ret, "[Transfer][ShapeToFracNz]Failed, shape from %s to %s, shape %s to %s, " | GELOGE(ret, "[Transfer][ShapeToFracNz]Failed, shape from %s to %s, shape %s to %s, " | ||||
"data type %s, error_code:%u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), | |||||
"data type %s, error_code:%u", TypeUtils::FormatToSerialString(args.dst_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), | TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), | ||||
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); | ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), ret); | ||||
return ret; | return ret; | ||||
@@ -147,8 +147,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con | |||||
"memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), | "memory for dst buf %ld", TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | ||||
REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", | REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
@@ -184,7 +184,7 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con | |||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", | ||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", | |||||
dst_offset, ret); | dst_offset, ret); | ||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
@@ -199,9 +199,9 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con | |||||
auto ret = memcpy_s(dst.get() + dst_offset, static_cast<size_t>(protected_size), args.data + src_offset, | auto ret = memcpy_s(dst.get() + dst_offset, static_cast<size_t>(protected_size), args.data + src_offset, | ||||
static_cast<size_t>(size)); | static_cast<size_t>(size)); | ||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", | |||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d", | |||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", | |||||
dst_offset, ret); | dst_offset, ret); | ||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
@@ -228,8 +228,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | ||||
REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", | REPORT_CALL_ERROR("E19999", "Failed to trans format from %s to %s and allocate memory for dst buf %ld", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), dst_size); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
@@ -265,7 +265,7 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con | |||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | ||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -279,9 +279,9 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con | |||||
ret = memcpy_s(dst.get() + dst_offset, static_cast<size_t>(protected_size), args.data + src_offset, | ret = memcpy_s(dst.get() + dst_offset, static_cast<size_t>(protected_size), args.data + src_offset, | ||||
static_cast<size_t>(size)); | static_cast<size_t>(size)); | ||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | |||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | |||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -297,13 +297,13 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & | |||||
if (!IsDataTypeSupport(args.src_data_type)) { | if (!IsDataTypeSupport(args.src_data_type)) { | ||||
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | ||||
"[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, " | "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, " | ||||
"data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
"data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | ||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ||||
REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " | REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " | ||||
"dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), | "dst shape %s, data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_DATATYPE_INVALID; | return ACL_ERROR_GE_DATATYPE_INVALID; | ||||
} | } | ||||
if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { | if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { | ||||
@@ -314,8 +314,8 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult & | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ||||
REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " | REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " | ||||
"data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), | "data type %s is not supported", TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | ||||
@@ -339,22 +339,22 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector | |||||
if (!IsDataTypeSupport(data_type)) { | if (!IsDataTypeSupport(data_type)) { | ||||
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | ||||
"[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", | "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " | REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " | ||||
"data type %s is not supported", | "data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(src_format).c_str(),TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
return ACL_ERROR_GE_DATATYPE_INVALID; | return ACL_ERROR_GE_DATATYPE_INVALID; | ||||
} | } | ||||
if (!CheckShape(src_format, src_shape)) { | if (!CheckShape(src_format, src_shape)) { | ||||
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, | GELOGE(ACL_ERROR_GE_SHAPE_INVALID, | ||||
"[Check][Shape]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", | "[Check][Shape]Failed, trans format from %s to %s, src shape %s, data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, data type %s is not supported", | REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
ShapeVector hw_shape; | ShapeVector hw_shape; | ||||
@@ -365,28 +365,28 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult | |||||
if (!IsDataTypeSupport(args.src_data_type)) { | if (!IsDataTypeSupport(args.src_data_type)) { | ||||
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | ||||
"[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", | "[Check][Datatype]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " | REPORT_INNER_ERROR("E19999", "Check datatype failed, trans format from %s to %s, src shape %s, " | ||||
"dst shape %s, data type %s is not supported", | "dst shape %s, data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_DATATYPE_INVALID; | return ACL_ERROR_GE_DATATYPE_INVALID; | ||||
} | } | ||||
if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { | if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) { | ||||
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, | GELOGE(ACL_ERROR_GE_SHAPE_INVALID, | ||||
"[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", | "[Check][Shape]Failed, trans format from %s to %s, src shape %s, dst shape %s, data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " | REPORT_INNER_ERROR("E19999", "Check shape failed, trans format from %s to %s, src shape %s, dst shape %s, " | ||||
"data type %s is not supported", | "data type %s is not supported", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | ||||
@@ -193,10 +193,10 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | "when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION;); | return ACL_ERROR_GE_MEMORY_ALLOCATION;); | ||||
for (int64_t vfi = 0; vfi < vf_cnt; vfi++) { | for (int64_t vfi = 0; vfi < vf_cnt; vfi++) { | ||||
@@ -241,7 +241,7 @@ Status TransFormatFromNchwToFz(const TransArgs &args, TransResult &result) { | |||||
} | } | ||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d pad mode %d", | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d pad mode %d", | ||||
offset, ret, need_pad_zero); | |||||
offset, ret, need_pad_zero); | |||||
REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", | REPORT_CALL_ERROR("E19999","Failed to operate dst memory at offset %ld, error-code %d pad mode %d", | ||||
offset, ret, need_pad_zero); | offset, ret, need_pad_zero); | ||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
@@ -265,10 +265,9 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, | |||||
int64_t cout_ori = n_dim / groups; | int64_t cout_ori = n_dim / groups; | ||||
if (cin_ori == 0 || cout_ori == 0) { | if (cin_ori == 0 || cout_ori == 0) { | ||||
GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, " | GELOGE(GRAPH_FAILED, "[Check][Param]Failed, cin_ori, cout_ori must not be equal 0, and current cin_ori, " | ||||
"cout_ori, groups are %ld %ld %ld", | |||||
cin_ori, cout_ori, groups); | |||||
"cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); | |||||
REPORT_CALL_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," | REPORT_CALL_ERROR("E19999", "Check graph param failed, cin_ori, cout_ori must not be equal 0," | ||||
"and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); | |||||
"and current cin_ori, cout_ori, groups are %ld %ld %ld", cin_ori, cout_ori, groups); | |||||
return GRAPH_FAILED; | return GRAPH_FAILED; | ||||
} | } | ||||
const int64_t cube_k = GetCubeSizeByDataType(args.src_data_type); | const int64_t cube_k = GetCubeSizeByDataType(args.src_data_type); | ||||
@@ -291,11 +290,11 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, | |||||
if (dst == nullptr) { | if (dst == nullptr) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | "when trans format from %s to %s", | ||||
size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
size_output_data, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
ret = memset_s(dst.get(), static_cast<size_t>(size_output_data), 0, static_cast<size_t>(size_output_data)); | ret = memset_s(dst.get(), static_cast<size_t>(size_output_data), 0, static_cast<size_t>(size_output_data)); | ||||
@@ -367,10 +366,10 @@ Status TransFormatHwcnToFz(const TransArgs &args, TransResult &result) { | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | "when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION;); | return ACL_ERROR_GE_MEMORY_ALLOCATION;); | ||||
for (int64_t c1i = 0; c1i < c1; c1i++) { | for (int64_t c1i = 0; c1i < c1; c1i++) { | ||||
@@ -448,10 +447,10 @@ Status TransFormatNhwcToFz(const TransArgs &args, TransResult &result) { | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | "when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION;); | return ACL_ERROR_GE_MEMORY_ALLOCATION;); | ||||
for (int64_t c1i = 0; c1i < c1; c1i++) { | for (int64_t c1i = 0; c1i < c1; c1i++) { | ||||
@@ -123,9 +123,9 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) { | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), | TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), | ||||
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ||||
REPORT_CALL_ERROR("E19999", "Failed to trans shape from %s to %s, shape %s to %s, data type %s", | REPORT_CALL_ERROR("E19999", "Failed to trans shape from %s to %s, shape %s to %s, data type %s", | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), | |||||
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), ShapeToString(args.dst_shape).c_str(), | |||||
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ret; | return ret; | ||||
} | } | ||||
if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { | if (!IsTransShapeSrcCorrect(args, expect_src_shape)) { | ||||
@@ -147,10 +147,10 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | "when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
// The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D | // The src&dst_shape can be written as times*H*W & times*H1*W1*H0*W0, respectively. dst_shape_size >= kDimNum4D | ||||
@@ -189,7 +189,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con | |||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | ||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -207,7 +207,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con | |||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | ||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -232,9 +232,9 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con | |||||
GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Allocate][DSTMemory]Failed to allcoate memory for dst buf %ld " | ||||
"when trans format from %s to %s", | "when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | REPORT_CALL_ERROR("E19999", "Failed to allcoate memory for dst buf %ld when trans format from %s to %s", | ||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str()); | TypeUtils::FormatToSerialString(args.dst_format).c_str()); | ||||
return ACL_ERROR_GE_MEMORY_ALLOCATION; | return ACL_ERROR_GE_MEMORY_ALLOCATION; | ||||
} | } | ||||
@@ -275,7 +275,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con | |||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | ||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -293,7 +293,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con | |||||
if (ret != EOK) { | if (ret != EOK) { | ||||
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed at offset %ld, error-code %d", | ||||
dst_offset, ret); | dst_offset, ret); | ||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
REPORT_CALL_ERROR("E19999", "Failed to operate dst memory at offset %ld, error-code %d", dst_offset, ret); | |||||
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; | ||||
} | } | ||||
} | } | ||||
@@ -312,7 +312,11 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & | |||||
"[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", | "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | ||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, " | |||||
"dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_DATATYPE_INVALID; | return ACL_ERROR_GE_DATATYPE_INVALID; | ||||
} | } | ||||
if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { | if (!CheckShape(args.src_format, args.src_shape) || !IsShapeValid(args.dst_shape)) { | ||||
@@ -320,7 +324,11 @@ Status FormatTransferFractalZz::TransFormat(const TransArgs &args, TransResult & | |||||
"[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", | "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | ||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " | |||||
"dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | ||||
@@ -345,7 +353,11 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector | |||||
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, | ||||
"[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, data type %s", | "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, data type %s", | ||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | ||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
REPORT_INNER_ERROR("E19999", "Check datatype failed, not support trans format from %s to %s, src shape %s, data type %s", | |||||
TypeUtils::FormatToSerialString(src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
return ACL_ERROR_GE_DATATYPE_INVALID; | return ACL_ERROR_GE_DATATYPE_INVALID; | ||||
} | } | ||||
if (!CheckShape(src_format, src_shape)) { | if (!CheckShape(src_format, src_shape)) { | ||||
@@ -353,6 +365,10 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector | |||||
"[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, data type %s", | "[Check][Shape]Failed, not support trans format from %s to %s, src shape %s, data type %s", | ||||
TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | TypeUtils::FormatToSerialString(src_format).c_str(), TypeUtils::FormatToSerialString(dst_format).c_str(), | ||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | ||||
REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, data type %s", | |||||
TypeUtils::FormatToSerialString(src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(dst_format).c_str(), | |||||
ShapeToString(src_shape).c_str(), TypeUtils::DataTypeToSerialString(data_type).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
ShapeVector hw_shape; | ShapeVector hw_shape; | ||||
@@ -365,7 +381,11 @@ Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult | |||||
"[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", | "[Check][Datatype]Failed, not support trans format from %s to %s, src shape %s, dst shape %s, data type %s", | ||||
TypeUtils::FormatToSerialString(args.src_format).c_str(), | TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | ||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
REPORT_INNER_ERROR("E19999", "Check datatype Failed, not support trans format from %s to %s, src shape %s, " | |||||
"dst shape %s, data type %s",TypeUtils::FormatToSerialString(args.src_format).c_str(), | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_DATATYPE_INVALID; | return ACL_ERROR_GE_DATATYPE_INVALID; | ||||
} | } | ||||
@@ -377,8 +397,8 @@ Status FormatTransferFractalZzND::TransFormat(const TransArgs &args, TransResult | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | ||||
REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " | REPORT_CALL_ERROR("E19999", "Check shape failed, not support trans format from %s to %s, src shape %s, " | ||||
"dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), | "dst shape %s, data type %s", TypeUtils::FormatToSerialString(args.src_format).c_str(), | ||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
TypeUtils::FormatToSerialString(args.dst_format).c_str(), ShapeToString(args.src_shape).c_str(), | |||||
ShapeToString(args.dst_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str()); | |||||
return ACL_ERROR_GE_SHAPE_INVALID; | return ACL_ERROR_GE_SHAPE_INVALID; | ||||
} | } | ||||
GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s", | ||||