kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

select.cpp (807B)


      1 /**
      2  * KFR (https://www.kfrlib.com)
      3  * Copyright (C) 2016-2023 Dan Cazarin
      4  * See LICENSE.txt for details
      5  */
      6 
      7 #include <kfr/simd/select.hpp>
      8 
      9 namespace kfr
     10 {
     11 inline namespace CMT_ARCH_NAME
     12 {
     13 TEST(select_true)
     14 {
     15     test_function2(
     16         test_catogories::vectors,
     17         [](auto x, auto y)
     18         {
     19             mask<subtype<decltype(x)>, decltype(x)::scalar_size()> m(true);
     20             return kfr::select(m, x, y);
     21         },
     22         [](auto x, auto) { return x; });
     23 }
     24 
     25 TEST(select_false)
     26 {
     27     test_function2(
     28         test_catogories::vectors,
     29         [](auto x, auto y)
     30         {
     31             mask<subtype<decltype(x)>, decltype(x)::scalar_size()> m(false);
     32             return kfr::select(m, x, y);
     33         },
     34         [](auto, auto y) { return y; });
     35 }
     36 } // namespace CMT_ARCH_NAME
     37 } // namespace kfr