Skip to content

Commit a4156cd

Browse files
[CMSIS-NN] Add Cortex-M85 support (#13644)
Added Cortex-M85 to the list of mprofiles maintained for correct flag mappings: MVE and DSP.
1 parent 5019dce commit a4156cd

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/target/parsers/mprofile.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ const TargetFeatures kHasDSP = {{"has_dsp", Bool(true)}, {"has_mve", Bool(false)
3636
const TargetFeatures kHasMVE = {{"has_dsp", Bool(true)}, {"has_mve", Bool(true)}};
3737

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

4343
template <typename Container>
4444
static inline bool MatchesCpu(Optional<String> mcpu, const Container& cpus) {

tests/cpp/relay/backend/contrib/cmsisnn/compiler_attrs_test.cc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,30 @@ TEST(CMSISNNTarget, CreateFromUndefined) {
5353
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(false));
5454
}
5555

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

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

68+
TEST(CMSISNNTarget, CreateFromContextCortexM85) {
69+
Target target = GetTargetWithCompilerAttrs("cortex-m85", "");
70+
ASSERT_EQ(target->GetFeature<Bool>("has_mve").value_or(Bool(false)), Bool(true));
71+
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(true));
72+
}
73+
74+
TEST(CMSISNNTarget, CreateFromContextWithAttrsCortexM85) {
75+
Target target = GetTargetWithCompilerAttrs("cortex-m85", "+nomve");
76+
ASSERT_EQ(target->GetFeature<Bool>("has_mve").value_or(Bool(false)), Bool(false));
77+
ASSERT_EQ(target->GetFeature<Bool>("has_dsp").value_or(Bool(false)), Bool(true));
78+
}
79+
6880
} // namespace cmsisnn
6981
} // namespace contrib
7082
} // namespace relay

0 commit comments

Comments
 (0)