| |
| |
| |
| |
|
|
| #include <algorithm> |
| #include <cmath> |
| #include <cstring> |
| #include <functional> |
| #include <memory> |
| #include <random> |
| #include <vector> |
|
|
| #include "bench/end2end.h" |
| #include "bench/utils.h" |
| #include <benchmark/benchmark.h> |
|
|
| #include <xnnpack.h> |
| #include <xnnpack/config.h> |
| #include <xnnpack/dwconv.h> |
| #include <xnnpack/microfnptr.h> |
| #include <xnnpack/microparams-init.h> |
| #include <xnnpack/models.h> |
|
|
|
|
| static void DWConvEnd2EndBenchmark( |
| benchmark::State& state, |
| models::ExecutionPlanFactory model_factory, |
| xnn_f16_dwconv_minmax_unipass_ukernel_fn dwconv_minmax, |
| xnn_init_f16_minmax_params_fn init_params, |
| uint8_t channel_tile, uint8_t primary_tile, |
| benchmark::utils::IsaCheckFunction isa_check = nullptr) |
| { |
| if (isa_check != nullptr && !isa_check(state)) { |
| return; |
| } |
| if (xnn_initialize(nullptr ) != xnn_status_success) { |
| state.SkipWithError("failed to initialize XNNPACK"); |
| return; |
| } |
|
|
| struct xnn_dwconv_config* dwconv_config = xnn_init_f16_dwconv_config(); |
| if (dwconv_config == nullptr) { |
| state.SkipWithError("hardware does not support F16 DWCONV"); |
| return; |
| } |
|
|
| |
| struct xnn_dwconv_config saved_dwconv_params[XNN_MAX_F16_DWCONV_UKERNELS]; |
| memcpy(saved_dwconv_params, dwconv_config, sizeof(saved_dwconv_params)); |
|
|
| |
| for (size_t i = 0; i < XNN_MAX_F16_DWCONV_UKERNELS; i++) { |
| |
| if (dwconv_config[i].primary_tile == primary_tile) { |
| std::memset(&dwconv_config[i], 0, sizeof(dwconv_config[i])); |
|
|
| |
| dwconv_config[i].minmax.unipass = xnn_dwconv_unipass_ukernel_fn(dwconv_minmax); |
| dwconv_config[i].channel_tile = channel_tile; |
| dwconv_config[i].channel_subtile = channel_tile; |
| dwconv_config[i].channel_round = 1; |
| dwconv_config[i].primary_tile = primary_tile; |
| dwconv_config[i].init.f16 = init_params; |
| break; |
| } |
| } |
|
|
| auto execution_plan = model_factory(nullptr); |
| if (execution_plan.empty()) { |
| state.SkipWithError("failed to create a model"); |
| return; |
| } |
|
|
| for (auto _ : state) { |
| for (const std::unique_ptr<xnn_operator, decltype(&xnn_delete_operator)>& op : execution_plan) { |
| xnn_status status = xnn_run_operator(op.get(), nullptr); |
| if (status != xnn_status_success) { |
| state.SkipWithError("failed to run a model"); |
| return; |
| } |
| } |
| } |
|
|
| const uint64_t cpu_frequency = benchmark::utils::GetCurrentCpuFrequency(); |
| if (cpu_frequency != 0) { |
| state.counters["cpufreq"] = cpu_frequency; |
| } |
|
|
| |
| memcpy(dwconv_config, saved_dwconv_params, sizeof(saved_dwconv_params)); |
| } |
|
|
| static void DWConvEnd2EndBenchmark( |
| benchmark::State& state, |
| models::ExecutionPlanFactory model_factory, |
| xnn_f16_dwconv_minmax_multipass_ukernel_fn dwconv_minmax, |
| xnn_init_f16_minmax_params_fn init_params, |
| uint8_t channel_tile, uint8_t channel_subtile, uint8_t channel_round, |
| uint8_t primary_tile, uint8_t middle_tile, uint8_t last_tile, |
| uint8_t primary_tile_to_replace, |
| benchmark::utils::IsaCheckFunction isa_check = nullptr) |
| { |
| if (isa_check != nullptr && !isa_check(state)) { |
| return; |
| } |
|
|
| struct xnn_dwconv_config* dwconv_config = xnn_init_f16_dwconv_config(); |
| if (dwconv_config == nullptr) { |
| state.SkipWithError("failed to initialize f16 DWCONV config"); |
| return; |
| } |
|
|
| |
| struct xnn_dwconv_config saved_dwconv_params[XNN_MAX_F16_DWCONV_UKERNELS]; |
| memcpy(saved_dwconv_params, dwconv_config, sizeof(saved_dwconv_params)); |
|
|
| bool found = false; |
| for (size_t i = 0; i < XNN_MAX_F16_DWCONV_UKERNELS; i++) { |
| if (dwconv_config[i].primary_tile == primary_tile_to_replace) { |
| found = true; |
| } else if (dwconv_config[i].last_tile != 0) { |
| |
| found = true; |
| } |
| } |
|
|
| if (!found) { |
| state.SkipWithError("can't replace with multipass"); |
| return; |
| } |
|
|
| |
| for (size_t i = 0; i < XNN_MAX_F16_DWCONV_UKERNELS; i++) { |
| |
| if (dwconv_config[i].primary_tile == primary_tile_to_replace || |
| dwconv_config[i].last_tile != 0) { |
| |
| |
| |
| std::memset(&dwconv_config[i], 0, sizeof(dwconv_config[i])); |
|
|
| |
| dwconv_config[i].minmax.multipass = xnn_dwconv_multipass_ukernel_fn(dwconv_minmax); |
| dwconv_config[i].channel_tile = channel_tile; |
| dwconv_config[i].channel_subtile = channel_subtile; |
| dwconv_config[i].channel_round = channel_round; |
| dwconv_config[i].primary_tile = primary_tile; |
| dwconv_config[i].middle_tile = middle_tile; |
| dwconv_config[i].last_tile = last_tile; |
| dwconv_config[i].init.f16 = init_params; |
| break; |
| } |
| } |
|
|
| auto execution_plan = model_factory(nullptr); |
| if (execution_plan.empty()) { |
| state.SkipWithError("failed to create a model"); |
| return; |
| } |
|
|
| for (auto _ : state) { |
| for (const std::unique_ptr<xnn_operator, decltype(&xnn_delete_operator)>& op : execution_plan) { |
| xnn_status status = xnn_run_operator(op.get(), nullptr); |
| if (status != xnn_status_success) { |
| state.SkipWithError("failed to run a model"); |
| return; |
| } |
| } |
| } |
|
|
| const uint64_t cpu_frequency = benchmark::utils::GetCurrentCpuFrequency(); |
| if (cpu_frequency != 0) { |
| state.counters["cpufreq"] = cpu_frequency; |
| } |
|
|
| memcpy(dwconv_config, saved_dwconv_params, sizeof(saved_dwconv_params)); |
| } |
|
|
| #if XNN_ENABLE_ARM_FP16_VECTOR && (XNN_ARCH_ARM || XNN_ARCH_ARM64) |
| static void f16_dwconv_4p8c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_4p8c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 8, 4, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_4p8c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_4p8c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 8, 4, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_4p16c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_4p16c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 16, 4, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_4p16c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_4p16c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 16, 4, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_4p32c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_4p32c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 32, 4, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_4p32c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_4p32c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 32, 4, benchmark::utils::CheckNEONFP16ARITH); |
| } |
|
|
| static void f16_dwconv_9p8c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_9p8c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 8, 9, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_9p8c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_9p8c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 8, 9, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_9p16c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_9p16c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 16, 9, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_9p16c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_9p16c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 16, 9, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_9p32c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_9p32c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 32, 9, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_9p32c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_9p32c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 32, 9, benchmark::utils::CheckNEONFP16ARITH); |
| } |
|
|
| static void f16_dwconv_25p8c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p8c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 8, 25, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_25p8c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p8c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 8, 25, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_25p16c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p16c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 16, 25, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_25p16c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p16c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 16, 25, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_25p32c__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p32c__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 32, 25, benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_25p32c__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p32c__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 32, 25, benchmark::utils::CheckNEONFP16ARITH); |
| } |
|
|
| static void f16_dwconv_5f5m5l8c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l8c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 8, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_5f5m5l8c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l8c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 8, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_5f5m5l16c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l16c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 16, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_5f5m5l16c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l16c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 16, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_5f5m5l32c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l32c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 32, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_5f5m5l32c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l32c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 32, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
|
|
| static void f16_dwconv_6f6m7l8c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l8c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 8, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_6f6m7l8c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l8c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 8, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_6f6m7l16c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l16c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 16, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_6f6m7l16c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l16c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 16, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_6f6m7l32c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l32c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 32, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_6f6m7l32c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l32c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 32, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
|
|
| static void f16_dwconv_8f8m9l8c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l8c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 8, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_8f8m9l8c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l8c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 8, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_8f8m9l16c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l16c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 16, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_8f8m9l16c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l16c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 16, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_8f8m9l32c8s4r__neonfp16arith(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l32c8s4r__neonfp16arith, xnn_init_f16_minmax_fp16arith_params, |
| 32, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
| static void f16_dwconv_8f8m9l32c8s4r__neonfp16arith_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l32c8s4r__neonfp16arith_acc2, xnn_init_f16_minmax_fp16arith_params, |
| 32, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckNEONFP16ARITH); |
| } |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_4p8c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_4p8c__neonfp16arith_acc2); |
| BENCHMARK_FP16_END2END(f16_dwconv_4p16c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_4p16c__neonfp16arith_acc2); |
| BENCHMARK_FP16_END2END(f16_dwconv_4p32c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_4p32c__neonfp16arith_acc2); |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_9p8c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_9p8c__neonfp16arith_acc2); |
| BENCHMARK_FP16_END2END(f16_dwconv_9p16c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_9p16c__neonfp16arith_acc2); |
| BENCHMARK_FP16_END2END(f16_dwconv_9p32c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_9p32c__neonfp16arith_acc2); |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_25p8c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_25p8c__neonfp16arith_acc2); |
| BENCHMARK_FP16_END2END(f16_dwconv_25p16c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_25p16c__neonfp16arith_acc2); |
| BENCHMARK_FP16_END2END(f16_dwconv_25p32c__neonfp16arith); |
| BENCHMARK_FP16_END2END(f16_dwconv_25p32c__neonfp16arith_acc2); |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l8c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l8c8s4r__neonfp16arith_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l16c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l16c8s4r__neonfp16arith_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l32c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l32c8s4r__neonfp16arith_acc2) |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l8c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l8c8s4r__neonfp16arith_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l16c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l16c8s4r__neonfp16arith_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l32c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l32c8s4r__neonfp16arith_acc2) |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l8c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l8c8s4r__neonfp16arith_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l16c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l16c8s4r__neonfp16arith_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l32c8s4r__neonfp16arith) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l32c8s4r__neonfp16arith_acc2) |
|
|
| #endif |
|
|
| #if XNN_ARCH_X86 || XNN_ARCH_X86_64 |
| static void f16_dwconv_25p8c__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p8c__fma3, xnn_init_f16_minmax_avx_params, |
| 8, 25, benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_25p8c__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p8c__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 8, 25, benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_25p16c__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p16c__fma3, xnn_init_f16_minmax_avx_params, |
| 16, 25, benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_25p16c__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p16c__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 16, 25, benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_25p32c__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p32c__fma3, xnn_init_f16_minmax_avx_params, |
| 32, 25, benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_25p32c__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_25p32c__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 32, 25, benchmark::utils::CheckFMA3); |
| } |
|
|
| static void f16_dwconv_5f5m5l8c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l8c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 8, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_5f5m5l8c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l8c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 8, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_5f5m5l16c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l16c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 16, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_5f5m5l16c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l16c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 16, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_5f5m5l32c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l32c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 32, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_5f5m5l32c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_5f5m5l32c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 32, 8, 4, |
| 5, 5, 5, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
|
|
| static void f16_dwconv_6f6m7l8c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l8c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 8, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_6f6m7l8c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l8c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 8, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_6f6m7l16c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l16c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 16, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_6f6m7l16c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l16c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 16, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_6f6m7l32c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l32c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 32, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_6f6m7l32c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_6f6m7l32c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 32, 8, 4, |
| 6, 6, 7, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
|
|
| static void f16_dwconv_8f8m9l8c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l8c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 8, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_8f8m9l8c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l8c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 8, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_8f8m9l16c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l16c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 16, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_8f8m9l16c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l16c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 16, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_8f8m9l32c8s4r__fma3(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l32c8s4r__fma3, xnn_init_f16_minmax_avx_params, |
| 32, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
| static void f16_dwconv_8f8m9l32c8s4r__fma3_acc2(benchmark::State& state, models::ExecutionPlanFactory model) { |
| DWConvEnd2EndBenchmark( |
| state, model, |
| xnn_f16_dwconv_minmax_ukernel_8f8m9l32c8s4r__fma3_acc2, xnn_init_f16_minmax_avx_params, |
| 32, 8, 4, |
| 8, 8, 9, |
| 25, |
| benchmark::utils::CheckFMA3); |
| } |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_25p8c__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_25p8c__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_25p16c__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_25p16c__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_25p32c__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_25p32c__fma3_acc2) |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l8c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l8c8s4r__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l16c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l16c8s4r__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l32c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_5f5m5l32c8s4r__fma3_acc2) |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l8c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l8c8s4r__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l16c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l16c8s4r__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l32c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_6f6m7l32c8s4r__fma3_acc2) |
|
|
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l8c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l8c8s4r__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l16c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l16c8s4r__fma3_acc2) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l32c8s4r__fma3) |
| BENCHMARK_FP16_END2END(f16_dwconv_8f8m9l32c8s4r__fma3_acc2) |
|
|
| #endif |
|
|
| #ifndef XNNPACK_BENCHMARK_NO_MAIN |
| BENCHMARK_MAIN(); |
| #endif |
|
|