@ -87,7 +87,8 @@ Status TransShapeToFracNz(const ShapeVector &src_shape, DataType data_type, Shap
hw_shape . push_back ( DIM_DEFAULT_VALUE ) ;
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 ( ) ) ;
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 ;
}
@ -107,7 +108,8 @@ 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 ( ) ) ;
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 ;
}
@ -119,8 +121,8 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) {
ShapeVector expect_src_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 ( ) ,
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 ( ) ,
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 ;
@ -141,8 +143,8 @@ Status TransFormatFromNdToFracNz(const TransArgs &args, TransResult &result, con
std : : shared_ptr < uint8_t > dst ( new ( std : : nothrow ) uint8_t [ dst_size ] ( ) , std : : default_delete < uint8_t [ ] > ( ) ) ;
if ( dst = = nullptr ) {
GELOGE ( ACL_ERROR_GE_MEMORY_ALLOCATION , " [Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld " ,
TypeUtils : : FormatToSerialString ( args . src_format ) . c_str ( ) ,
GELOGE ( ACL_ERROR_GE_MEMORY_ALLOCATION , " [Allocate][DSTMemory]Failed to trans format from %s to %s, "
" 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 ( ) ,
@ -180,8 +182,10 @@ 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 * w0 ) ) ;
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 ) ;
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 ) ;
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED ;
}
}
@ -195,8 +199,10 @@ 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 " , dst_offset , ret ) ;
REPORT_CALL_ERROR ( " E19999 " , " Failed to operate dst memory at offset %ld, error-code %d " , dst_offset , ret ) ;
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 ) ;
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED ;
}
}
@ -217,7 +223,8 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con
std : : shared_ptr < uint8_t > dst ( new ( std : : nothrow ) uint8_t [ dst_size ] , std : : default_delete < uint8_t [ ] > ( ) ) ;
if ( dst = = nullptr ) {
GELOGE ( ACL_ERROR_GE_MEMORY_ALLOCATION , " [Allocate][DSTMemory]Failed to trans format from %s to %s, memory for dst buf %ld " ,
GELOGE ( ACL_ERROR_GE_MEMORY_ALLOCATION , " [Allocate][DSTMemory]Failed to trans format from %s to %s, "
" 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 " ,
@ -256,7 +263,8 @@ 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 * w0 ) ) ;
if ( ret ! = EOK ) {
GELOGE ( ACL_ERROR_GE_MEMORY_OPERATE_FAILED , " [Operate][DSTMemory]Failed at offset %ld, error-code %d " , dst_offset , ret ) ;
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 ) ;
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED ;
}
@ -271,7 +279,8 @@ 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 " , dst_offset , ret ) ;
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 ) ;
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED ;
}
@ -287,12 +296,12 @@ Status TransFormatFromFracNzToNd(const TransArgs &args, TransResult &result, con
Status FormatTransferFractalNz : : TransFormat ( const TransArgs & args , TransResult & result ) {
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 ( ) ,
" [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 ( ) ) ;
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 ( ) ,
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 ( ) ) ;
return ACL_ERROR_GE_DATATYPE_INVALID ;
@ -303,8 +312,8 @@ Status FormatTransferFractalNz::TransFormat(const TransArgs &args, TransResult &
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 ( ) ,
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 ( ) ) ;
return ACL_ERROR_GE_SHAPE_INVALID ;
@ -332,7 +341,8 @@ Status FormatTransferFractalNz::TransShape(Format src_format, const ShapeVector
" [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 ( ) ) ;
REPORT_INNER_ERROR ( " E19999 " , " Check datatype failed, trans format from %s to %s, src shape %s, data type %s is not supported " ,
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 ( ) ) ;
return ACL_ERROR_GE_DATATYPE_INVALID ;
@ -358,7 +368,8 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult
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 " ,
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 ( ) ) ;
@ -371,7 +382,8 @@ Status FormatTransferFractalNzND::TransFormat(const TransArgs &args, TransResult
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 " ,
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 ( ) ) ;