XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 1 | // Copyright (c) Facebook, Inc. and its affiliates. |
| 2 | // All rights reserved. |
| 3 | // |
| 4 | // Copyright 2019 Google LLC |
| 5 | // |
| 6 | // This source code is licensed under the BSD-style license found in the |
| 7 | // LICENSE file in the root directory of this source tree. |
| 8 | |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 9 | #include <gtest/gtest.h> |
| 10 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 11 | #include <xnnpack/common.h> |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 12 | #include <xnnpack/isa-checks.h> |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 13 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 14 | #include <xnnpack/vadd.h> |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 15 | #include "vadd-microkernel-tester.h" |
| 16 | |
| 17 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 18 | #if XNN_ARCH_X86 || XNN_ARCH_X86_64 |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 19 | TEST(QU8_VADD_MINMAX__SSE2, n_eq_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 20 | TEST_REQUIRES_X86_SSE2; |
| 21 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 22 | .batch_size(8) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 23 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 24 | } |
| 25 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 26 | TEST(QU8_VADD_MINMAX__SSE2, n_div_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 27 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 28 | for (size_t batch_size = 8; batch_size < 128; batch_size += 24) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 29 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 30 | .batch_size(batch_size) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 31 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 32 | } |
| 33 | } |
| 34 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 35 | TEST(QU8_VADD_MINMAX__SSE2, n_gt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 36 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 37 | for (size_t batch_size = 9; batch_size < 16; batch_size++) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 38 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 39 | .batch_size(batch_size) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 40 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 41 | } |
| 42 | } |
| 43 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 44 | TEST(QU8_VADD_MINMAX__SSE2, n_lt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 45 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 46 | for (size_t batch_size = 1; batch_size < 8; batch_size++) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 47 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 48 | .batch_size(batch_size) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 49 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 50 | } |
| 51 | } |
| 52 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 53 | TEST(QU8_VADD_MINMAX__SSE2, inplace_a) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 54 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 55 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 56 | VAddMicrokernelTester() |
| 57 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 58 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 59 | .inplace_a(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 60 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 61 | } |
| 62 | } |
| 63 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 64 | TEST(QU8_VADD_MINMAX__SSE2, inplace_b) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 65 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 66 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 67 | VAddMicrokernelTester() |
| 68 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 69 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 70 | .inplace_b(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 71 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 72 | } |
| 73 | } |
| 74 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 75 | TEST(QU8_VADD_MINMAX__SSE2, inplace_a_and_b) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 76 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 77 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 78 | VAddMicrokernelTester() |
| 79 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 80 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 81 | .inplace_a(true) |
| 82 | .inplace_b(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 83 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 84 | } |
| 85 | } |
| 86 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 87 | TEST(QU8_VADD_MINMAX__SSE2, a_scale) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 88 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 89 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 90 | for (float a_scale = 1.0e-2; a_scale < 1.0e+2; a_scale *= 1.7f) { |
| 91 | VAddMicrokernelTester() |
| 92 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 93 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 94 | .a_scale(a_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 95 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 100 | TEST(QU8_VADD_MINMAX__SSE2, b_scale) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 101 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 102 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 103 | for (float b_scale = 1.0e-2; b_scale < 1.0e+2; b_scale *= 1.7f) { |
| 104 | VAddMicrokernelTester() |
| 105 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 106 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 107 | .b_scale(b_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 108 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 113 | TEST(QU8_VADD_MINMAX__SSE2, y_scale) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 114 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 115 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 116 | for (float y_scale = 1.0e-2; y_scale < 1.0e+2; y_scale *= 1.7f) { |
| 117 | VAddMicrokernelTester() |
| 118 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 119 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 120 | .y_scale(y_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 121 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 122 | } |
| 123 | } |
| 124 | } |
| 125 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 126 | TEST(QU8_VADD_MINMAX__SSE2, a_zero_point) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 127 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 128 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 129 | for (int32_t a_zero_point = 0; a_zero_point <= 255; a_zero_point += 51) { |
| 130 | VAddMicrokernelTester() |
| 131 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 132 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 133 | .a_zero_point(uint8_t(a_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 134 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 139 | TEST(QU8_VADD_MINMAX__SSE2, b_zero_point) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 140 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 141 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 142 | for (int32_t b_zero_point = 0; b_zero_point <= 255; b_zero_point += 51) { |
| 143 | VAddMicrokernelTester() |
| 144 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 145 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 146 | .b_zero_point(uint8_t(b_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 147 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 152 | TEST(QU8_VADD_MINMAX__SSE2, y_zero_point) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 153 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 154 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 155 | for (int32_t y_zero_point = 0; y_zero_point <= 255; y_zero_point += 51) { |
| 156 | VAddMicrokernelTester() |
| 157 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 158 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 159 | .y_zero_point(uint8_t(y_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 160 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 165 | TEST(QU8_VADD_MINMAX__SSE2, qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 166 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 167 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 168 | VAddMicrokernelTester() |
| 169 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 170 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 171 | .qmin(128) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 172 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 173 | } |
| 174 | } |
| 175 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 176 | TEST(QU8_VADD_MINMAX__SSE2, qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 177 | TEST_REQUIRES_X86_SSE2; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 178 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 179 | VAddMicrokernelTester() |
| 180 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 181 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 182 | .qmax(128) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 183 | .Test(xnn_qu8_vadd_minmax_ukernel__sse2); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 184 | } |
| 185 | } |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 186 | #endif // XNN_ARCH_X86 || XNN_ARCH_X86_64 |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 187 | |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 188 | #if XNN_ARCH_ARM || XNN_ARCH_ARM64 |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 189 | TEST(QU8_VADD_MINMAX__NEON, n_eq_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 190 | TEST_REQUIRES_ARM_NEON; |
| 191 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 192 | .batch_size(8) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 193 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 194 | } |
| 195 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 196 | TEST(QU8_VADD_MINMAX__NEON, n_div_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 197 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 198 | for (size_t batch_size = 8; batch_size < 128; batch_size += 24) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 199 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 200 | .batch_size(batch_size) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 201 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 202 | } |
| 203 | } |
| 204 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 205 | TEST(QU8_VADD_MINMAX__NEON, n_gt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 206 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 207 | for (size_t batch_size = 9; batch_size < 16; batch_size++) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 208 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 209 | .batch_size(batch_size) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 210 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 211 | } |
| 212 | } |
| 213 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 214 | TEST(QU8_VADD_MINMAX__NEON, n_lt_8) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 215 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 216 | for (size_t batch_size = 1; batch_size < 8; batch_size++) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 217 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 218 | .batch_size(batch_size) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 219 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 220 | } |
| 221 | } |
| 222 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 223 | TEST(QU8_VADD_MINMAX__NEON, inplace_a) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 224 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 225 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 226 | VAddMicrokernelTester() |
| 227 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 228 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 229 | .inplace_a(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 230 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 231 | } |
| 232 | } |
| 233 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 234 | TEST(QU8_VADD_MINMAX__NEON, inplace_b) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 235 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 236 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 237 | VAddMicrokernelTester() |
| 238 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 239 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 240 | .inplace_b(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 241 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 242 | } |
| 243 | } |
| 244 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 245 | TEST(QU8_VADD_MINMAX__NEON, inplace_a_and_b) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 246 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 247 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 248 | VAddMicrokernelTester() |
| 249 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 250 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 251 | .inplace_a(true) |
| 252 | .inplace_b(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 253 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 254 | } |
| 255 | } |
| 256 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 257 | TEST(QU8_VADD_MINMAX__NEON, a_scale) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 258 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 259 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 260 | for (float a_scale = 1.0e-2; a_scale < 1.0e+2; a_scale *= 1.7f) { |
| 261 | VAddMicrokernelTester() |
| 262 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 263 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 264 | .a_scale(a_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 265 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 266 | } |
| 267 | } |
| 268 | } |
| 269 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 270 | TEST(QU8_VADD_MINMAX__NEON, b_scale) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 271 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 272 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 273 | for (float b_scale = 1.0e-2; b_scale < 1.0e+2; b_scale *= 1.7f) { |
| 274 | VAddMicrokernelTester() |
| 275 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 276 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 277 | .b_scale(b_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 278 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 283 | TEST(QU8_VADD_MINMAX__NEON, y_scale) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 284 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 285 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 286 | for (float y_scale = 1.0e-2; y_scale < 1.0e+2; y_scale *= 1.7f) { |
| 287 | VAddMicrokernelTester() |
| 288 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 289 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 290 | .y_scale(y_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 291 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 292 | } |
| 293 | } |
| 294 | } |
| 295 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 296 | TEST(QU8_VADD_MINMAX__NEON, a_zero_point) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 297 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 298 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 299 | for (int32_t a_zero_point = 0; a_zero_point <= 255; a_zero_point += 51) { |
| 300 | VAddMicrokernelTester() |
| 301 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 302 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 303 | .a_zero_point(uint8_t(a_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 304 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 305 | } |
| 306 | } |
| 307 | } |
| 308 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 309 | TEST(QU8_VADD_MINMAX__NEON, b_zero_point) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 310 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 311 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 312 | for (int32_t b_zero_point = 0; b_zero_point <= 255; b_zero_point += 51) { |
| 313 | VAddMicrokernelTester() |
| 314 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 315 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 316 | .b_zero_point(uint8_t(b_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 317 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 318 | } |
| 319 | } |
| 320 | } |
| 321 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 322 | TEST(QU8_VADD_MINMAX__NEON, y_zero_point) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 323 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 324 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 325 | for (int32_t y_zero_point = 0; y_zero_point <= 255; y_zero_point += 51) { |
| 326 | VAddMicrokernelTester() |
| 327 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 328 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 329 | .y_zero_point(uint8_t(y_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 330 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 335 | TEST(QU8_VADD_MINMAX__NEON, qmin) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 336 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 337 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 338 | VAddMicrokernelTester() |
| 339 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 340 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 341 | .qmin(128) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 342 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 343 | } |
| 344 | } |
| 345 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 346 | TEST(QU8_VADD_MINMAX__NEON, qmax) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 347 | TEST_REQUIRES_ARM_NEON; |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 348 | for (size_t batch_size = 1; batch_size < 128; batch_size += 11) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 349 | VAddMicrokernelTester() |
| 350 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 351 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 352 | .qmax(128) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 353 | .Test(xnn_qu8_vadd_minmax_ukernel__neon); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 354 | } |
| 355 | } |
Marat Dukhan | 1dadbf7 | 2019-10-01 10:46:20 -0700 | [diff] [blame] | 356 | #endif // XNN_ARCH_ARM || XNN_ARCH_ARM64 |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 357 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 358 | TEST(QU8_VADD_MINMAX__SCALAR, n_eq_1) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 359 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 360 | .batch_size(1) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 361 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 362 | } |
| 363 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 364 | TEST(QU8_VADD_MINMAX__SCALAR, n_gt_1) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 365 | for (size_t batch_size = 2; batch_size < 8; batch_size++) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 366 | VAddMicrokernelTester() |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 367 | .batch_size(batch_size) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 368 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 369 | } |
| 370 | } |
| 371 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 372 | TEST(QU8_VADD_MINMAX__SCALAR, inplace_a) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 373 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 374 | VAddMicrokernelTester() |
| 375 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 376 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 377 | .inplace_a(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 378 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 379 | } |
| 380 | } |
| 381 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 382 | TEST(QU8_VADD_MINMAX__SCALAR, inplace_b) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 383 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 384 | VAddMicrokernelTester() |
| 385 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 386 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 387 | .inplace_b(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 388 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 389 | } |
| 390 | } |
| 391 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 392 | TEST(QU8_VADD_MINMAX__SCALAR, inplace_a_and_b) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 393 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 394 | VAddMicrokernelTester() |
| 395 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 396 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 397 | .inplace_a(true) |
| 398 | .inplace_b(true) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 399 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 400 | } |
| 401 | } |
| 402 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 403 | TEST(QU8_VADD_MINMAX__SCALAR, a_scale) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 404 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 405 | for (float a_scale = 1.0e-2; a_scale < 1.0e+2; a_scale *= 1.7f) { |
| 406 | VAddMicrokernelTester() |
| 407 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 408 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 409 | .a_scale(a_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 410 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 411 | } |
| 412 | } |
| 413 | } |
| 414 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 415 | TEST(QU8_VADD_MINMAX__SCALAR, b_scale) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 416 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 417 | for (float b_scale = 1.0e-2; b_scale < 1.0e+2; b_scale *= 1.7f) { |
| 418 | VAddMicrokernelTester() |
| 419 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 420 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 421 | .b_scale(b_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 422 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 423 | } |
| 424 | } |
| 425 | } |
| 426 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 427 | TEST(QU8_VADD_MINMAX__SCALAR, y_scale) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 428 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 429 | for (float y_scale = 1.0e-2; y_scale < 1.0e+2; y_scale *= 1.7f) { |
| 430 | VAddMicrokernelTester() |
| 431 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 432 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 433 | .y_scale(y_scale) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 434 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 435 | } |
| 436 | } |
| 437 | } |
| 438 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 439 | TEST(QU8_VADD_MINMAX__SCALAR, a_zero_point) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 440 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 441 | for (int32_t a_zero_point = 0; a_zero_point <= 255; a_zero_point += 51) { |
| 442 | VAddMicrokernelTester() |
| 443 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 444 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 445 | .a_zero_point(uint8_t(a_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 446 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 451 | TEST(QU8_VADD_MINMAX__SCALAR, b_zero_point) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 452 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 453 | for (int32_t b_zero_point = 0; b_zero_point <= 255; b_zero_point += 51) { |
| 454 | VAddMicrokernelTester() |
| 455 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 456 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 457 | .b_zero_point(uint8_t(b_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 458 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 459 | } |
| 460 | } |
| 461 | } |
| 462 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 463 | TEST(QU8_VADD_MINMAX__SCALAR, y_zero_point) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 464 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 465 | for (int32_t y_zero_point = 0; y_zero_point <= 255; y_zero_point += 51) { |
| 466 | VAddMicrokernelTester() |
| 467 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 468 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 469 | .y_zero_point(uint8_t(y_zero_point)) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 470 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 471 | } |
| 472 | } |
| 473 | } |
| 474 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 475 | TEST(QU8_VADD_MINMAX__SCALAR, qmin) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 476 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 477 | VAddMicrokernelTester() |
| 478 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 479 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 480 | .qmin(128) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 481 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 482 | } |
| 483 | } |
| 484 | |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 485 | TEST(QU8_VADD_MINMAX__SCALAR, qmax) { |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 486 | for (size_t batch_size = 1; batch_size < 16; batch_size += 3) { |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 487 | VAddMicrokernelTester() |
| 488 | .iterations(1) |
Marat Dukhan | d9f3ad4 | 2020-08-10 12:30:58 -0700 | [diff] [blame] | 489 | .batch_size(batch_size) |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 490 | .qmax(128) |
Marat Dukhan | 08b7a97 | 2020-07-14 18:17:29 -0700 | [diff] [blame] | 491 | .Test(xnn_qu8_vadd_minmax_ukernel__scalar, VAddMicrokernelTester::Variant::Scalar); |
XNNPACK Team | b455b12 | 2019-09-27 18:10:33 -0700 | [diff] [blame] | 492 | } |
| 493 | } |