|
|
|
@@ -30,7 +30,6 @@ namespace ge { |
|
|
|
namespace formats { |
|
|
|
namespace { |
|
|
|
constexpr int64_t kCubeN = 16; |
|
|
|
constexpr int64_t kGroupNum = 1; |
|
|
|
constexpr int64_t kDim = 1; |
|
|
|
|
|
|
|
static int64_t Measure(int64_t x, int64_t y) { |
|
|
|
@@ -42,7 +41,6 @@ static int64_t Measure(int64_t x, int64_t y) { |
|
|
|
} |
|
|
|
return z; |
|
|
|
} |
|
|
|
|
|
|
|
// least common multiple |
|
|
|
static int64_t Lcm(int64_t a, int64_t b) { |
|
|
|
if (b == 0) { |
|
|
|
@@ -51,7 +49,6 @@ static int64_t Lcm(int64_t a, int64_t b) { |
|
|
|
int64_t temp = (a * b) / (Measure(a, b)); |
|
|
|
return temp; |
|
|
|
} |
|
|
|
|
|
|
|
// get the result of two number divisor and let result round up |
|
|
|
static int64_t DivCeil(int64_t a, int64_t b) { |
|
|
|
if (b == 0) { |
|
|
|
@@ -294,6 +291,7 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, |
|
|
|
g_dim * kDim * dim_cin * h_dim * w_dim * cout_opt * cube_k * data_size; |
|
|
|
GE_CHK_BOOL_EXEC_NOLOG(size_output_data != 0, result.length = static_cast<size_t>(size_output_data); |
|
|
|
return SUCCESS;); |
|
|
|
errno_t ret = EOK; |
|
|
|
std::shared_ptr<uint8_t> dst(new (std::nothrow) uint8_t[size_output_data], std::default_delete<uint8_t[]>()); |
|
|
|
GE_CHK_BOOL_TRUE_EXEC_WITH_LOG( |
|
|
|
dst == nullptr, |
|
|
|
@@ -301,6 +299,12 @@ Status TransFormatHwcnToFzWithGroups(const TransArgs &args, TransResult &result, |
|
|
|
TypeUtils::FormatToSerialString(args.src_format).c_str(), |
|
|
|
TypeUtils::FormatToSerialString(args.dst_format).c_str(), size_output_data); |
|
|
|
return ACL_ERROR_GE_MEMORY_ALLOCATION;); |
|
|
|
auto ret = memset_s(dst.get(), size_output_data, 0, size_output_data); |
|
|
|
if (ret != EOK) { |
|
|
|
GELOGE(ACL_ERROR_GE_MEMORY_OPERATE_FAILED, "Failed to operate the dst memory , error-code %d, ret %d", |
|
|
|
ret); |
|
|
|
return ACL_ERROR_GE_MEMORY_OPERATE_FAILED; |
|
|
|
} |
|
|
|
for (int64_t g = 0; g < groups; g++) { |
|
|
|
for (int64_t d = 0; d < kDim; d++) { |
|
|
|
for (int64_t c = 0; c < c_dim; c++) { |
|
|
|
|