@ -87,7 +87,7 @@ Status TransShapeToFracZz(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_ INNER _ERROR( " E19999 " , " Failed to check 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 ;
@ -107,7 +107,7 @@ Status TransShapeToFracZz(const ShapeVector &src_shape, DataType data_type, Shap
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_ INNER _ERROR( " E19999 " , " Failed to check 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 ;
@ -118,11 +118,11 @@ Status CheckShapeRelation(const TransArgs &args, ShapeVector &hw_shape) {
ShapeVector expect_src_shape ;
auto ret = TransShapeToFracZz ( args . dst_shape , args . src_data_type , expect_src_shape , hw_shape ) ;
if ( ret ! = SUCCESS ) {
GELOGE ( ret , " [Trans fer ][ShapeToFracZz] Failed from %s to %s, shape %s to %s, data type %s" ,
GELOGE ( ret , " [Trans ][ShapeToFracZz] Failed 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 ( ) ) ;
REPORT_ INNER_ERROR( ret , " Failed to trans fer 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 ( ) ) ;
@ -144,13 +144,10 @@ Status TransFormatFromNdToFracZz(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 ( ) ,
TypeUtils : : FormatToSerialString ( args . dst_format ) . c_str ( ) , dst_size ) ;
REPORT_INNER_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 ) ;
return ACL_ERROR_GE_MEMORY_ALLOCATION ;
GELOGE ( ACL_ERROR_GE_MEMORY_ALLOCATION , " [Allocate][DSTMemory]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 ( ) ) ;
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 ( ) ) ; 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
auto times = hw_shape . at ( kNdDimIndexN ) ;
@ -187,7 +184,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con
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_ INNER _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 ;
}
}
@ -204,7 +201,7 @@ Status TransFormatFromNdToFracZz(const TransArgs &args, TransResult &result, con
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_ INNER _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 ;
}
}
@ -226,13 +223,10 @@ Status TransFormatFromFracZzToNd(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 ( ) ,
TypeUtils : : FormatToSerialString ( args . dst_format ) . c_str ( ) , dst_size ) ;
REPORT_INNER_ERROR ( " E19999 " , " Failed to trans format from %s to %s and allcoate memory for dst buf %ld " ,
TypeUtils : : FormatToSerialString ( args . src_format ) . c_str ( ) ,
TypeUtils : : FormatToSerialString ( args . dst_format ) . c_str ( ) , dst_size ) ;
return ACL_ERROR_GE_MEMORY_ALLOCATION ;
GELOGE ( ACL_ERROR_GE_MEMORY_ALLOCATION , " [Allocate][DSTMemory]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 ( ) ) ;
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 ( ) ) ; 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
@ -270,7 +264,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con
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_ INNER _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 ;
}
}
@ -287,7 +281,7 @@ Status TransFormatFromFracZzToNd(const TransArgs &args, TransResult &result, con
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_ INNER _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 ;
}
}
@ -306,11 +300,7 @@ 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 " ,
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, 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 ( ) ) ;
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 ) ) {
@ -318,11 +308,7 @@ 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 " ,
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, 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 ( ) ) ;
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 " ,
@ -347,10 +333,7 @@ Status FormatTransferFractalZz::TransShape(Format src_format, const ShapeVector
GELOGE ( ACL_ERROR_GE_DATATYPE_INVALID ,
" [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 ( ) ) ;
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 ( ) ) ;
ShapeToString ( src_shape ) . c_str ( ) , TypeUtils : : DataTypeToSerialString ( data_type ) . c_str ( ) ) ;
return ACL_ERROR_GE_DATATYPE_INVALID ;
}
if ( ! CheckShape ( src_format , src_shape ) ) {
@ -358,9 +341,6 @@ 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 " ,
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, 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 ;
}
ShapeVector hw_shape ;
@ -373,11 +353,7 @@ 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 " ,
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, 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 ( ) ) ;
ShapeToString ( args . dst_shape ) . c_str ( ) , TypeUtils : : DataTypeToSerialString ( args . src_data_type ) . c_str ( ) ) ;
return ACL_ERROR_GE_DATATYPE_INVALID ;
}
@ -386,7 +362,7 @@ Status FormatTransferFractalZzND::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, not support trans format from %s to %s, src shape %s, dst shape %s, data type %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 ( ) ,
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 ( ) ) ;