blob: bbfeedcc421d5358cf03ffe53659258a8d20089e [file] [log] [blame]
XNNPACK Teamb455b122019-09-27 18:10:33 -07001// Copyright 2019 Google LLC
2//
3// This source code is licensed under the BSD-style license found in the
4// LICENSE file in the root directory of this source tree.
5
6#include <algorithm>
7#include <cfloat>
8#include <cmath>
9#include <functional>
10#include <random>
11#include <vector>
12
XNNPACK Teamb455b122019-09-27 18:10:33 -070013#include <benchmark/benchmark.h>
14#include "bench/conv.h"
15#include "bench/utils.h"
16#include <xnnpack/AlignedAllocator.h>
Marat Dukhan1dadbf72019-10-01 10:46:20 -070017#include <xnnpack/common.h>
XNNPACK Teamb455b122019-09-27 18:10:33 -070018#include <xnnpack/igemm.h>
19#include <xnnpack/indirection.h>
20#include <xnnpack/operator.h>
21#include <xnnpack/pack.h>
Marat Dukhaneeaa7bd2019-10-25 17:31:25 -070022#include <xnnpack/params-init.h>
XNNPACK Teamb455b122019-09-27 18:10:33 -070023#include <xnnpack/params.h>
XNNPACK Teamb455b122019-09-27 18:10:33 -070024
25
26static void IGEMMBenchmark(benchmark::State& state,
Marat Dukhande06f492020-04-09 00:19:31 -070027 xnn_f32_igemm_minmax_ukernel_function f32_igemm,
Marat Dukhanc8466f52019-11-25 18:01:10 -080028 uint32_t mr, uint32_t nr, uint32_t kr, uint32_t sr,
Marat Dukhan104ae5e2021-05-24 13:41:57 -070029 xnn_init_f32_minmax_params_fn init_params,
Marat Dukhanc8466f52019-11-25 18:01:10 -080030 benchmark::utils::IsaCheckFunction isa_check = nullptr)
XNNPACK Teamb455b122019-09-27 18:10:33 -070031{
Marat Dukhanc8466f52019-11-25 18:01:10 -080032 if (isa_check && !isa_check(state)) {
33 return;
34 }
XNNPACK Teamb455b122019-09-27 18:10:33 -070035
36 const size_t input_height = state.range(0);
37 const size_t input_width = state.range(1);
38 const size_t kernel_height = state.range(2);
39 const size_t kernel_width = state.range(3);
40 const size_t kernel_size = kernel_height * kernel_width;
41 const size_t padding_height = state.range(4);
42 const size_t padding_width = state.range(5);
43 const size_t subsampling = state.range(6);
44 const size_t dilation = state.range(7);
45 const size_t group_input_channels = state.range(8);
46 const size_t group_output_channels = state.range(9);
47
48 std::random_device random_device;
49 auto rng = std::mt19937(random_device());
Marat Dukhan44f0ca72020-08-02 21:46:58 -070050 auto f32rng = std::bind(std::uniform_real_distribution<float>(0.0f, 1.0f), std::ref(rng));
XNNPACK Teamb455b122019-09-27 18:10:33 -070051
52 const size_t output_pixel_stride = group_output_channels;
53 const size_t input_pixel_stride = group_input_channels;
54 const size_t effective_kernel_height = (kernel_height - 1) * dilation + 1;
55 const size_t effective_kernel_width = (kernel_width - 1) * dilation + 1;
56 const size_t padding_left = padding_width / 2;
57 const size_t padding_top = padding_height / 2;
58 const size_t output_height = (input_height + padding_height - effective_kernel_height) / subsampling + 1;
59 const size_t output_width = (input_width + padding_width - effective_kernel_width) / subsampling + 1;
60 const size_t output_size = output_height * output_width;
61
Marat Dukhan42323232019-10-23 02:09:02 -070062 const size_t mc_stride = benchmark::utils::RoundUp<size_t>(output_size, mr);
63 const size_t nc_stride = benchmark::utils::RoundUp<size_t>(group_output_channels, nr);
64 const size_t kc_stride = benchmark::utils::RoundUp<size_t>(group_input_channels, kr);
XNNPACK Teamb455b122019-09-27 18:10:33 -070065
66 std::vector<float> a(input_height * input_width * input_pixel_stride);
67 std::generate(a.begin(), a.end(), std::ref(f32rng));
68 std::vector<float> k(group_output_channels * kernel_height * kernel_width * group_input_channels);
69 std::generate(k.begin(), k.end(), std::ref(f32rng));
70 std::vector<float> b(group_output_channels);
71 std::generate(b.begin(), b.end(), std::ref(f32rng));
72
73 std::vector<float> z(group_input_channels);
74
75 const size_t w_elements = (kernel_size * kc_stride + 1) * nc_stride;
76 const size_t i_elements = mc_stride * kernel_size;
77 const size_t c_elements = output_height * output_width * output_pixel_stride;
78 const size_t num_buffers = 1 +
Marat Dukhan42323232019-10-23 02:09:02 -070079 benchmark::utils::DivideRoundUp<size_t>(benchmark::utils::GetMaxCacheSize(),
XNNPACK Teamb455b122019-09-27 18:10:33 -070080 sizeof(float) * (w_elements + c_elements) + sizeof(void*) * i_elements);
81
Marat Dukhane13e6392021-07-26 22:22:35 -070082 std::vector<float, AlignedAllocator<float, 64>> w(w_elements * num_buffers);
XNNPACK Teamb455b122019-09-27 18:10:33 -070083 std::fill(w.begin(), w.end(), 0.0f);
84 xnn_pack_f32_conv_goki_w(
85 1 /* groups */, group_output_channels, kernel_size, group_input_channels,
Marat Dukhane06c8132021-06-03 08:59:11 -070086 nr, kr, sr, k.data(), b.data(), w.data(), 0 /* extra bytes */, nullptr);
XNNPACK Teamb455b122019-09-27 18:10:33 -070087 for (size_t n = 1; n < num_buffers; n++) {
88 std::copy(w.cbegin(), w.cbegin() + w_elements, w.begin() + n * w_elements);
89 }
90
91 std::vector<const float*> i(i_elements * num_buffers);
92 xnn_operator convolution_op = { };
93 convolution_op.indirection_buffer = reinterpret_cast<const void**>(i.data());
94 convolution_op.input = a.data();
95 convolution_op.input_pixel_stride = input_pixel_stride;
96 convolution_op.zero_buffer = z.data();
97 convolution_op.groups = 1;
98 convolution_op.group_input_channels = group_input_channels;
99 convolution_op.batch_size = 1;
100 convolution_op.input_height = input_height;
101 convolution_op.input_width = input_width;
102 convolution_op.output_height = output_height;
103 convolution_op.output_width = output_width;
104 convolution_op.kernel_height = kernel_height;
105 convolution_op.kernel_width = kernel_width;
106 convolution_op.stride_height = subsampling;
107 convolution_op.stride_width = subsampling;
108 convolution_op.dilation_height = dilation;
109 convolution_op.dilation_width = dilation;
110 convolution_op.padding_top = padding_top;
111 convolution_op.padding_left = padding_left;
112 xnn_indirection_init_conv2d(&convolution_op, mr, 2 /* log2(sizeof(float)) */);
113 for (size_t n = 1; n < num_buffers; n++) {
114 std::copy(i.cbegin(), i.cbegin() + i_elements, i.begin() + n * i_elements);
115 }
116
117 std::vector<float> c(c_elements * num_buffers);
118 std::fill(c.begin(), c.end(), std::nanf(""));
119
Marat Dukhanf56f4c42021-05-17 01:47:20 -0700120 xnn_f32_minmax_params params;
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700121 init_params(&params,
122 -std::numeric_limits<float>::infinity(), +std::numeric_limits<float>::infinity());
XNNPACK Teamb455b122019-09-27 18:10:33 -0700123
124 size_t buffer_index = 0;
125 for (auto _ : state) {
126 state.PauseTiming();
Marat Dukhan42323232019-10-23 02:09:02 -0700127 benchmark::utils::PrefetchToL1(a.data(), a.size() * sizeof(float));
XNNPACK Teamb455b122019-09-27 18:10:33 -0700128 buffer_index = (buffer_index + 1) % num_buffers;
129 state.ResumeTiming();
130
131 for (uint32_t m = 0; m < output_size; m += mr) {
132 const uint32_t mb = min(output_size - m, mr);
133 for (uint32_t n = 0; n < group_output_channels; n += nr) {
134 const uint32_t nb = min(group_output_channels - n, nr);
135 f32_igemm(
136 mb, nb, group_input_channels * sizeof(float), kernel_size * mr * sizeof(void*),
137 i.data() + buffer_index * i_elements + m,
138 w.data() + buffer_index * w_elements + n * (kc_stride * kernel_size + 1),
139 c.data() + buffer_index * c_elements + m * group_output_channels + n, group_output_channels * sizeof(float), nr * sizeof(float),
Frank Barcharde70dbeb2020-05-01 15:46:41 -0700140 0, z.data(), &params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700141 }
142 }
143 }
144
Marat Dukhand713e8a2020-12-04 14:23:12 -0800145 const uint64_t cpu_frequency = benchmark::utils::GetCurrentCpuFrequency();
146 if (cpu_frequency != 0) {
147 state.counters["cpufreq"] = cpu_frequency;
148 }
149
XNNPACK Teamb455b122019-09-27 18:10:33 -0700150 state.counters["FLOPS"] = benchmark::Counter(
151 uint64_t(state.iterations()) * 2 *
152 output_height * output_width *
153 group_input_channels * group_output_channels *
154 kernel_height * kernel_width,
155 benchmark::Counter::kIsRate);
156}
157
Zhi An Ng665cb232022-01-07 15:56:41 -0800158#if XNN_ARCH_ARM && XNN_PLATFORM_JIT && XNN_ENABLE_JIT
159 static void IGEMMBenchmark(benchmark::State& state,
160 xnn_jit_code_generator_function generator,
161 size_t mr, size_t nr, size_t kr, size_t sr,
162 xnn_init_f32_minmax_params_fn init_params,
163 benchmark::utils::IsaCheckFunction isa_check = nullptr)
164 {
165 xnn_code_buffer code_buffer;
166 xnn_allocate_code_memory(&code_buffer, XNN_DEFAULT_CODE_BUFFER_SIZE);
167 generator(&code_buffer);
168 IGEMMBenchmark(
169 state,
170 reinterpret_cast<xnn_f32_igemm_minmax_ukernel_function>(code_buffer.code),
171 mr, nr, kr, sr, init_params);
172 xnn_release_code_memory(&code_buffer);
173 }
174
175 static void jit_f32_igemm_4x8__aarch32_neon_ld64(benchmark::State& state, const char* net) {
176 IGEMMBenchmark(state, xnn_generate_f32_igemm_ukernel_4x8__aarch32_neon_ld64, 4, 8, 1, 1,
177 xnn_init_f32_minmax_scalar_params);
178 }
179 static void jit_f32_igemm_4x8__aarch32_neon_cortex_a7(benchmark::State& state, const char* net) {
180 IGEMMBenchmark(state, xnn_generate_f32_igemm_ukernel_4x8__aarch32_neon_cortex_a7, 4, 8, 1, 1,
181 xnn_init_f32_minmax_scalar_params);
182 }
183 static void jit_f32_igemm_4x8__aarch32_neon_cortex_a53(benchmark::State& state, const char* net) {
184 IGEMMBenchmark(state, xnn_generate_f32_igemm_ukernel_4x8__aarch32_neon_cortex_a53, 4, 8, 1, 1,
185 xnn_init_f32_minmax_scalar_params);
186 }
187 static void jit_f32_igemm_4x8__aarch32_neon_cortex_a55(benchmark::State& state, const char* net) {
188 IGEMMBenchmark(state, xnn_generate_f32_igemm_ukernel_4x8__aarch32_neon_cortex_a55, 4, 8, 1, 1,
189 xnn_init_f32_minmax_scalar_params);
190 }
191 static void jit_f32_igemm_4x8__aarch32_neon_prfm_cortex_a75(benchmark::State& state, const char* net) {
192 IGEMMBenchmark(state, xnn_generate_f32_igemm_ukernel_4x8__aarch32_neon_prfm_cortex_a75, 4, 8, 1, 1,
193 xnn_init_f32_minmax_scalar_params);
194 }
195 static void jit_f32_igemm_4x8__aarch32_neon_cortex_a75(benchmark::State& state, const char* net) {
196 IGEMMBenchmark(state, xnn_generate_f32_igemm_ukernel_4x8__aarch32_neon_cortex_a75, 4, 8, 1, 1,
197 xnn_init_f32_minmax_scalar_params);
198 }
199
200 BENCHMARK_CONV(jit_f32_igemm_4x8__aarch32_neon_ld64)
201 BENCHMARK_CONV(jit_f32_igemm_4x8__aarch32_neon_cortex_a7)
202 BENCHMARK_CONV(jit_f32_igemm_4x8__aarch32_neon_cortex_a53)
203 BENCHMARK_CONV(jit_f32_igemm_4x8__aarch32_neon_cortex_a55)
204 BENCHMARK_CONV(jit_f32_igemm_4x8__aarch32_neon_prfm_cortex_a75)
205 BENCHMARK_CONV(jit_f32_igemm_4x8__aarch32_neon_cortex_a75)
206#endif // XNN_ARCH_ARM && XNN_PLATFORM_JIT && XNN_ENABLE_JIT
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700207
Frank Barcharddc38f072020-02-10 13:21:42 -0800208#if XNN_ARCH_ARM && XNN_ENABLE_ASSEMBLY
209 static void f32_igemm_4x8__aarch32_neon_ld64(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700210 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch32_neon_ld64, 4, 8, 1, 1,
211 xnn_init_f32_minmax_scalar_params);
Frank Barcharddc38f072020-02-10 13:21:42 -0800212 }
Frank Barchard490febe2020-07-16 18:42:17 -0700213 static void f32_igemm_4x8__aarch32_neon_cortex_a7(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700214 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch32_neon_cortex_a7, 4, 8, 1, 1,
215 xnn_init_f32_minmax_scalar_params);
Frank Barchard569561d2020-06-17 13:11:12 -0700216 }
Frank Barchardb7dd29e2020-03-11 12:37:10 -0700217 static void f32_igemm_4x8__aarch32_neon_cortex_a53(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700218 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch32_neon_cortex_a53, 4, 8, 1, 1,
219 xnn_init_f32_minmax_scalar_params);
Frank Barchardb7dd29e2020-03-11 12:37:10 -0700220 }
221 static void f32_igemm_4x8__aarch32_neon_cortex_a55(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700222 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch32_neon_cortex_a55, 4, 8, 1, 1,
223 xnn_init_f32_minmax_scalar_params);
Frank Barchardb7dd29e2020-03-11 12:37:10 -0700224 }
Frank Barchard78735862022-01-04 16:47:44 -0800225 static void f32_igemm_4x8__aarch32_neon_prfm_cortex_a75(benchmark::State& state, const char* net) {
226 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch32_neon_prfm_cortex_a75, 4, 8, 1, 1,
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700227 xnn_init_f32_minmax_scalar_params);
Frank Barchardb7dd29e2020-03-11 12:37:10 -0700228 }
229 static void f32_igemm_4x8__aarch32_neon_cortex_a75(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700230 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch32_neon_cortex_a75, 4, 8, 1, 1,
231 xnn_init_f32_minmax_scalar_params);
Frank Barchardb7dd29e2020-03-11 12:37:10 -0700232 }
Frank Barcharddc38f072020-02-10 13:21:42 -0800233
234 BENCHMARK_CONV(f32_igemm_4x8__aarch32_neon_ld64)
Frank Barchard490febe2020-07-16 18:42:17 -0700235 BENCHMARK_CONV(f32_igemm_4x8__aarch32_neon_cortex_a7)
Frank Barchardb7dd29e2020-03-11 12:37:10 -0700236 BENCHMARK_CONV(f32_igemm_4x8__aarch32_neon_cortex_a53)
237 BENCHMARK_CONV(f32_igemm_4x8__aarch32_neon_cortex_a55)
Frank Barchard78735862022-01-04 16:47:44 -0800238 BENCHMARK_CONV(f32_igemm_4x8__aarch32_neon_prfm_cortex_a75)
Frank Barchardb7dd29e2020-03-11 12:37:10 -0700239 BENCHMARK_CONV(f32_igemm_4x8__aarch32_neon_cortex_a75)
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700240#endif // XNN_ARCH_ARM && XNN_ENABLE_ASSEMBLY
241
Frank Barcharddc38f072020-02-10 13:21:42 -0800242
Frank Barcharddbafc582019-10-09 16:30:48 -0700243#if XNN_ARCH_ARM64 && XNN_ENABLE_ASSEMBLY
XNNPACK Teamb455b122019-09-27 18:10:33 -0700244 static void f32_igemm_1x12__aarch64_neonfma_cortex_a53(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700245 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x12__aarch64_neonfma_cortex_a53, 1, 12, 1, 1,
246 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700247 }
Frank Barchard21be34f2019-10-09 19:32:19 -0700248 static void f32_igemm_1x8__aarch64_neonfma_cortex_a53(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700249 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__aarch64_neonfma_cortex_a53, 1, 8, 1, 1,
250 xnn_init_f32_minmax_scalar_params);
Frank Barchard21be34f2019-10-09 19:32:19 -0700251 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700252 static void f32_igemm_1x8__aarch64_neonfma_cortex_a75(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700253 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__aarch64_neonfma_cortex_a75, 1, 8, 1, 1,
254 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700255 }
Frank Barchard143a1102021-06-15 09:15:34 -0700256 static void f32_igemm_1x8__aarch64_neonfma_prfm_cortex_a75(benchmark::State& state, const char* net) {
257 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__aarch64_neonfma_prfm_cortex_a75, 1, 8, 1, 1,
258 xnn_init_f32_minmax_scalar_params);
259 }
Frank Barchard46fb8072019-10-25 12:54:22 -0700260 static void f32_igemm_4x8__aarch64_neonfma_cortex_a53(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700261 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch64_neonfma_cortex_a53, 4, 8, 1, 1,
262 xnn_init_f32_minmax_scalar_params);
Frank Barchard46fb8072019-10-25 12:54:22 -0700263 }
Frank Barchard8fb90552020-03-16 11:36:09 -0700264 static void f32_igemm_4x8__aarch64_neonfma_cortex_a55(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700265 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch64_neonfma_cortex_a55, 4, 8, 1, 1,
266 xnn_init_f32_minmax_scalar_params);
Frank Barchard8fb90552020-03-16 11:36:09 -0700267 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700268 static void f32_igemm_4x8__aarch64_neonfma_cortex_a75(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700269 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch64_neonfma_cortex_a75, 4, 8, 1, 1,
270 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700271 }
Frank Barchard143a1102021-06-15 09:15:34 -0700272 static void f32_igemm_4x8__aarch64_neonfma_prfm_cortex_a75(benchmark::State& state, const char* net) {
273 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch64_neonfma_prfm_cortex_a75, 4, 8, 1, 1,
274 xnn_init_f32_minmax_scalar_params);
275 }
Frank Barcharde3491242021-06-11 14:04:57 -0700276 static void f32_igemm_4x8__aarch64_neonfma_ld64(benchmark::State& state, const char* net) {
277 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch64_neonfma_ld64, 4, 8, 1, 1,
278 xnn_init_f32_minmax_scalar_params);
279 }
Frank Barchard79cd5f92021-06-21 17:34:59 -0700280 static void f32_igemm_4x8__aarch64_neonfma_ld128(benchmark::State& state, const char* net) {
281 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__aarch64_neonfma_ld128, 4, 8, 1, 1,
282 xnn_init_f32_minmax_scalar_params);
283 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700284 static void f32_igemm_5x8__aarch64_neonfma_cortex_a75(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700285 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__aarch64_neonfma_cortex_a75, 5, 8, 1, 1,
286 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700287 }
Frank Barchard143a1102021-06-15 09:15:34 -0700288 static void f32_igemm_5x8__aarch64_neonfma_prfm_cortex_a75(benchmark::State& state, const char* net) {
289 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__aarch64_neonfma_prfm_cortex_a75, 5, 8, 1, 1,
290 xnn_init_f32_minmax_scalar_params);
291 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700292 static void f32_igemm_4x12__aarch64_neonfma_cortex_a53(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700293 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x12__aarch64_neonfma_cortex_a53, 4, 12, 1, 1,
294 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700295 }
Frank Barcharda7fb8552019-10-23 17:14:17 -0700296 static void f32_igemm_6x8__aarch64_neonfma_cortex_a53(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700297 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__aarch64_neonfma_cortex_a53, 6, 8, 1, 1,
298 xnn_init_f32_minmax_scalar_params);
Frank Barcharda7fb8552019-10-23 17:14:17 -0700299 }
Frank Barchard91e19992020-03-09 18:46:14 -0700300 static void f32_igemm_6x8__aarch64_neonfma_cortex_a55(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700301 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__aarch64_neonfma_cortex_a55, 6, 8, 1, 1,
302 xnn_init_f32_minmax_scalar_params);
Frank Barchard91e19992020-03-09 18:46:14 -0700303 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700304 static void f32_igemm_6x8__aarch64_neonfma_cortex_a73(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700305 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__aarch64_neonfma_cortex_a73, 6, 8, 1, 1,
306 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700307 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700308 static void f32_igemm_6x8__aarch64_neonfma_cortex_a75(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700309 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__aarch64_neonfma_cortex_a75, 6, 8, 1, 1,
310 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700311 }
Frank Barchard143a1102021-06-15 09:15:34 -0700312 static void f32_igemm_6x8__aarch64_neonfma_prfm_cortex_a75(benchmark::State& state, const char* net) {
313 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__aarch64_neonfma_prfm_cortex_a75, 6, 8, 1, 1,
314 xnn_init_f32_minmax_scalar_params);
315 }
Frank Barcharde3491242021-06-11 14:04:57 -0700316 static void f32_igemm_6x8__aarch64_neonfma_ld64(benchmark::State& state, const char* net) {
317 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__aarch64_neonfma_ld64, 6, 8, 1, 1,
318 xnn_init_f32_minmax_scalar_params);
319 }
Frank Barchard79cd5f92021-06-21 17:34:59 -0700320 static void f32_igemm_6x8__aarch64_neonfma_ld128(benchmark::State& state, const char* net) {
321 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__aarch64_neonfma_ld128, 6, 8, 1, 1,
322 xnn_init_f32_minmax_scalar_params);
323 }
Frank Barchard91317c52019-11-22 10:54:35 -0800324 static void f32_igemm_1x8__neonfma_lane_ld64(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700325 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__neonfma_lane_ld64, 1, 8, 1, 1,
326 xnn_init_f32_minmax_scalar_params);
Frank Barchard91317c52019-11-22 10:54:35 -0800327 }
Frank Barchard91317c52019-11-22 10:54:35 -0800328 static void f32_igemm_4x2__neonfma_lane_ld64(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700329 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x2__neonfma_lane_ld64, 4, 2, 1, 1,
330 xnn_init_f32_minmax_scalar_params);
Frank Barchard91317c52019-11-22 10:54:35 -0800331 }
Frank Barchard91317c52019-11-22 10:54:35 -0800332 static void f32_igemm_4x4__neonfma_lane_ld64(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700333 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x4__neonfma_lane_ld64, 4, 4, 1, 1,
334 xnn_init_f32_minmax_scalar_params);
Frank Barchard91317c52019-11-22 10:54:35 -0800335 }
Frank Barchard91317c52019-11-22 10:54:35 -0800336 static void f32_igemm_4x8__neonfma_lane_ld128(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700337 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neonfma_lane_ld128, 4, 8, 1, 1,
338 xnn_init_f32_minmax_scalar_params);
Frank Barchard91317c52019-11-22 10:54:35 -0800339 }
Frank Barchard91317c52019-11-22 10:54:35 -0800340 static void f32_igemm_4x8__neonfma_lane_ld64(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700341 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neonfma_lane_ld64, 4, 8, 1, 1,
342 xnn_init_f32_minmax_scalar_params);
Frank Barchard91317c52019-11-22 10:54:35 -0800343 }
Frank Barchard91317c52019-11-22 10:54:35 -0800344 static void f32_igemm_6x8__neonfma_lane_ld64(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700345 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neonfma_lane_ld64, 6, 8, 1, 1,
346 xnn_init_f32_minmax_scalar_params);
Frank Barchard91317c52019-11-22 10:54:35 -0800347 }
Frank Barchard69172d92019-11-26 16:22:39 -0800348 static void f32_igemm_6x8__neonfma_lane_ld128(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700349 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neonfma_lane_ld128, 6, 8, 1, 1,
350 xnn_init_f32_minmax_scalar_params);
Frank Barchard69172d92019-11-26 16:22:39 -0800351 }
352
XNNPACK Teamb455b122019-09-27 18:10:33 -0700353 BENCHMARK_CONV(f32_igemm_1x12__aarch64_neonfma_cortex_a53)
Frank Barchard21be34f2019-10-09 19:32:19 -0700354 BENCHMARK_CONV(f32_igemm_1x8__aarch64_neonfma_cortex_a53)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700355 BENCHMARK_CONV(f32_igemm_1x8__aarch64_neonfma_cortex_a75)
Frank Barchard143a1102021-06-15 09:15:34 -0700356 BENCHMARK_CONV(f32_igemm_1x8__aarch64_neonfma_prfm_cortex_a75)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700357 BENCHMARK_CONV(f32_igemm_4x12__aarch64_neonfma_cortex_a53)
Frank Barchard46fb8072019-10-25 12:54:22 -0700358 BENCHMARK_CONV(f32_igemm_4x8__aarch64_neonfma_cortex_a53)
Frank Barchard8fb90552020-03-16 11:36:09 -0700359 BENCHMARK_CONV(f32_igemm_4x8__aarch64_neonfma_cortex_a55)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700360 BENCHMARK_CONV(f32_igemm_4x8__aarch64_neonfma_cortex_a75)
Frank Barchard143a1102021-06-15 09:15:34 -0700361 BENCHMARK_CONV(f32_igemm_4x8__aarch64_neonfma_prfm_cortex_a75)
Frank Barcharde3491242021-06-11 14:04:57 -0700362 BENCHMARK_CONV(f32_igemm_4x8__aarch64_neonfma_ld64)
Frank Barchard79cd5f92021-06-21 17:34:59 -0700363 BENCHMARK_CONV(f32_igemm_4x8__aarch64_neonfma_ld128)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700364 BENCHMARK_CONV(f32_igemm_5x8__aarch64_neonfma_cortex_a75)
Frank Barchard143a1102021-06-15 09:15:34 -0700365 BENCHMARK_CONV(f32_igemm_5x8__aarch64_neonfma_prfm_cortex_a75)
Frank Barcharda7fb8552019-10-23 17:14:17 -0700366 BENCHMARK_CONV(f32_igemm_6x8__aarch64_neonfma_cortex_a53)
Frank Barchard91e19992020-03-09 18:46:14 -0700367 BENCHMARK_CONV(f32_igemm_6x8__aarch64_neonfma_cortex_a55)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700368 BENCHMARK_CONV(f32_igemm_6x8__aarch64_neonfma_cortex_a73)
369 BENCHMARK_CONV(f32_igemm_6x8__aarch64_neonfma_cortex_a75)
Frank Barchard143a1102021-06-15 09:15:34 -0700370 BENCHMARK_CONV(f32_igemm_6x8__aarch64_neonfma_prfm_cortex_a75)
Frank Barcharde3491242021-06-11 14:04:57 -0700371 BENCHMARK_CONV(f32_igemm_6x8__aarch64_neonfma_ld64)
Frank Barchard79cd5f92021-06-21 17:34:59 -0700372 BENCHMARK_CONV(f32_igemm_6x8__aarch64_neonfma_ld128)
Frank Barchard91317c52019-11-22 10:54:35 -0800373 BENCHMARK_CONV(f32_igemm_1x8__neonfma_lane_ld64)
374 BENCHMARK_CONV(f32_igemm_4x2__neonfma_lane_ld64)
375 BENCHMARK_CONV(f32_igemm_4x4__neonfma_lane_ld64)
376 BENCHMARK_CONV(f32_igemm_4x8__neonfma_lane_ld128)
377 BENCHMARK_CONV(f32_igemm_4x8__neonfma_lane_ld64)
378 BENCHMARK_CONV(f32_igemm_6x8__neonfma_lane_ld64)
Frank Barchard69172d92019-11-26 16:22:39 -0800379 BENCHMARK_CONV(f32_igemm_6x8__neonfma_lane_ld128)
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700380#endif // XNN_ARCH_ARM64 && XNN_ENABLE_ASSEMBLY
381
XNNPACK Teamb455b122019-09-27 18:10:33 -0700382
Frank Barchard4c3e5a92021-08-16 19:17:39 -0700383#if XNN_ARCH_ARM || XNN_ARCH_ARM64
384 static void f32_igemm_1x8__neon_lane_ld64(benchmark::State& state, const char* net) {
385 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__neon_lane_ld64, 1, 8, 1, 1,
386 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
387 }
388 static void f32_igemm_4x2__neon_lane_ld64(benchmark::State& state, const char* net) {
389 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x2__neon_lane_ld64, 4, 2, 1, 1,
390 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
391 }
392 static void f32_igemm_4x4__neon_lane_ld64(benchmark::State& state, const char* net) {
393 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x4__neon_lane_ld64, 4, 4, 1, 1,
394 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
395 }
396 static void f32_igemm_4x8__neon_lane_ld64(benchmark::State& state, const char* net) {
397 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neon_lane_ld64, 4, 8, 1, 1,
398 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
399 }
400 static void f32_igemm_4x8__neon_lane_ld128(benchmark::State& state, const char* net) {
401 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neon_lane_ld128, 4, 8, 1, 1,
402 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
403 }
404 static void f32_igemm_6x8__neon_lane_ld64(benchmark::State& state, const char* net) {
405 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neon_lane_ld64, 6, 8, 1, 1,
406 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
407 }
408 static void f32_igemm_6x8__neon_lane_ld128(benchmark::State& state, const char* net) {
409 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neon_lane_ld128, 6, 8, 1, 1,
410 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
411 }
412 static void f32_igemm_1x8__neon_dup_ld64(benchmark::State& state, const char* net) {
413 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__neon_dup_ld64, 1, 8, 1, 1,
414 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
415 }
416 static void f32_igemm_4x8__neon_dup_ld128(benchmark::State& state, const char* net) {
417 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neon_dup_ld128, 4, 8, 1, 1,
418 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
419 }
420 static void f32_igemm_4x8__neon_dup_ld64(benchmark::State& state, const char* net) {
421 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neon_dup_ld64, 4, 8, 1, 1,
422 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
423 }
424 static void f32_igemm_6x8__neon_dup_ld64(benchmark::State& state, const char* net) {
425 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neon_dup_ld64, 6, 8, 1, 1,
426 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
427 }
428 static void f32_igemm_6x8__neon_dup_ld128(benchmark::State& state, const char* net) {
429 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neon_dup_ld128, 6, 8, 1, 1,
430 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
431 }
432 static void f32_igemm_1x8__neonfma_dup_ld64(benchmark::State& state, const char* net) {
433 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__neonfma_dup_ld64, 1, 8, 1, 1,
434 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
435 }
436 static void f32_igemm_4x8__neonfma_dup_ld128(benchmark::State& state, const char* net) {
437 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neonfma_dup_ld128, 4, 8, 1, 1,
438 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
439 }
440 static void f32_igemm_4x8__neonfma_dup_ld64(benchmark::State& state, const char* net) {
441 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__neonfma_dup_ld64, 4, 8, 1, 1,
442 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
443 }
444 static void f32_igemm_6x8__neonfma_dup_ld64(benchmark::State& state, const char* net) {
445 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neonfma_dup_ld64, 6, 8, 1, 1,
446 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
447 }
448 static void f32_igemm_6x8__neonfma_dup_ld128(benchmark::State& state, const char* net) {
449 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__neonfma_dup_ld128, 6, 8, 1, 1,
450 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
451 }
452 static void f32_igemm_1x8s4__neon(benchmark::State& state, const char* net) {
453 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8s4__neon, 1, 8, 1, 4,
454 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
455 }
456 static void f32_igemm_4x8s4__neon(benchmark::State& state, const char* net) {
457 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8s4__neon, 4, 8, 1, 4,
458 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
459 }
460 static void f32_igemm_6x8s4__neon(benchmark::State& state, const char* net) {
461 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8s4__neon, 6, 8, 1, 4,
462 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
463 }
464 static void f32_igemm_8x8s4__neon(benchmark::State& state, const char* net) {
465 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_8x8s4__neon, 8, 8, 1, 4,
466 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEON);
467 }
468 static void f32_igemm_1x8s4__neonfma(benchmark::State& state, const char* net) {
469 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8s4__neonfma, 1, 8, 1, 4,
470 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
471 }
472 static void f32_igemm_4x8s4__neonfma(benchmark::State& state, const char* net) {
473 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8s4__neonfma, 4, 8, 1, 4,
474 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
475 }
476 static void f32_igemm_6x8s4__neonfma(benchmark::State& state, const char* net) {
477 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8s4__neonfma, 6, 8, 1, 4,
478 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
479 }
480 static void f32_igemm_8x8s4__neonfma(benchmark::State& state, const char* net) {
481 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_8x8s4__neonfma, 8, 8, 1, 4,
482 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckNEONFMA);
483 }
484
485 BENCHMARK_CONV(f32_igemm_1x8__neon_lane_ld64)
486 BENCHMARK_CONV(f32_igemm_4x2__neon_lane_ld64)
487 BENCHMARK_CONV(f32_igemm_4x4__neon_lane_ld64)
488 BENCHMARK_CONV(f32_igemm_4x8__neon_lane_ld128)
489 BENCHMARK_CONV(f32_igemm_4x8__neon_lane_ld64)
490 BENCHMARK_CONV(f32_igemm_6x8__neon_lane_ld64)
491 BENCHMARK_CONV(f32_igemm_6x8__neon_lane_ld128)
492 BENCHMARK_CONV(f32_igemm_1x8__neon_dup_ld64)
493 BENCHMARK_CONV(f32_igemm_4x8__neon_dup_ld128)
494 BENCHMARK_CONV(f32_igemm_4x8__neon_dup_ld64)
495 BENCHMARK_CONV(f32_igemm_6x8__neon_dup_ld64)
496 BENCHMARK_CONV(f32_igemm_6x8__neon_dup_ld128)
497 BENCHMARK_CONV(f32_igemm_1x8__neonfma_dup_ld64)
498 BENCHMARK_CONV(f32_igemm_4x8__neonfma_dup_ld128)
499 BENCHMARK_CONV(f32_igemm_4x8__neonfma_dup_ld64)
500 BENCHMARK_CONV(f32_igemm_6x8__neonfma_dup_ld64)
501 BENCHMARK_CONV(f32_igemm_6x8__neonfma_dup_ld128)
502 BENCHMARK_CONV(f32_igemm_1x8s4__neon)
503 BENCHMARK_CONV(f32_igemm_4x8s4__neon)
504 BENCHMARK_CONV(f32_igemm_6x8s4__neon)
505 BENCHMARK_CONV(f32_igemm_8x8s4__neon)
506 BENCHMARK_CONV(f32_igemm_1x8s4__neonfma)
507 BENCHMARK_CONV(f32_igemm_4x8s4__neonfma)
508 BENCHMARK_CONV(f32_igemm_6x8s4__neonfma)
509 BENCHMARK_CONV(f32_igemm_8x8s4__neonfma)
510#endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
511
512
Marat Dukhan1dadbf72019-10-01 10:46:20 -0700513#if XNN_ARCH_X86 || XNN_ARCH_X86_64
XNNPACK Teamb455b122019-09-27 18:10:33 -0700514 static void f32_igemm_1x8__sse_load1(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700515 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__sse_load1, 1, 8, 1, 1,
516 xnn_init_f32_minmax_sse_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700517 }
Marat Dukhan802fcae2020-12-11 14:37:25 -0800518 static void f32_igemm_3x8__sse_load1(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700519 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8__sse_load1, 3, 8, 1, 1,
520 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800521 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700522 static void f32_igemm_4x8__sse_load1(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700523 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__sse_load1, 4, 8, 1, 1,
524 xnn_init_f32_minmax_sse_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700525 }
Marat Dukhan802fcae2020-12-11 14:37:25 -0800526 static void f32_igemm_5x8__sse_load1(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700527 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__sse_load1, 5, 8, 1, 1,
528 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800529 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700530
531 static void f32_igemm_1x8__sse_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700532 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__sse_dup, 1, 8, 1, 1,
533 xnn_init_f32_minmax_sse_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700534 }
Marat Dukhan802fcae2020-12-11 14:37:25 -0800535 static void f32_igemm_3x8__sse_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700536 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8__sse_dup, 3, 8, 1, 1,
537 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800538 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700539 static void f32_igemm_4x8__sse_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700540 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__sse_dup, 4, 8, 1, 1,
541 xnn_init_f32_minmax_sse_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700542 }
Marat Dukhan802fcae2020-12-11 14:37:25 -0800543 static void f32_igemm_5x8__sse_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700544 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__sse_dup, 5, 8, 1, 1,
545 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800546 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700547
548 static void f32_igemm_1x8s4__sse(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700549 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8s4__sse, 1, 8, 1, 4,
550 xnn_init_f32_minmax_sse_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700551 }
Marat Dukhan802fcae2020-12-11 14:37:25 -0800552 static void f32_igemm_3x8s4__sse(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700553 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8s4__sse, 3, 8, 1, 4,
554 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800555 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700556 static void f32_igemm_4x8s4__sse(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700557 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8s4__sse, 4, 8, 1, 4,
558 xnn_init_f32_minmax_sse_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700559 }
Marat Dukhan802fcae2020-12-11 14:37:25 -0800560 static void f32_igemm_5x8s4__sse(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700561 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8s4__sse, 5, 8, 1, 4,
562 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800563 }
564
565 static void f32_igemm_1x8__sse2_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700566 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__sse2_dup, 1, 8, 1, 1,
567 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800568 }
569 static void f32_igemm_3x8__sse2_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700570 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8__sse2_dup, 3, 8, 1, 1,
571 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800572 }
573 static void f32_igemm_4x8__sse2_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700574 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__sse2_dup, 4, 8, 1, 1,
575 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800576 }
577 static void f32_igemm_5x8__sse2_dup(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700578 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__sse2_dup, 5, 8, 1, 1,
579 xnn_init_f32_minmax_sse_params);
Marat Dukhan802fcae2020-12-11 14:37:25 -0800580 }
XNNPACK Teamb455b122019-09-27 18:10:33 -0700581
Marat Dukhanfda12b82019-11-21 12:27:59 -0800582 static void f32_igemm_1x8__avx_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700583 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__avx_broadcast, 1, 8, 1, 1,
584 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckAVX);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800585 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800586 static void f32_igemm_4x8__avx_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700587 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__avx_broadcast, 4, 8, 1, 1,
588 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckAVX);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800589 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800590 static void f32_igemm_5x8__avx_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700591 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__avx_broadcast, 5, 8, 1, 1,
592 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckAVX);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800593 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800594 static void f32_igemm_6x8__avx_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700595 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__avx_broadcast, 6, 8, 1, 1,
596 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckAVX);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800597 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800598 static void f32_igemm_7x8__avx_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700599 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_7x8__avx_broadcast, 7, 8, 1, 1,
600 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckAVX);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800601 }
602
603 static void f32_igemm_1x8__fma3_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700604 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x8__fma3_broadcast, 1, 8, 1, 1,
605 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckFMA3);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800606 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800607 static void f32_igemm_4x8__fma3_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700608 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__fma3_broadcast, 4, 8, 1, 1,
609 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckFMA3);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800610 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800611 static void f32_igemm_5x8__fma3_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700612 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__fma3_broadcast, 5, 8, 1, 1,
613 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckFMA3);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800614 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800615 static void f32_igemm_6x8__fma3_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700616 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__fma3_broadcast, 6, 8, 1, 1,
617 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckFMA3);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800618 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800619 static void f32_igemm_7x8__fma3_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700620 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_7x8__fma3_broadcast, 7, 8, 1, 1,
621 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckFMA3);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800622 }
Marat Dukhanfda12b82019-11-21 12:27:59 -0800623 static void f32_igemm_8x8__fma3_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700624 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_8x8__fma3_broadcast, 8, 8, 1, 1,
625 xnn_init_f32_minmax_avx_params, benchmark::utils::CheckFMA3);
Marat Dukhanfda12b82019-11-21 12:27:59 -0800626 }
627
Marat Dukhan0f349c42019-11-27 11:58:54 -0800628 static void f32_igemm_1x16__avx512f_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700629 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x16__avx512f_broadcast, 1, 16, 1, 1,
630 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckFMA3);
Marat Dukhan0f349c42019-11-27 11:58:54 -0800631 }
632 static void f32_igemm_4x16__avx512f_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700633 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x16__avx512f_broadcast, 4, 16, 1, 1,
634 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckFMA3);
Marat Dukhan0f349c42019-11-27 11:58:54 -0800635 }
636 static void f32_igemm_5x16__avx512f_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700637 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x16__avx512f_broadcast, 5, 16, 1, 1,
638 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckFMA3);
Marat Dukhan0f349c42019-11-27 11:58:54 -0800639 }
640 static void f32_igemm_6x16__avx512f_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700641 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x16__avx512f_broadcast, 6, 16, 1, 1,
642 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckFMA3);
Marat Dukhan0f349c42019-11-27 11:58:54 -0800643 }
644 static void f32_igemm_7x16__avx512f_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700645 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_7x16__avx512f_broadcast, 7, 16, 1, 1,
646 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckFMA3);
Marat Dukhan0f349c42019-11-27 11:58:54 -0800647 }
648 static void f32_igemm_8x16__avx512f_broadcast(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700649 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_8x16__avx512f_broadcast, 8, 16, 1, 1,
650 xnn_init_f32_minmax_scalar_params, benchmark::utils::CheckFMA3);
Marat Dukhan0f349c42019-11-27 11:58:54 -0800651 }
652
XNNPACK Teamb455b122019-09-27 18:10:33 -0700653 BENCHMARK_CONV(f32_igemm_1x8__sse_load1)
Marat Dukhan802fcae2020-12-11 14:37:25 -0800654 BENCHMARK_CONV(f32_igemm_3x8__sse_load1)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700655 BENCHMARK_CONV(f32_igemm_4x8__sse_load1)
Marat Dukhan802fcae2020-12-11 14:37:25 -0800656 BENCHMARK_CONV(f32_igemm_5x8__sse_load1)
Marat Dukhan0f349c42019-11-27 11:58:54 -0800657
XNNPACK Teamb455b122019-09-27 18:10:33 -0700658 BENCHMARK_CONV(f32_igemm_1x8__sse_dup)
Marat Dukhan802fcae2020-12-11 14:37:25 -0800659 BENCHMARK_CONV(f32_igemm_3x8__sse_dup)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700660 BENCHMARK_CONV(f32_igemm_4x8__sse_dup)
Marat Dukhan802fcae2020-12-11 14:37:25 -0800661 BENCHMARK_CONV(f32_igemm_5x8__sse_dup)
Marat Dukhan0f349c42019-11-27 11:58:54 -0800662
XNNPACK Teamb455b122019-09-27 18:10:33 -0700663 BENCHMARK_CONV(f32_igemm_1x8s4__sse)
Marat Dukhan802fcae2020-12-11 14:37:25 -0800664 BENCHMARK_CONV(f32_igemm_3x8s4__sse)
XNNPACK Teamb455b122019-09-27 18:10:33 -0700665 BENCHMARK_CONV(f32_igemm_4x8s4__sse)
Marat Dukhan802fcae2020-12-11 14:37:25 -0800666 BENCHMARK_CONV(f32_igemm_5x8s4__sse)
667
668 BENCHMARK_CONV(f32_igemm_1x8__sse2_dup)
669 BENCHMARK_CONV(f32_igemm_3x8__sse2_dup)
670 BENCHMARK_CONV(f32_igemm_4x8__sse2_dup)
671 BENCHMARK_CONV(f32_igemm_5x8__sse2_dup)
Marat Dukhan0f349c42019-11-27 11:58:54 -0800672
Marat Dukhanfda12b82019-11-21 12:27:59 -0800673 BENCHMARK_CONV(f32_igemm_1x8__avx_broadcast)
674 BENCHMARK_CONV(f32_igemm_4x8__avx_broadcast)
675 BENCHMARK_CONV(f32_igemm_5x8__avx_broadcast)
676 BENCHMARK_CONV(f32_igemm_6x8__avx_broadcast)
677 BENCHMARK_CONV(f32_igemm_7x8__avx_broadcast)
Marat Dukhan0f349c42019-11-27 11:58:54 -0800678
Marat Dukhanfda12b82019-11-21 12:27:59 -0800679 BENCHMARK_CONV(f32_igemm_1x8__fma3_broadcast)
680 BENCHMARK_CONV(f32_igemm_4x8__fma3_broadcast)
681 BENCHMARK_CONV(f32_igemm_5x8__fma3_broadcast)
682 BENCHMARK_CONV(f32_igemm_6x8__fma3_broadcast)
683 BENCHMARK_CONV(f32_igemm_7x8__fma3_broadcast)
684 BENCHMARK_CONV(f32_igemm_8x8__fma3_broadcast)
Marat Dukhan0f349c42019-11-27 11:58:54 -0800685
686 BENCHMARK_CONV(f32_igemm_1x16__avx512f_broadcast)
687 BENCHMARK_CONV(f32_igemm_4x16__avx512f_broadcast)
688 BENCHMARK_CONV(f32_igemm_5x16__avx512f_broadcast)
689 BENCHMARK_CONV(f32_igemm_6x16__avx512f_broadcast)
690 BENCHMARK_CONV(f32_igemm_7x16__avx512f_broadcast)
691 BENCHMARK_CONV(f32_igemm_8x16__avx512f_broadcast)
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700692#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
693
XNNPACK Teamb455b122019-09-27 18:10:33 -0700694
Marat Dukhan4c617792021-12-21 15:47:58 -0800695#if XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
Frank Barchard0725b8d2020-12-07 11:07:35 -0800696 static void f32_igemm_3x8__wasmsimd_arm_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700697 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8__wasmsimd_arm_loadsplat, 3, 8, 1, 1,
698 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700699 }
700
Frank Barchard0725b8d2020-12-07 11:07:35 -0800701 static void f32_igemm_4x8__wasmsimd_arm_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700702 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__wasmsimd_arm_loadsplat, 4, 8, 1, 1,
703 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700704 }
705
Frank Barchard0725b8d2020-12-07 11:07:35 -0800706 static void f32_igemm_5x8__wasmsimd_arm_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700707 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__wasmsimd_arm_loadsplat, 5, 8, 1, 1,
708 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700709 }
710
Frank Barchard0725b8d2020-12-07 11:07:35 -0800711 static void f32_igemm_6x8__wasmsimd_arm_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700712 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__wasmsimd_arm_loadsplat, 6, 8, 1, 1,
713 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700714 }
715
Frank Barchard0725b8d2020-12-07 11:07:35 -0800716 static void f32_igemm_3x8__wasmsimd_x86_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700717 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8__wasmsimd_x86_loadsplat, 3, 8, 1, 1,
718 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700719 }
720
Frank Barchard0725b8d2020-12-07 11:07:35 -0800721 static void f32_igemm_4x8__wasmsimd_x86_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700722 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__wasmsimd_x86_loadsplat, 4, 8, 1, 1,
723 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700724 }
725
Frank Barchard0725b8d2020-12-07 11:07:35 -0800726 static void f32_igemm_5x8__wasmsimd_x86_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700727 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__wasmsimd_x86_loadsplat, 5, 8, 1, 1,
728 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700729 }
730
Frank Barchard0725b8d2020-12-07 11:07:35 -0800731 static void f32_igemm_6x8__wasmsimd_x86_loadsplat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700732 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__wasmsimd_x86_loadsplat, 6, 8, 1, 1,
733 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700734 }
735
Frank Barchard0725b8d2020-12-07 11:07:35 -0800736 static void f32_igemm_3x8__wasmsimd_arm_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700737 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8__wasmsimd_arm_splat, 3, 8, 1, 1,
738 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700739 }
740
Frank Barchard0725b8d2020-12-07 11:07:35 -0800741 static void f32_igemm_4x8__wasmsimd_arm_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700742 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__wasmsimd_arm_splat, 4, 8, 1, 1,
743 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700744 }
745
Frank Barchard0725b8d2020-12-07 11:07:35 -0800746 static void f32_igemm_5x8__wasmsimd_arm_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700747 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__wasmsimd_arm_splat, 5, 8, 1, 1,
748 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700749 }
750
Frank Barchard0725b8d2020-12-07 11:07:35 -0800751 static void f32_igemm_6x8__wasmsimd_arm_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700752 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__wasmsimd_arm_splat, 6, 8, 1, 1,
753 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700754 }
755
Frank Barchard0725b8d2020-12-07 11:07:35 -0800756 static void f32_igemm_3x8__wasmsimd_x86_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700757 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8__wasmsimd_x86_splat, 3, 8, 1, 1,
758 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700759 }
760
Frank Barchard0725b8d2020-12-07 11:07:35 -0800761 static void f32_igemm_4x8__wasmsimd_x86_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700762 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8__wasmsimd_x86_splat, 4, 8, 1, 1,
763 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700764 }
765
Frank Barchard0725b8d2020-12-07 11:07:35 -0800766 static void f32_igemm_5x8__wasmsimd_x86_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700767 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8__wasmsimd_x86_splat, 5, 8, 1, 1,
768 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700769 }
770
Frank Barchard0725b8d2020-12-07 11:07:35 -0800771 static void f32_igemm_6x8__wasmsimd_x86_splat(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700772 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8__wasmsimd_x86_splat, 6, 8, 1, 1,
773 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700774 }
775
776 static void f32_igemm_3x8s4__wasmsimd_arm(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700777 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8s4__wasmsimd_arm, 3, 8, 1, 4,
778 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700779 }
780
781 static void f32_igemm_4x8s4__wasmsimd_arm(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700782 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8s4__wasmsimd_arm, 4, 8, 1, 4,
783 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700784 }
785
786 static void f32_igemm_5x8s4__wasmsimd_arm(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700787 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8s4__wasmsimd_arm, 5, 8, 1, 4,
788 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700789 }
790
791 static void f32_igemm_6x8s4__wasmsimd_arm(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700792 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8s4__wasmsimd_arm, 6, 8, 1, 4,
793 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700794 }
795
796 static void f32_igemm_3x8s4__wasmsimd_x86(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700797 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_3x8s4__wasmsimd_x86, 3, 8, 1, 4,
798 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700799 }
800
801 static void f32_igemm_4x8s4__wasmsimd_x86(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700802 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x8s4__wasmsimd_x86, 4, 8, 1, 4,
803 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700804 }
805
806 static void f32_igemm_5x8s4__wasmsimd_x86(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700807 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_5x8s4__wasmsimd_x86, 5, 8, 1, 4,
808 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700809 }
810
811 static void f32_igemm_6x8s4__wasmsimd_x86(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700812 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_6x8s4__wasmsimd_x86, 6, 8, 1, 4,
813 xnn_init_f32_minmax_scalar_params);
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700814 }
815
Frank Barchard0725b8d2020-12-07 11:07:35 -0800816 BENCHMARK_CONV(f32_igemm_3x8__wasmsimd_arm_loadsplat)
817 BENCHMARK_CONV(f32_igemm_4x8__wasmsimd_arm_loadsplat)
818 BENCHMARK_CONV(f32_igemm_5x8__wasmsimd_arm_loadsplat)
819 BENCHMARK_CONV(f32_igemm_6x8__wasmsimd_arm_loadsplat)
820 BENCHMARK_CONV(f32_igemm_3x8__wasmsimd_x86_loadsplat)
821 BENCHMARK_CONV(f32_igemm_4x8__wasmsimd_x86_loadsplat)
822 BENCHMARK_CONV(f32_igemm_5x8__wasmsimd_x86_loadsplat)
823 BENCHMARK_CONV(f32_igemm_6x8__wasmsimd_x86_loadsplat)
824 BENCHMARK_CONV(f32_igemm_3x8__wasmsimd_arm_splat)
825 BENCHMARK_CONV(f32_igemm_4x8__wasmsimd_arm_splat)
826 BENCHMARK_CONV(f32_igemm_5x8__wasmsimd_arm_splat)
827 BENCHMARK_CONV(f32_igemm_6x8__wasmsimd_arm_splat)
828 BENCHMARK_CONV(f32_igemm_3x8__wasmsimd_x86_splat)
829 BENCHMARK_CONV(f32_igemm_4x8__wasmsimd_x86_splat)
830 BENCHMARK_CONV(f32_igemm_5x8__wasmsimd_x86_splat)
831 BENCHMARK_CONV(f32_igemm_6x8__wasmsimd_x86_splat)
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700832 BENCHMARK_CONV(f32_igemm_3x8s4__wasmsimd_arm)
833 BENCHMARK_CONV(f32_igemm_4x8s4__wasmsimd_arm)
834 BENCHMARK_CONV(f32_igemm_5x8s4__wasmsimd_arm)
835 BENCHMARK_CONV(f32_igemm_6x8s4__wasmsimd_arm)
836 BENCHMARK_CONV(f32_igemm_3x8s4__wasmsimd_x86)
837 BENCHMARK_CONV(f32_igemm_4x8s4__wasmsimd_x86)
838 BENCHMARK_CONV(f32_igemm_5x8s4__wasmsimd_x86)
839 BENCHMARK_CONV(f32_igemm_6x8s4__wasmsimd_x86)
Marat Dukhan4c617792021-12-21 15:47:58 -0800840#endif // XNN_ARCH_WASMSIMD || XNN_ARCH_WASMRELAXEDSIMD
Marat Dukhan1bbf96b2020-06-15 23:01:20 -0700841
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700842
XNNPACK Teamb455b122019-09-27 18:10:33 -0700843static void f32_igemm_1x4__scalar(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700844 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_1x4__scalar, 1, 4, 1, 1,
845 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700846}
847
848static void f32_igemm_2x4__scalar(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700849 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_2x4__scalar, 2, 4, 1, 1,
850 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700851}
852
853static void f32_igemm_4x4__scalar(benchmark::State& state, const char* net) {
Marat Dukhan104ae5e2021-05-24 13:41:57 -0700854 IGEMMBenchmark(state, xnn_f32_igemm_minmax_ukernel_4x4__scalar, 4, 4, 1, 1,
855 xnn_init_f32_minmax_scalar_params);
XNNPACK Teamb455b122019-09-27 18:10:33 -0700856}
857
858BENCHMARK_CONV(f32_igemm_1x4__scalar)
859BENCHMARK_CONV(f32_igemm_2x4__scalar)
860BENCHMARK_CONV(f32_igemm_4x4__scalar)
861
XNNPACK Teamb455b122019-09-27 18:10:33 -0700862#ifndef XNNPACK_BENCHMARK_NO_MAIN
863BENCHMARK_MAIN();
864#endif