blob: 04e754dfcaebba04d7596cf0bf6706417f00b477 [file] [log] [blame]
// Copyright 2019 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.
#include <gtest/gtest.h>
#include <xnnpack/common.h>
#include <xnnpack/isa-checks.h>
#include <xnnpack/raddextexp.h>
#include "raddextexp-microkernel-tester.h"
#if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_RADDEXTEXP__AVX512F_P5_SCALEF_UNROLL128, n_lt_128) {
TEST_REQUIRES_X86_AVX512F;
for (size_t n = 1; n < 128; n++) {
RAddExtExpMicrokernelTester()
.n(n)
.test(xnn_f32_raddextexp_ukernel__avx512f_p5_scalef_unroll128);
}
}
TEST(F32_RADDEXTEXP__AVX512F_P5_SCALEF_UNROLL128, n_eq_128) {
TEST_REQUIRES_X86_AVX512F;
RAddExtExpMicrokernelTester()
.n(128)
.test(xnn_f32_raddextexp_ukernel__avx512f_p5_scalef_unroll128);
}
TEST(F32_RADDEXTEXP__AVX512F_P5_SCALEF_UNROLL128, n_div_128) {
TEST_REQUIRES_X86_AVX512F;
for (size_t n = 256; n < 768; n += 128) {
RAddExtExpMicrokernelTester()
.n(n)
.test(xnn_f32_raddextexp_ukernel__avx512f_p5_scalef_unroll128);
}
}
TEST(F32_RADDEXTEXP__AVX512F_P5_SCALEF_UNROLL128, n_gt_128) {
TEST_REQUIRES_X86_AVX512F;
for (size_t n = 128; n < 256; n++) {
RAddExtExpMicrokernelTester()
.n(n)
.test(xnn_f32_raddextexp_ukernel__avx512f_p5_scalef_unroll128);
}
}
#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64
#if XNN_ARCH_X86 || XNN_ARCH_X86_64
TEST(F32_RADDEXTEXP__AVX2_P5_UNROLL64, n_lt_64) {
TEST_REQUIRES_X86_AVX2;
for (size_t n = 1; n < 64; n++) {
RAddExtExpMicrokernelTester()
.n(n)
.test(xnn_f32_raddextexp_ukernel__avx2_p5_unroll64);
}
}
TEST(F32_RADDEXTEXP__AVX2_P5_UNROLL64, n_eq_64) {
TEST_REQUIRES_X86_AVX2;
RAddExtExpMicrokernelTester()
.n(64)
.test(xnn_f32_raddextexp_ukernel__avx2_p5_unroll64);
}
TEST(F32_RADDEXTEXP__AVX2_P5_UNROLL64, n_div_64) {
TEST_REQUIRES_X86_AVX2;
for (size_t n = 128; n < 384; n += 64) {
RAddExtExpMicrokernelTester()
.n(n)
.test(xnn_f32_raddextexp_ukernel__avx2_p5_unroll64);
}
}
TEST(F32_RADDEXTEXP__AVX2_P5_UNROLL64, n_gt_64) {
TEST_REQUIRES_X86_AVX2;
for (size_t n = 64; n < 128; n++) {
RAddExtExpMicrokernelTester()
.n(n)
.test(xnn_f32_raddextexp_ukernel__avx2_p5_unroll64);
}
}
#endif // XNN_ARCH_X86 || XNN_ARCH_X86_64