1 // Copyright 2020 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 <gtest/gtest.h>
7
8 #include "negate-operator-tester.h"
9
10
TEST(NEGATE_NC_F32,unit_batch)11 TEST(NEGATE_NC_F32, unit_batch) {
12 for (size_t channels = 1; channels < 100; channels++) {
13 NegateOperatorTester()
14 .batch_size(1)
15 .channels(channels)
16 .iterations(3)
17 .TestF32();
18 }
19 }
20
TEST(NEGATE_NC_F32,small_batch)21 TEST(NEGATE_NC_F32, small_batch) {
22 for (size_t channels = 1; channels < 100; channels++) {
23 NegateOperatorTester()
24 .batch_size(3)
25 .channels(channels)
26 .iterations(3)
27 .TestF32();
28 }
29 }
30
TEST(NEGATE_NC_F32,small_batch_with_input_stride)31 TEST(NEGATE_NC_F32, small_batch_with_input_stride) {
32 for (size_t channels = 1; channels < 100; channels += 15) {
33 NegateOperatorTester()
34 .batch_size(3)
35 .channels(channels)
36 .input_stride(129)
37 .iterations(3)
38 .TestF32();
39 }
40 }
41
TEST(NEGATE_NC_F32,small_batch_with_output_stride)42 TEST(NEGATE_NC_F32, small_batch_with_output_stride) {
43 for (size_t channels = 1; channels < 100; channels += 15) {
44 NegateOperatorTester()
45 .batch_size(3)
46 .channels(channels)
47 .output_stride(117)
48 .iterations(3)
49 .TestF32();
50 }
51 }
52
TEST(NEGATE_NC_F32,small_batch_with_input_and_output_stride)53 TEST(NEGATE_NC_F32, small_batch_with_input_and_output_stride) {
54 for (size_t channels = 1; channels < 100; channels += 15) {
55 NegateOperatorTester()
56 .batch_size(3)
57 .channels(channels)
58 .input_stride(129)
59 .output_stride(117)
60 .iterations(3)
61 .TestF32();
62 }
63 }
64