format log optimize

pull/1438/head
liyihan2@huawei.com 4 years ago
parent b52f821c6e
commit 61b239ef31

@ -41,7 +41,7 @@ Status CheckArgsForFracZToHwcn(const TransArgs &args) {
return ACL_ERROR_GE_FORMAT_INVALID;
}
if (!CheckDataTypeSupported(args.src_data_type)) {
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Trans][Shape]Failed, "
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][DataType]Failed, "
"shape from FORMAT_FRACTAL_Z to HWCN, invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans shape from FORMAT_FRACTAL_Z to HWCN, "
@ -52,14 +52,14 @@ Status CheckArgsForFracZToHwcn(const TransArgs &args) {
if (!CheckShapeValid(src_shape, kFracZDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(dst_shape, kHwcnDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -90,7 +90,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, shape %s "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, shape %s "
"when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -163,7 +163,7 @@ Status FormatTransferFracZHwcn::TransFormat(const TransArgs &args, TransResult &
result.length = static_cast<size_t>(total_size);
return SUCCESS;
}
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, "
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][ShapeSize]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());
REPORT_CALL_ERROR("E19999", "Failed to get total size %ld from "

@ -41,7 +41,7 @@ Status CheckArgsForFracZToNchw(const TransArgs &args) {
return ACL_ERROR_GE_FORMAT_INVALID;
}
if (!CheckDataTypeSupported(args.src_data_type)) {
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Trans][Shape]Failed, "
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][DataType]Failed, "
"shape from FORMAT_FRACTAL_Z to NCHW, invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans shape from FORMAT_FRACTAL_Z to NCHW, "
@ -52,14 +52,14 @@ Status CheckArgsForFracZToNchw(const TransArgs &args) {
if (!CheckShapeValid(src_shape, kFracZDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(dst_shape, kNchwDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -93,7 +93,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, shape %s "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, shape %s "
"when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -167,7 +167,7 @@ Status FormatTransferFracZNchw::TransFormat(const TransArgs &args, TransResult &
return SUCCESS;
}
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, "
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][ShapeSize]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());
REPORT_CALL_ERROR("E19999", "Failed to get total size %ld from dst shape %s, src shape %s",

@ -41,7 +41,7 @@ Status CheckArgsForFracZToNhwc(const TransArgs &args) {
return ACL_ERROR_GE_FORMAT_INVALID;
}
if (!CheckDataTypeSupported(args.src_data_type)) {
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Trans][Shape]Failed, "
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][DataType]Failed, "
"shape from FORMAT_FRACTAL_Z to NCHW, invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans shape from FORMAT_FRACTAL_Z to NCHW, "
@ -52,14 +52,14 @@ Status CheckArgsForFracZToNhwc(const TransArgs &args) {
if (!CheckShapeValid(src_shape, kFracZDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(dst_shape, kNhwcDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -93,7 +93,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, int size
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
"shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -167,7 +167,7 @@ Status FormatTransferFracZNhwc::TransFormat(const TransArgs &args, TransResult &
return SUCCESS;
}
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, "
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Get][ShapeSize]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());
REPORT_CALL_ERROR("E19999", "Failed to get total size %ld from dst shape %s, src shape %s",

@ -45,7 +45,7 @@ Status TransShapeHwcnToC1hwncoc0(const DataType &data_type, const std::vector<in
if (!CheckShapeValid(dst_shape, kC1hwncoc0DimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -72,14 +72,14 @@ Status CheckArgsForHwcnToC1hwncoc0(const TransArgs &args) {
if (!CheckShapeValid(args.src_shape, kHwcnDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(args.src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(args.src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(args.dst_shape, kC1hwncoc0DimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(args.dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(args.dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -112,7 +112,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
"shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -163,8 +163,10 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
"C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld, err-code %d",
h_idx, w_idx, c_idx, n_idx, src_offset, c1_idx, h_idx, w_idx,
n_idx, co_idx, c0_idx, dst_offset, ret);
REPORT_CALL_ERROR("E19999", "Failed to copy data from HWCN[%ld, %ld, %ld, %ld] offset %ld "
"to, C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld, err-code %d",
REPORT_CALL_ERROR("E19999", "Failed to copy data from "
"HWCN[%ld, %ld, %ld, %ld] offset %ld "
"to, C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] "
"offset %ld, err-code %d",
h_idx, w_idx, c_idx, n_idx, src_offset, c1_idx, h_idx, w_idx,
n_idx, co_idx, c0_idx, dst_offset, ret);
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
@ -178,13 +180,14 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
"C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld, err-code %d",
c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, dst_offset, ret);
REPORT_CALL_ERROR("E19999", "Failed to set to 0 to "
"C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld, err-code %d",
"C1HWNCoC0[%ld, %ld, %ld, %ld, %ld, %ld] offset %ld, "
"err-code %d",
c1_idx, h_idx, w_idx, n_idx, co_idx, c0_idx, dst_offset, ret);
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
}
}
}
}
}
}
}
@ -209,7 +212,7 @@ Status FormatTransferHwcnC1hwncoc0::TransFormat(const TransArgs &args, TransResu
return SUCCESS;
}
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, "
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][ShapeSize]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());
REPORT_CALL_ERROR("E19999", "Failed to get total size %ld from dst shape %s, src shape %s",
@ -244,7 +247,7 @@ Status FormatTransferHwcnC1hwncoc0::TransShape(Format src_format, const std::vec
if (!CheckShapeValid(src_shape, kHwcnDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}

@ -41,7 +41,7 @@ Status CheckArgsForNc1hwc0ToNchw(const TransArgs &args) {
return ACL_ERROR_GE_FORMAT_INVALID;
}
if (!CheckDataTypeSupported(args.src_data_type)) {
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Trans][Shape]Failed, shape from NC1HWC0 to NCHW, "
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][DataType]Failed, shape from NC1HWC0 to NCHW, "
"invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans shape from NC1HWC0 to NCHW, invalid data type %s",
@ -51,14 +51,14 @@ Status CheckArgsForNc1hwc0ToNchw(const TransArgs &args) {
if (!CheckShapeValid(args.src_shape, kNc1hwc0DimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(args.src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(args.src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(args.dst_shape, kNchwDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(args.dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(args.dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -76,7 +76,8 @@ Status CheckArgsForNc1hwc0ToNchw(const TransArgs &args) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed to check relationship between "
"src shape %s and dst shape %s",
ShapeToString(src_shape).c_str(), ShapeToString(dst_shape).c_str());
REPORT_INNER_ERROR("E19999", "Failed to check relationship between src shape %s and dst shape %s",
REPORT_INNER_ERROR("E19999", "Failed to check relationship between src shape %s "
"and dst shape %s",
ShapeToString(src_shape).c_str(), ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -92,7 +93,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
"shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -137,7 +138,8 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
n_idx, c1_idx, h_idx, w_idx, c0_idx, src_offset, n_idx,
c_idx, h_idx, w_idx, dst_offset, ret);
REPORT_CALL_ERROR("E19999", "Failed to copy data from NC1HWC0[%ld, %ld, %ld, %ld, %ld] "
"src offset %ld to NCHW[%ld, %ld, %ld, %ld], dst offset %ld, err-code %d",
"src offset %ld to NCHW[%ld, %ld, %ld, %ld], dst offset %ld, "
"err-code %d",
n_idx, c1_idx, h_idx, w_idx, c0_idx, src_offset, n_idx,
c_idx, h_idx, w_idx, dst_offset, ret);
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
@ -166,7 +168,7 @@ Status FormatTransferNc1hwc0Nchw::TransFormat(const TransArgs &args, TransResult
return SUCCESS;
}
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, "
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Get][ShapeSize]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());
REPORT_CALL_ERROR("E19999", "Failed to get total size %ld from dst shape %s, src shape %s",

@ -41,7 +41,7 @@ Status CheckArgsForNc1hwc0ToNhwc(const TransArgs &args) {
return ACL_ERROR_GE_FORMAT_INVALID;
}
if (!CheckDataTypeSupported(args.src_data_type)) {
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Trans][Shape]Failed, shape from NC1HWC0 to NHWC, "
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][DataType]Failed, shape from NC1HWC0 to NHWC, "
"invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans shape from NC1HWC0 to NHWC, invalid data type %s",
@ -51,14 +51,14 @@ Status CheckArgsForNc1hwc0ToNhwc(const TransArgs &args) {
if (!CheckShapeValid(args.src_shape, kNc1hwc0DimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(args.src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(args.src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(args.dst_shape, kNhwcDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(args.dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(args.dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -76,7 +76,8 @@ Status CheckArgsForNc1hwc0ToNhwc(const TransArgs &args) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed to check relationship between "
"src shape %s and dst shape %s",
ShapeToString(src_shape).c_str(), ShapeToString(dst_shape).c_str());
REPORT_INNER_ERROR("E19999", "Failed to check relationship between src shape %s and dst shape %s",
REPORT_INNER_ERROR("E19999", "Failed to check relationship between src shape %s "
"and dst shape %s",
ShapeToString(src_shape).c_str(), ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -92,7 +93,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
"shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -166,7 +167,7 @@ Status FormatTransferNc1hwc0Nhwc::TransFormat(const TransArgs &args, TransResult
return SUCCESS;
}
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][Shape]Failed, total size %ld from dst shape %s, "
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Get][ShapeSize]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());
REPORT_CALL_ERROR("E19999", "Failed to get total size %ld from dst shape %s, src shape %s",

@ -61,7 +61,7 @@ Status TransShape(int64_t n, int64_t c, int64_t h, int64_t w, DataType data_type
if (!IsShapeValid(dst_shape)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s", ShapeToString(dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed", ShapeToString(dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
return SUCCESS;
@ -98,7 +98,8 @@ Status TransFormatFromNchwToFzC04(const TransArgs &args, TransResult &result) {
GELOGE(ret, "[Trans][Formats]Failed from NCHW to HWCN, src_shape %s, src_data_type %s",
ShapeToString(args.src_shape).c_str(),
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_CALL_ERROR("E19999", "Failede to trans formats from NCHW to HWCN, src_shape %s, src_data_type %s",
REPORT_CALL_ERROR("E19999", "Failede to trans formats from NCHW to HWCN, src_shape %s, "
"src_data_type %s",
ShapeToString(args.src_shape).c_str(),
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
return ret;
@ -110,7 +111,8 @@ Status TransFormatFromNchwToFzC04(const TransArgs &args, TransResult &result) {
// check size it should be same with original
size_t expect_size = n * c * h * w * size; // before has do check about mul
if (trans_result_1.length != expect_size) {
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Check][Shape]size %zu is not match expect size %zu after transpose",
GELOGE(ACL_ERROR_GE_PARAM_INVALID, "[Check][Shape]size %zu is not match expect size %zu "
"after transpose",
trans_result_1.length, expect_size);
return ACL_ERROR_GE_PARAM_INVALID;
}
@ -127,14 +129,14 @@ Status TransFormatFromNchwToFzC04(const TransArgs &args, TransResult &result) {
GE_IF_BOOL_EXEC(!CheckInt64MulOverflow(h_o, w_o),
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Shape]Failed, "
"int64 mul overflow.A[%ld], B[%ld]", h_o, w_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], B[%ld]",
h_o, w_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], "
"B[%ld]", h_o, w_o);
return ACL_ERROR_GE_INTERNAL_ERROR);
GE_IF_BOOL_EXEC(!CheckInt64MulOverflow(n_o, c_o),
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Shape]Failed, "
"int64 mul overflow.A[%ld], B[%ld]", n_o, c_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], B[%ld]",
n_o, c_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], "
"B[%ld]", n_o, c_o);
return ACL_ERROR_GE_INTERNAL_ERROR);
auto t1 = h_o * w_o;
auto t2 = n_o * c_o;
@ -149,8 +151,8 @@ Status TransFormatFromNchwToFzC04(const TransArgs &args, TransResult &result) {
GE_IF_BOOL_EXEC(!CheckInt64MulOverflow(total_ele_cnt, size),
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Shape]Failed, "
"int64 mul overflow.A[%ld], B[%d]", total_ele_cnt, size);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], B[%d]",
total_ele_cnt, size);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], "
"B[%d]", total_ele_cnt, size);
return ACL_ERROR_GE_INTERNAL_ERROR);
int64_t dst_size = total_ele_cnt * size;
if (dst_size == 0) {
@ -164,7 +166,8 @@ Status TransFormatFromNchwToFzC04(const TransArgs &args, TransResult &result) {
"when trans format from %s to %s",
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld when trans format from %s to %s",
REPORT_CALL_ERROR("E19999", "Failed to alloc the 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());
return ACL_ERROR_GE_MEMORY_ALLOCATION;
@ -238,22 +241,22 @@ Status PaddingNC(const TransArgs &args, TransArgs &args_tmp, std::shared_ptr<uin
GE_IF_BOOL_EXEC(!CheckInt64MulOverflow(h_o, w_o),
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Shape]Failed, "
"int64 mul overflow.A[%ld], B[%ld]", h_o, w_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], B[%ld]",
h_o, w_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], "
"B[%ld]", h_o, w_o);
return ACL_ERROR_GE_INTERNAL_ERROR);
GE_IF_BOOL_EXEC(!CheckInt64MulOverflow(n_o, c_o),
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Shape]Failed, "
"int64 mul overflow.A[%ld], B[%ld]", n_o, c_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], B[%ld]",
n_o, c_o);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], "
"B[%ld]", n_o, c_o);
return ACL_ERROR_GE_INTERNAL_ERROR);
auto t1 = h_o * w_o;
auto t2 = n_o * c_o;
GE_IF_BOOL_EXEC(!CheckInt64MulOverflow(t1, t2),
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Shape]Failed, "
"int64 mul overflow.A[%ld], B[%ld]", t1, t2);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], B[%ld]",
t1, t2);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], "
"B[%ld]", t1, t2);
return ACL_ERROR_GE_INTERNAL_ERROR);
int64_t total_ele_cnt = n_o * c_o * h_o * w_o;
@ -261,8 +264,8 @@ Status PaddingNC(const TransArgs &args, TransArgs &args_tmp, std::shared_ptr<uin
GE_IF_BOOL_EXEC(!CheckInt64MulOverflow(total_ele_cnt, size),
GELOGE(ACL_ERROR_GE_INTERNAL_ERROR, "[Check][Shape]Failed, "
"int64 mul overflow.A[%ld], B[%d]", total_ele_cnt, size);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], B[%d]",
total_ele_cnt, size);
REPORT_CALL_ERROR("E19999", "Check shape failed, int64 mul overflow.A[%ld], "
"B[%d]", total_ele_cnt, size);
return ACL_ERROR_GE_INTERNAL_ERROR);
int64_t dst_size = total_ele_cnt * size;
@ -276,7 +279,7 @@ Status PaddingNC(const TransArgs &args, TransArgs &args_tmp, std::shared_ptr<uin
"trans format from %s to %s",
dst_size, TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld when "
REPORT_CALL_ERROR("E19999", "Failed to alloc the 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());

@ -81,11 +81,12 @@ Status CheckArgsForNchwToNc1hwc0(const TransArgs &args) {
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(),
ShapeToString(args.src_shape).c_str(),
ShapeToString(args.dst_shape).c_str(), ShapeToString(expect_5d_shape).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans formats, the src and dst shape are not compatible. "
"data type %s, src shape %s, dst shape %s, expect dst shape %s",
REPORT_INNER_ERROR("E19999", "Failed to trans formats, the src and dst shape are not "
"compatible. data type %s, src shape %s, dst shape %s, expect dst shape %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(),
ShapeToString(args.src_shape).c_str(),
ShapeToString(args.dst_shape).c_str(), ShapeToString(expect_5d_shape).c_str());
ShapeToString(args.dst_shape).c_str(),
ShapeToString(expect_5d_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -101,7 +102,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
"shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -157,7 +158,8 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
srcIdx, src_offset, n_idx, c1_idx, h_idx, w_idx, c0_idx, dst_offset, ret);
REPORT_CALL_ERROR("E19999", "Failed to copy data from NCHW[%ld] offset %ld "
"to NC1HWC0[%ld, %ld, %ld, %ld, %ld] offset %ld, err-code %d",
srcIdx, src_offset, n_idx, c1_idx, h_idx, w_idx, c0_idx, dst_offset, ret);
srcIdx, src_offset, n_idx, c1_idx, h_idx, w_idx, c0_idx,
dst_offset, ret);
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
}
} else {

@ -65,7 +65,7 @@ Status CheckArgsForNhwcToNc1hwc0(const TransArgs &args) {
return ACL_ERROR_GE_FORMAT_INVALID;
}
if (!CheckDataTypeSupported(args.src_data_type)) {
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Trans][Shape]Failed from NHWC to NC1HWC0, "
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Check][DataType]Failed from NHWC to NC1HWC0, "
"invalid data type %s",
TypeUtils::DataTypeToSerialString(args.src_data_type).c_str());
REPORT_INNER_ERROR("E19999", "Failed to trans shape from NHWC to NC1HWC0, invalid data type %s",
@ -75,14 +75,14 @@ Status CheckArgsForNhwcToNc1hwc0(const TransArgs &args) {
if (!CheckShapeValid(args.src_shape, kNhwcDimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, src shape %s",
ShapeToString(args.src_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check src shape %s",
REPORT_CALL_ERROR("E19999", "Src shape %s check failed",
ShapeToString(args.src_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
if (!CheckShapeValid(args.dst_shape, kNc1hwc0DimsNum)) {
GELOGE(ACL_ERROR_GE_SHAPE_INVALID, "[Check][Shape]Failed, dst shape %s",
ShapeToString(args.dst_shape).c_str());
REPORT_CALL_ERROR("E19999", "Failed to check dst shape %s",
REPORT_CALL_ERROR("E19999", "Dst shape %s check failed",
ShapeToString(args.dst_shape).c_str());
return ACL_ERROR_GE_SHAPE_INVALID;
}
@ -115,7 +115,7 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
TypeUtils::FormatToSerialString(args.dst_format).c_str());
REPORT_INNER_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
REPORT_CALL_ERROR("E19999", "Failed to alloc the memory for dst buf %ld, "
"shape %s when trans format from %s to %s",
total_size, ShapeToString(args.dst_shape).c_str(),
TypeUtils::FormatToSerialString(args.src_format).c_str(),
@ -157,11 +157,12 @@ Status GetDstDataAfterTrans(const TransArgs &args, TransResult &result, const in
auto ret = memcpy_s(dst.get() + dst_offset, protected_size, args.data + src_offset, size);
if (ret != EOK) {
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,
"[Operate][Memory]Failed to copy data from NHWC[%ld, %ld, %ld, %ld] offset %ld to "
"NC1HWC0[%ld, %ld, %ld, %ld, %ld] offset %ld err-code %d",
"[Operate][Memory]Failed to copy data from NHWC[%ld, %ld, %ld, %ld] "
"offset %ld to NC1HWC0[%ld, %ld, %ld, %ld, %ld] offset %ld err-code %d",
n_idx, h_idx, w_idx, c_idx, src_offset,
n_idx, c1_idx, h_idx, w_idx, c0_idx, dst_offset, ret);
REPORT_CALL_ERROR("E19999", "Failed to copy data from NHWC[%ld, %ld, %ld, %ld] offset %ld to "
REPORT_CALL_ERROR("E19999", "Failed to copy data from NHWC[%ld, %ld, %ld, %ld] "
"offset %ld to "
"NC1HWC0[%ld, %ld, %ld, %ld, %ld] offset %ld err-code %d",
n_idx, h_idx, w_idx, c_idx, src_offset,
n_idx, c1_idx, h_idx, w_idx, c0_idx, dst_offset, ret);
@ -205,7 +206,7 @@ Status FormatTransferNhwcNc1hwc0::TransFormat(const TransArgs &args, TransResult
return SUCCESS;
}
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Get][Shape]Failed, "
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID, "[Get][ShapeSize]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());
REPORT_CALL_ERROR("E19999", "[Get][Shape]Failed, total size %ld from "

@ -181,7 +181,8 @@ Status Transpose(const uint8_t *src, const std::vector<int64_t> &src_shape, Data
dst_offset_bytes, ShapeToString(dst_indexes).c_str());
REPORT_CALL_ERROR("E19999", "Failed to transpose, src shape %s, perm arg %s, dst shape %s, "
"failed to write to dst offset %ld, current dim offset %s",
ShapeToString(src_shape).c_str(), ShapeToString(perm_arg).c_str(), ShapeToString(dst_shape).c_str(),
ShapeToString(src_shape).c_str(), ShapeToString(perm_arg).c_str(),
ShapeToString(dst_shape).c_str(),
dst_offset_bytes, ShapeToString(dst_indexes).c_str());
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED;
}

Loading…
Cancel
Save