Ardour  9.0-pre0-582-g084a23a80d
fpu_test.h
Go to the documentation of this file.
1 #include <cppunit/TestFixture.h>
2 #include <cppunit/extensions/HelperMacros.h>
3 
5 
6 class FPUTest : public CppUnit::TestFixture
7 {
9 #if defined(ARCH_X86) && defined(BUILD_SSE_OPTIMIZATIONS)
10  CPPUNIT_TEST (sseTest);
11  CPPUNIT_TEST (avxTest);
12  CPPUNIT_TEST (avxFmaTest);
13  CPPUNIT_TEST (avx512fTest);
14 #elif defined ARM_NEON_SUPPORT
15  CPPUNIT_TEST (neonTest);
16 #elif defined(__APPLE__) && defined(BUILD_VECLIB_OPTIMIZATIONS)
17  CPPUNIT_TEST (veclibTest);
18 #else
20 #endif
22 
23 public:
24  void setUp ();
25  void tearDown ();
26 
27 #if defined(ARCH_X86) && defined(BUILD_SSE_OPTIMIZATIONS)
28  void avxFmaTest ();
29  void avxTest ();
30  void avx512fTest ();
31  void sseTest ();
32 #elif defined ARM_NEON_SUPPORT
33  void neonTest ();
34 #elif defined(__APPLE__) && defined(BUILD_VECLIB_OPTIMIZATIONS)
35  void veclibTest ();
36 #else
37  void noTest ();
38 #endif
39 
40 private:
41  void run (size_t, float const max_diff = 0);
42  void compare (std::string, size_t, float const max_diff = 0);
43 
50 
51  size_t _size;
52 
53  float* _test1;
54  float* _test2;
55  float* _comp1;
56  float* _comp2;
57 };
void compare(std::string, size_t, float const max_diff=0)
ARDOUR::mix_buffers_with_gain_t mix_buffers_with_gain
Definition: fpu_test.h:47
float * _comp2
Definition: fpu_test.h:56
size_t _size
Definition: fpu_test.h:51
CPPUNIT_TEST(noTest)
ARDOUR::find_peaks_t find_peaks
Definition: fpu_test.h:45
float * _test2
Definition: fpu_test.h:54
void setUp()
float * _test1
Definition: fpu_test.h:53
ARDOUR::copy_vector_t copy_vector
Definition: fpu_test.h:49
CPPUNIT_TEST_SUITE(FPUTest)
void tearDown()
void noTest()
ARDOUR::apply_gain_to_buffer_t apply_gain_to_buffer
Definition: fpu_test.h:46
float * _comp1
Definition: fpu_test.h:55
void run(size_t, float const max_diff=0)
ARDOUR::mix_buffers_no_gain_t mix_buffers_no_gain
Definition: fpu_test.h:48
CPPUNIT_TEST_SUITE_END()
ARDOUR::compute_peak_t compute_peak
Definition: fpu_test.h:44
void(* mix_buffers_with_gain_t)(ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t, float)
float(* compute_peak_t)(const ARDOUR::Sample *, pframes_t, float)
void(* apply_gain_to_buffer_t)(ARDOUR::Sample *, pframes_t, float)
void(* copy_vector_t)(ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t)
void(* mix_buffers_no_gain_t)(ARDOUR::Sample *, const ARDOUR::Sample *, pframes_t)
void(* find_peaks_t)(const ARDOUR::Sample *, pframes_t, float *, float *)