From d977079212ab962c7baa2d8782ef1da9eacfdfe5 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 13 Sep 2022 15:22:51 +0800 Subject: [PATCH] feat(third_party): update cpuinfo GitOrigin-RevId: 67c7b8e8ccf764a101868ff446b49ee88c1bc6b1 --- dnn/test/arm_common/cpuinfo.cpp | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/dnn/test/arm_common/cpuinfo.cpp b/dnn/test/arm_common/cpuinfo.cpp index 415474195..f60a57c52 100644 --- a/dnn/test/arm_common/cpuinfo.cpp +++ b/dnn/test/arm_common/cpuinfo.cpp @@ -72,6 +72,8 @@ TEST(ARM_RUNTIME, CPUINFO_SDM8150) { ASSERT_TRUE(cpuinfo_has_arm_neon_dot()); + ASSERT_FALSE(cpuinfo_has_arm_i8mm()); + for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { ASSERT_EQ(cpuinfo_get_core(i), cpuinfo_get_processor(i)->core); } @@ -148,6 +150,74 @@ TEST(ARM_RUNTIME, CPUINFO_SDM660) { } } +TEST(ARM_RUNTIME, CPUINFO_TAISHAN) { + ASSERT_TRUE(cpuinfo_initialize()); + + bool right_soc = + cpuinfo_get_processors_count() == 96 && + cpuinfo_get_processor(0)->core->uarch == cpuinfo_uarch_taishan_v110; + if (right_soc) { + ASSERT_TRUE(cpuinfo_get_processors()); + + ASSERT_TRUE(cpuinfo_has_arm_neon()); + + ASSERT_TRUE(cpuinfo_has_arm_neon_fp16()); + + ASSERT_TRUE(cpuinfo_has_arm_neon_fma()); + + ASSERT_TRUE(cpuinfo_has_arm_neon_dot()); + + ASSERT_FALSE(cpuinfo_has_arm_i8mm()); + + for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { + ASSERT_EQ(cpuinfo_get_core(i), cpuinfo_get_processor(i)->core); + } + + for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { + ASSERT_EQ(cpuinfo_vendor_huawei, cpuinfo_get_core(i)->vendor); + } + + } else { + printf("detect soc: %s ,skip test.\n", cpuinfo_get_package(0)->name); + } +} + +TEST(ARM_RUNTIME, CPUINFO_SDM8GEN1) { + ASSERT_TRUE(cpuinfo_initialize()); + bool right_soc = + cpuinfo_get_processors_count() == 8 && + cpuinfo_get_processor(0)->core->uarch == cpuinfo_uarch_cortex_x2 && + cpuinfo_get_processor(1)->core->uarch == cpuinfo_uarch_cortex_a710 && + cpuinfo_get_processor(7)->core->uarch == cpuinfo_uarch_cortex_a510; + + if (right_soc) { + ASSERT_TRUE(cpuinfo_get_processors()); + + ASSERT_TRUE(cpuinfo_has_arm_neon()); + + ASSERT_TRUE(cpuinfo_has_arm_neon_fp16()); + + ASSERT_TRUE(cpuinfo_has_arm_neon_fma()); + + ASSERT_TRUE(cpuinfo_has_arm_neon_dot()); + + ASSERT_FALSE(cpuinfo_has_arm_sve2()); + + ASSERT_TRUE(cpuinfo_has_arm_i8mm()); + + for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { + ASSERT_EQ(cpuinfo_get_core(i), cpuinfo_get_processor(i)->core); + } + + for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { + ASSERT_EQ(cpuinfo_vendor_arm, cpuinfo_get_core(i)->vendor); + } + + } else { + printf("detect soc: %s ,skip test.\n", cpuinfo_get_package(0)->name); + } +} + } // namespace test } // namespace megdnn #endif -- GitLab