From 26bf43b8570e0d3001c9fbeeae00fa5b03ec6e94 Mon Sep 17 00:00:00 2001 From: nihuini Date: Fri, 2 Feb 2024 16:05:37 +0800 Subject: [PATCH] test vfpv4 --- tests/testutil.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/testutil.cpp b/tests/testutil.cpp index b453d1f61b42..f0bf3c51a20d 100644 --- a/tests/testutil.cpp +++ b/tests/testutil.cpp @@ -446,13 +446,13 @@ int test_layer_cpu(int typeindex, const ncnn::ParamDict& pd, const std::vectorsupport_fp16_storage && !(flag & TEST_LAYER_DISABLE_AUTO_INPUT_CASTING)) +#if NCNN_VFPV4 + if (opt.use_fp16_storage && ncnn::cpu_support_arm_vfpv4() && op->support_fp16_storage && !(flag & TEST_LAYER_DISABLE_AUTO_INPUT_CASTING)) { ncnn::cast_float32_to_float16(a[i], a4[i], opt); } else -#endif // NCNN_ARM82 +#endif // NCNN_VFPV4 #if NCNN_RVV if (opt.use_fp16_storage && ncnn::cpu_support_riscv_v() && ncnn::cpu_support_riscv_zfh() && op->support_fp16_storage && !(flag & TEST_LAYER_DISABLE_AUTO_INPUT_CASTING)) { @@ -571,15 +571,15 @@ int test_layer_cpu(int typeindex, const ncnn::ParamDict& pd, const std::vectorsupport_fp16_storage && c[i].elembits() == 16) +#if NCNN_VFPV4 + if (opt.use_fp16_storage && ncnn::cpu_support_arm_vfpv4() && op->support_fp16_storage && c[i].elembits() == 16) { ncnn::Mat c_fp32; ncnn::cast_float16_to_float32(c[i], c_fp32, opt); c[i] = c_fp32; } else -#endif // NCNN_ARM82 +#endif // NCNN_VFPV4 #if NCNN_RVV if (opt.use_fp16_storage && ncnn::cpu_support_riscv_v() && ncnn::cpu_support_riscv_zfh() && op->support_fp16_storage && c[i].elembits() == 16) { @@ -961,13 +961,13 @@ int test_layer_cpu(int typeindex, const ncnn::ParamDict& pd, const std::vectorsupport_fp16_storage && !(flag & TEST_LAYER_DISABLE_AUTO_INPUT_CASTING)) +#if NCNN_VFPV4 + if (opt.use_fp16_storage && ncnn::cpu_support_arm_vfpv4() && op->support_fp16_storage && !(flag & TEST_LAYER_DISABLE_AUTO_INPUT_CASTING)) { ncnn::cast_float32_to_float16(a, a4, opt); } else -#endif // NCNN_ARM82 +#endif // NCNN_VFPV4 #if NCNN_RVV if (opt.use_fp16_storage && ncnn::cpu_support_riscv_v() && ncnn::cpu_support_riscv_zfh() && op->support_fp16_storage && !(flag & TEST_LAYER_DISABLE_AUTO_INPUT_CASTING)) { @@ -1077,15 +1077,15 @@ int test_layer_cpu(int typeindex, const ncnn::ParamDict& pd, const std::vectorsupport_fp16_storage && c.elembits() == 16) +#if NCNN_VFPV4 + if (opt.use_fp16_storage && ncnn::cpu_support_arm_vfpv4() && op->support_fp16_storage && c.elembits() == 16) { ncnn::Mat c_fp32; ncnn::cast_float16_to_float32(c, c_fp32, opt); c = c_fp32; } else -#endif // NCNN_ARM82 +#endif // NCNN_VFPV4 #if NCNN_RVV if (opt.use_fp16_storage && ncnn::cpu_support_riscv_v() && ncnn::cpu_support_riscv_zfh() && op->support_fp16_storage && c.elembits() == 16) {