aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2022-08-24 16:24:05 -0700
committerXNNPACK Team <xnnpack-github-robot@google.com>2022-08-24 16:25:03 -0700
commitfee9675af8160c6d0474c87174785b586121b151 (patch)
treecf9111feb51100e282055fed90af7b99f050c2fb
parentcceec276e00405417c7caadfe8e3ef7f8f0af8b3 (diff)
downloadXNNPACK-fee9675af8160c6d0474c87174785b586121b151.tar.gz
FILTERBANK-ACCUMULATE microkernel test multiple rows
PiperOrigin-RevId: 469851386
-rw-r--r--test/filterbank-accumulate-microkernel-tester.h6
-rw-r--r--test/u32-filterbank-accumulate.cc90
-rwxr-xr-xtools/generate-filterbank-accumulate-test.py14
3 files changed, 93 insertions, 17 deletions
diff --git a/test/filterbank-accumulate-microkernel-tester.h b/test/filterbank-accumulate-microkernel-tester.h
index 4a1a705a0..61e427893 100644
--- a/test/filterbank-accumulate-microkernel-tester.h
+++ b/test/filterbank-accumulate-microkernel-tester.h
@@ -56,12 +56,10 @@ class FilterbankAccumulateMicrokernelTester {
std::generate(filterbank_widths.begin(), filterbank_widths.end(), std::ref(u8rng));
const size_t num_channels = std::accumulate(filterbank_widths.cbegin(), filterbank_widths.cend(), 0);
- std::vector<uint32_t> input(num_channels + XNN_EXTRA_BYTES / sizeof(int16_t));
+ std::vector<uint32_t> input(num_channels);
+ std::vector<uint16_t> weights(num_channels * 2);
std::generate(input.begin(), input.end(), std::ref(u32rng));
-
- std::vector<uint16_t> weights(num_channels * 2 + XNN_EXTRA_BYTES / sizeof(uint16_t));
std::generate(weights.begin(), weights.end(), std::ref(u16rng));
-
std::fill(output.begin(), output.end(), UINT64_C(0xCAFEB0BADEADBEAF));
uint64_t weight_accumulator = 0;
diff --git a/test/u32-filterbank-accumulate.cc b/test/u32-filterbank-accumulate.cc
index 655c9e810..0669af136 100644
--- a/test/u32-filterbank-accumulate.cc
+++ b/test/u32-filterbank-accumulate.cc
@@ -1,4 +1,4 @@
-// Copyright 2019 Google LLC
+// Copyright 2022 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
@@ -17,14 +17,92 @@
#include "filterbank-accumulate-microkernel-tester.h"
+#if XNN_ARCH_ARM
+ TEST(U32_FILTERBANK_ACCUMULATE__AARCH32_NEON_X1, rows_eq_1) {
+ TEST_REQUIRES_ARM_NEON;
+ FilterbankAccumulateMicrokernelTester()
+ .rows(1)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__aarch32_neon_x1);
+ }
+
+ TEST(U32_FILTERBANK_ACCUMULATE__AARCH32_NEON_X1, rows_gt_1) {
+ TEST_REQUIRES_ARM_NEON;
+ for (size_t rows = 2; rows < 10; rows++) {
+ FilterbankAccumulateMicrokernelTester()
+ .rows(rows)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__aarch32_neon_x1);
+ }
+ }
+#endif // XNN_ARCH_ARM
+
+
+#if XNN_ARCH_ARM
+ TEST(U32_FILTERBANK_ACCUMULATE__AARCH32_NEON_X2, rows_eq_1) {
+ TEST_REQUIRES_ARM_NEON;
+ FilterbankAccumulateMicrokernelTester()
+ .rows(1)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__aarch32_neon_x2);
+ }
+
+ TEST(U32_FILTERBANK_ACCUMULATE__AARCH32_NEON_X2, rows_gt_1) {
+ TEST_REQUIRES_ARM_NEON;
+ for (size_t rows = 2; rows < 10; rows++) {
+ FilterbankAccumulateMicrokernelTester()
+ .rows(rows)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__aarch32_neon_x2);
+ }
+ }
+#endif // XNN_ARCH_ARM
+
+
+#if XNN_ARCH_ARM || XNN_ARCH_ARM64
+ TEST(U32_FILTERBANK_ACCUMULATE__NEON_X1, rows_eq_1) {
+ TEST_REQUIRES_ARM_NEON;
+ FilterbankAccumulateMicrokernelTester()
+ .rows(1)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__neon_x1);
+ }
+
+ TEST(U32_FILTERBANK_ACCUMULATE__NEON_X1, rows_gt_1) {
+ TEST_REQUIRES_ARM_NEON;
+ for (size_t rows = 2; rows < 10; rows++) {
+ FilterbankAccumulateMicrokernelTester()
+ .rows(rows)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__neon_x1);
+ }
+ }
+#endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
+
+
+#if XNN_ARCH_ARM || XNN_ARCH_ARM64
+ TEST(U32_FILTERBANK_ACCUMULATE__NEON_X2, rows_eq_1) {
+ TEST_REQUIRES_ARM_NEON;
+ FilterbankAccumulateMicrokernelTester()
+ .rows(1)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__neon_x2);
+ }
+
+ TEST(U32_FILTERBANK_ACCUMULATE__NEON_X2, rows_gt_1) {
+ TEST_REQUIRES_ARM_NEON;
+ for (size_t rows = 2; rows < 10; rows++) {
+ FilterbankAccumulateMicrokernelTester()
+ .rows(rows)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__neon_x2);
+ }
+ }
+#endif // XNN_ARCH_ARM || XNN_ARCH_ARM64
+
+
TEST(U32_FILTERBANK_ACCUMULATE__SCALAR_X1, rows_eq_1) {
FilterbankAccumulateMicrokernelTester()
.rows(1)
.Test(xnn_u32_filterbank_accumulate_ukernel__scalar_x1);
}
-TEST(U32_FILTERBANK_ACCUMULATE__SCALAR_X1, rows_eq_2) {
- FilterbankAccumulateMicrokernelTester()
- .rows(2)
- .Test(xnn_u32_filterbank_accumulate_ukernel__scalar_x1);
-}
+TEST(U32_FILTERBANK_ACCUMULATE__SCALAR_X1, rows_gt_1) {
+ for (size_t rows = 2; rows < 10; rows++) {
+ FilterbankAccumulateMicrokernelTester()
+ .rows(rows)
+ .Test(xnn_u32_filterbank_accumulate_ukernel__scalar_x1);
+ }
+} \ No newline at end of file
diff --git a/tools/generate-filterbank-accumulate-test.py b/tools/generate-filterbank-accumulate-test.py
index 2139a897e..9d7dd92c5 100755
--- a/tools/generate-filterbank-accumulate-test.py
+++ b/tools/generate-filterbank-accumulate-test.py
@@ -47,15 +47,15 @@ TEST(${TEST_NAME}, rows_eq_1) {
.Test(${", ".join(TEST_ARGS)});
}
-TEST(${TEST_NAME}, rows_eq_2) {
+TEST(${TEST_NAME}, rows_gt_1) {
$if ISA_CHECK:
${ISA_CHECK};
- FilterbankAccumulateMicrokernelTester()
- .rows(2)
- .Test(${", ".join(TEST_ARGS)});
+ for (size_t rows = 2; rows < 10; rows++) {
+ FilterbankAccumulateMicrokernelTester()
+ .rows(rows)
+ .Test(${", ".join(TEST_ARGS)});
+ }
}
-
-
"""
@@ -96,7 +96,7 @@ def main(args):
raise ValueError("expected a list of micro-kernels in the spec")
tests = """\
-// Copyright 2019 Google LLC
+// Copyright 2022 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.