blob: 4acfec89ded9901d21466a4d14b6df142b7864ee [file] [log] [blame]
XNNPACK Teamb455b122019-09-27 18:10:33 -07001// 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>
XNNPACK Teamb455b122019-09-27 18:10:33 -070012#include "lut-microkernel-tester.h"
13
14
15TEST(X8_LUT__SCALAR, n_eq_1) {
16 LUTMicrokernelTester()
17 .n(1)
18 .Test(xnn_x8_lut_ukernel__scalar);
19}
20
21TEST(X8_LUT__SCALAR, small_n) {
22 for (size_t n = 2; n <= 16; n++) {
23 LUTMicrokernelTester()
24 .n(n)
25 .Test(xnn_x8_lut_ukernel__scalar);
26 }
27}
28
29TEST(X8_LUT__SCALAR, large_n) {
30 for (size_t n = 16; n <= 128; n+=2) {
31 LUTMicrokernelTester()
32 .n(n)
33 .Test(xnn_x8_lut_ukernel__scalar);
34 }
35}
36
37TEST(X8_LUT__SCALAR, n_eq_1_inplace) {
38 LUTMicrokernelTester()
39 .n(1)
40 .inplace(true)
41 .Test(xnn_x8_lut_ukernel__scalar);
42}
43
44TEST(X8_LUT__SCALAR, small_n_inplace) {
45 for (size_t n = 2; n <= 16; n++) {
46 LUTMicrokernelTester()
47 .n(n)
48 .inplace(true)
49 .Test(xnn_x8_lut_ukernel__scalar);
50 }
51}
52
53TEST(X8_LUT__SCALAR, large_n_inplace) {
54 for (size_t n = 16; n <= 128; n+=2) {
55 LUTMicrokernelTester()
56 .n(n)
57 .inplace(true)
58 .Test(xnn_x8_lut_ukernel__scalar);
59 }
60}