From f9ef78609f67569c203290eefd5dbe2f543945e5 Mon Sep 17 00:00:00 2001 From: jjfeing Date: Fri, 17 Apr 2020 11:37:35 +0800 Subject: [PATCH] add nc1hwc0_c04 format --- mindspore/ccsrc/device/ascend/kernel_select_ascend.cc | 7 ++++--- mindspore/ccsrc/utils/utils.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/device/ascend/kernel_select_ascend.cc b/mindspore/ccsrc/device/ascend/kernel_select_ascend.cc index dafe95834..f02e67716 100644 --- a/mindspore/ccsrc/device/ascend/kernel_select_ascend.cc +++ b/mindspore/ccsrc/device/ascend/kernel_select_ascend.cc @@ -45,9 +45,10 @@ enum MatchCountPriority : int { const size_t kMaxCount = 0xffffffff; const int kUnSupportMixedDataTypeIndex = -1; -const std::set kOpFormatList = { - kOpFormat_DEFAULT, kOpFormat_NC1KHKWHWC0, kOpFormat_ND, kOpFormat_NCHW, kOpFormat_NHWC, - kOpFormat_HWCN, kOpFormat_NC1HWC0, kOpFormat_FRAC_Z, kOpFormat_C1HWNCoC0, kOpFormat_FRAC_NZ}; +const std::set kOpFormatList = {kOpFormat_DEFAULT, kOpFormat_NC1KHKWHWC0, kOpFormat_ND, + kOpFormat_NCHW, kOpFormat_NHWC, kOpFormat_HWCN, + kOpFormat_NC1HWC0, kOpFormat_FRAC_Z, kOpFormat_C1HWNCoC0, + kOpFormat_FRAC_NZ, kOpFormat_NC1HWC0_C04}; bool IsShapeMatchFormat(const std::vector &shape, const std::string &format) { // if format is default, it remarkes support all format diff --git a/mindspore/ccsrc/utils/utils.h b/mindspore/ccsrc/utils/utils.h index e346a9e90..4661deed3 100644 --- a/mindspore/ccsrc/utils/utils.h +++ b/mindspore/ccsrc/utils/utils.h @@ -183,6 +183,7 @@ constexpr auto kOpFormat_NC1HWC0 = "NC1HWC0"; constexpr auto kOpFormat_FRAC_Z = "FracZ"; constexpr auto kOpFormat_FRAC_NZ = "FRACTAL_NZ"; constexpr auto kOpFormat_C1HWNCoC0 = "C1HWNCoC0"; +constexpr auto kOpFormat_NC1HWC0_C04 = "NC1HWC0_C04"; const std::set k1DSupportFormat = {kOpFormat_DEFAULT, kOpFormat_NCHW, kOpFormat_NHWC, kOpFormat_FRAC_Z, kOpFormat_NC1KHKWHWC0, kOpFormat_NC1HWC0}; const std::set k2DSupportFormat = {kOpFormat_DEFAULT, kOpFormat_NCHW, kOpFormat_NHWC, kOpFormat_FRAC_Z, -- GitLab