Browse Source

add nc1hwc0_c04 format

tags/v0.2.0-alpha
jjfeing 5 years ago
parent
commit
f9ef78609f
2 changed files with 5 additions and 3 deletions
  1. +4
    -3
      mindspore/ccsrc/device/ascend/kernel_select_ascend.cc
  2. +1
    -0
      mindspore/ccsrc/utils/utils.h

+ 4
- 3
mindspore/ccsrc/device/ascend/kernel_select_ascend.cc View File

@@ -45,9 +45,10 @@ enum MatchCountPriority : int {
const size_t kMaxCount = 0xffffffff;
const int kUnSupportMixedDataTypeIndex = -1;

const std::set<std::string> 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<std::string> 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<size_t> &shape, const std::string &format) {
// if format is default, it remarkes support all format


+ 1
- 0
mindspore/ccsrc/utils/utils.h View File

@@ -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<std::string> k1DSupportFormat = {kOpFormat_DEFAULT, kOpFormat_NCHW, kOpFormat_NHWC,
kOpFormat_FRAC_Z, kOpFormat_NC1KHKWHWC0, kOpFormat_NC1HWC0};
const std::set<std::string> k2DSupportFormat = {kOpFormat_DEFAULT, kOpFormat_NCHW, kOpFormat_NHWC, kOpFormat_FRAC_Z,


Loading…
Cancel
Save