• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // 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 // Auto-generated file. Do not edit!
7 //   Specification: test/f16-relu.yaml
8 //   Generator: tools/generate-vunary-test.py
9 
10 
11 #include <gtest/gtest.h>
12 
13 #include <xnnpack/common.h>
14 #include <xnnpack/isa-checks.h>
15 
16 #include <xnnpack/vunary.h>
17 #include "vunary-microkernel-tester.h"
18 
19 
20 #if XNN_ARCH_ARM64
TEST(F16_RELU__NEONFP16ARITH_X8,batch_eq_8)21   TEST(F16_RELU__NEONFP16ARITH_X8, batch_eq_8) {
22     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
23     VUnOpMicrokernelTester()
24       .batch_size(8)
25       .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x8), VUnOpMicrokernelTester::OpType::ReLU);
26   }
27 
TEST(F16_RELU__NEONFP16ARITH_X8,batch_div_8)28   TEST(F16_RELU__NEONFP16ARITH_X8, batch_div_8) {
29     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
30     for (size_t batch_size = 16; batch_size < 80; batch_size += 8) {
31       VUnOpMicrokernelTester()
32         .batch_size(batch_size)
33         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x8), VUnOpMicrokernelTester::OpType::ReLU);
34     }
35   }
36 
TEST(F16_RELU__NEONFP16ARITH_X8,batch_lt_8)37   TEST(F16_RELU__NEONFP16ARITH_X8, batch_lt_8) {
38     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
39     for (size_t batch_size = 1; batch_size < 8; batch_size++) {
40       VUnOpMicrokernelTester()
41         .batch_size(batch_size)
42         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x8), VUnOpMicrokernelTester::OpType::ReLU);
43     }
44   }
45 
TEST(F16_RELU__NEONFP16ARITH_X8,batch_gt_8)46   TEST(F16_RELU__NEONFP16ARITH_X8, batch_gt_8) {
47     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
48     for (size_t batch_size = 9; batch_size < 16; batch_size++) {
49       VUnOpMicrokernelTester()
50         .batch_size(batch_size)
51         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x8), VUnOpMicrokernelTester::OpType::ReLU);
52     }
53   }
54 
TEST(F16_RELU__NEONFP16ARITH_X8,inplace)55   TEST(F16_RELU__NEONFP16ARITH_X8, inplace) {
56     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
57     for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) {
58       VUnOpMicrokernelTester()
59         .batch_size(batch_size)
60         .inplace(true)
61         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x8), VUnOpMicrokernelTester::OpType::ReLU);
62     }
63   }
64 #endif  // XNN_ARCH_ARM64
65 
66 
67 #if XNN_ARCH_ARM64
TEST(F16_RELU__NEONFP16ARITH_X16,batch_eq_16)68   TEST(F16_RELU__NEONFP16ARITH_X16, batch_eq_16) {
69     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
70     VUnOpMicrokernelTester()
71       .batch_size(16)
72       .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x16), VUnOpMicrokernelTester::OpType::ReLU);
73   }
74 
TEST(F16_RELU__NEONFP16ARITH_X16,batch_div_16)75   TEST(F16_RELU__NEONFP16ARITH_X16, batch_div_16) {
76     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
77     for (size_t batch_size = 32; batch_size < 160; batch_size += 16) {
78       VUnOpMicrokernelTester()
79         .batch_size(batch_size)
80         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x16), VUnOpMicrokernelTester::OpType::ReLU);
81     }
82   }
83 
TEST(F16_RELU__NEONFP16ARITH_X16,batch_lt_16)84   TEST(F16_RELU__NEONFP16ARITH_X16, batch_lt_16) {
85     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
86     for (size_t batch_size = 1; batch_size < 16; batch_size++) {
87       VUnOpMicrokernelTester()
88         .batch_size(batch_size)
89         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x16), VUnOpMicrokernelTester::OpType::ReLU);
90     }
91   }
92 
TEST(F16_RELU__NEONFP16ARITH_X16,batch_gt_16)93   TEST(F16_RELU__NEONFP16ARITH_X16, batch_gt_16) {
94     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
95     for (size_t batch_size = 17; batch_size < 32; batch_size++) {
96       VUnOpMicrokernelTester()
97         .batch_size(batch_size)
98         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x16), VUnOpMicrokernelTester::OpType::ReLU);
99     }
100   }
101 
TEST(F16_RELU__NEONFP16ARITH_X16,inplace)102   TEST(F16_RELU__NEONFP16ARITH_X16, inplace) {
103     TEST_REQUIRES_ARM_NEON_FP16_ARITH;
104     for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) {
105       VUnOpMicrokernelTester()
106         .batch_size(batch_size)
107         .inplace(true)
108         .Test(xnn_f32_vunary_ukernel_function(xnn_f16_relu_ukernel__neonfp16arith_x16), VUnOpMicrokernelTester::OpType::ReLU);
109     }
110   }
111 #endif  // XNN_ARCH_ARM64
112