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
9 #include <gtest/gtest.h>
10
11 #include <xnnpack/lut.h>
12 #include "lut-norm-microkernel-tester.h"
13
14
TEST(U8_LUT32NORM__SCALAR,n_eq_1)15 TEST(U8_LUT32NORM__SCALAR, n_eq_1) {
16 LUTNormMicrokernelTester()
17 .n(1)
18 .Test(xnn_u8_lut32norm_ukernel__scalar);
19 }
20
TEST(U8_LUT32NORM__SCALAR,small_n)21 TEST(U8_LUT32NORM__SCALAR, small_n) {
22 for (size_t n = 2; n <= 16; n++) {
23 LUTNormMicrokernelTester()
24 .n(n)
25 .Test(xnn_u8_lut32norm_ukernel__scalar);
26 }
27 }
28
TEST(U8_LUT32NORM__SCALAR,large_n)29 TEST(U8_LUT32NORM__SCALAR, large_n) {
30 for (size_t n = 16; n <= 128; n+=2) {
31 LUTNormMicrokernelTester()
32 .n(n)
33 .Test(xnn_u8_lut32norm_ukernel__scalar);
34 }
35 }
36
TEST(U8_LUT32NORM__SCALAR,n_eq_1_inplace)37 TEST(U8_LUT32NORM__SCALAR, n_eq_1_inplace) {
38 LUTNormMicrokernelTester()
39 .n(1)
40 .inplace(true)
41 .Test(xnn_u8_lut32norm_ukernel__scalar);
42 }
43
TEST(U8_LUT32NORM__SCALAR,small_n_inplace)44 TEST(U8_LUT32NORM__SCALAR, small_n_inplace) {
45 for (size_t n = 2; n <= 16; n++) {
46 LUTNormMicrokernelTester()
47 .n(n)
48 .inplace(true)
49 .Test(xnn_u8_lut32norm_ukernel__scalar);
50 }
51 }
52
TEST(U8_LUT32NORM__SCALAR,large_n_inplace)53 TEST(U8_LUT32NORM__SCALAR, large_n_inplace) {
54 for (size_t n = 16; n <= 128; n+=2) {
55 LUTNormMicrokernelTester()
56 .n(n)
57 .inplace(true)
58 .Test(xnn_u8_lut32norm_ukernel__scalar);
59 }
60 }
61