Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/target/parsers/mprofile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ const TargetFeatures kHasDSP = {{"has_dsp", Bool(true)}, {"has_mve", Bool(false)
const TargetFeatures kHasMVE = {{"has_dsp", Bool(true)}, {"has_mve", Bool(true)}};

static const char* baseCPUs[] = {"cortex-m0", "cortex-m3"};
static const char* dspCPUs[] = {"cortex-m55", "cortex-m4", "cortex-m7", "cortex-m33",
"cortex-m35p"};
static const char* mveCPUs[] = {"cortex-m55"};
static const char* dspCPUs[] = {"cortex-m55", "cortex-m4", "cortex-m7",
"cortex-m33", "cortex-m35p", "cortex-m85"};
static const char* mveCPUs[] = {"cortex-m55", "cortex-m85"};

template <typename Container>
static inline bool MatchesCpu(Optional<String> mcpu, const Container& cpus) {
Expand Down
16 changes: 14 additions & 2 deletions tests/cpp/relay/backend/contrib/cmsisnn/compiler_attrs_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,30 @@ TEST(CMSISNNTarget, CreateFromUndefined) {
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(false));
}

TEST(CMSISNNTarget, CreateFromContext) {
TEST(CMSISNNTarget, CreateFromContextCortexM55) {
Target target = GetTargetWithCompilerAttrs("cortex-m55", "");
ASSERT_EQ(target->GetFeature<Bool>("has_mve").value_or(Bool(false)), Bool(true));
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(true));
}

TEST(CMSISNNTarget, CreateFromContextWithAttrs) {
TEST(CMSISNNTarget, CreateFromContextWithAttrsCortexM55) {
Target target = GetTargetWithCompilerAttrs("cortex-m55", "+nomve");
ASSERT_EQ(target->GetFeature<Bool>("has_mve").value_or(Bool(false)), Bool(false));
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(true));
}

TEST(CMSISNNTarget, CreateFromContextCortexM85) {
Target target = GetTargetWithCompilerAttrs("cortex-m85", "");
ASSERT_EQ(target->GetFeature<Bool>("has_mve").value_or(Bool(false)), Bool(true));
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(true));
}

TEST(CMSISNNTarget, CreateFromContextWithAttrsCortexM85) {
Target target = GetTargetWithCompilerAttrs("cortex-m85", "+nomve");
ASSERT_EQ(target->GetFeature<Bool>("has_mve").value_or(Bool(false)), Bool(false));
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(true));
}

} // namespace cmsisnn
} // namespace contrib
} // namespace relay
Expand Down