|
|
|
@ -88,8 +88,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap
|
|
|
|
|
hw_shape.push_back(src_shape[kNdDimIndexN]);
|
|
|
|
|
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());
|
|
|
|
|
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 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 - kNdDimCountBackwardsW]);
|
|
|
|
|
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 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);
|
|
|
|
|
if (ret != SUCCESS) {
|
|
|
|
|
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(),
|
|
|
|
|
ShapeToString(args.src_shape).c_str(), TypeUtils::DataTypeToSerialString(args.src_data_type).c_str(), 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(),
|
|
|
|
|
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",
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -184,7 +184,7 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con
|
|
|
|
|
if (ret != EOK) {
|
|
|
|
|
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED,"[Operate][DSTMemory]Failed at offset %ld, error-code %d",
|
|
|
|
|
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);
|
|
|
|
|
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,
|
|
|
|
|
static_cast<size_t>(size));
|
|
|
|
|
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);
|
|
|
|
|
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);
|
|
|
|
|
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.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",
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -265,7 +265,7 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con
|
|
|
|
|
if (ret != EOK) {
|
|
|
|
|
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "[Operate][DSTMemory]Failed 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);
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -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,
|
|
|
|
|
static_cast<size_t>(size));
|
|
|
|
|
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);
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -297,13 +297,13 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult &
|
|
|
|
|
if (!IsDataTypeSupport(args.src_data_type)) {
|
|
|
|
|
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", 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());
|
|
|
|
|
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(),
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
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());
|
|
|
|
|
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(),
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
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)) {
|
|
|
|
|
GELOGE(ACL_ERROR_GE_DATATYPE_INVALID,
|
|
|
|
|
"[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, "
|
|
|
|
|
"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;
|
|
|
|
|
}
|
|
|
|
|
if (!CheckShape(src_format, src_shape)) {
|
|
|
|
|
GELOGE(ACL_ERROR_GE_SHAPE_INVALID,
|
|
|
|
|
"[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",
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
ShapeVector hw_shape;
|
|
|
|
@ -365,28 +365,28 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult
|
|
|
|
|
if (!IsDataTypeSupport(args.src_data_type)) {
|
|
|
|
|
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",
|
|
|
|
|
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, "
|
|
|
|
|
"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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!IsShapeValid(args.src_shape) || !CheckShape(args.dst_format, args.dst_shape)) {
|
|
|
|
|
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",
|
|
|
|
|
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, "
|
|
|
|
|
"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;
|
|
|
|
|
}
|
|
|
|
|
GELOGD("Begin to trans format from %s to %s, src shape %s, dst shape %s, data type %s",
|
|
|
|
|