Ocean
TestFourierTransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_FOURIER_TRANSFORM_H
9 #define META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_FOURIER_TRANSFORM_H
10 
12 
13 namespace Ocean
14 {
15 
16 namespace Test
17 {
18 
19 namespace TestCV
20 {
21 
22 namespace TestOpenCV
23 {
24 
25 /**
26  * This class tests the performance of Fourier transform algorithms.
27  * @ingroup testcvopencv
28  */
29 class OCEAN_TEST_CV_OPENCV_EXPORT TestFourierTransform
30 {
31  public:
32 
33  /**
34  * Runs the test, validates the code and benchmarks the performance.
35  * @param testDuration Number of seconds for each test, with range (0, infinity)
36  * @return True if all tests passed, otherwise false
37  */
38  static bool test(const double testDuration);
39 
40  /**
41  * Benchmarks the FFT performance and validate the results, i.e., identical results with OpenCV
42  * @param testDuration Number of seconds for each test, with range (0, infinity)
43  * @return True if the validation was successul, otherwise false
44  * @tparam TDataType Data type used to test this function, valid values: `float` or `double`
45  */
46  template <typename TDataType>
47  static bool testFFT(const double testDuration);
48 
49  /**
50  * Uses random data with padding in order to benchmark the FFT performance and validate the results, i.e., identical results with OpenCV
51  * @param testDuration Number of seconds for each test, with range (0, infinity)
52  * @return True if the validation was successul, otherwise false
53  * @tparam TDataType Data type used to test this function, valid values: `float` or `double`
54  */
55  template <typename TDataType>
56  static bool testFFTPadding(const double testDuration);
57 
58  /**
59  * Benchmarks and validate the FFT performance using the CCS-packed format.
60  * @param testDuration Number of seconds for each test, with range (0, infinity)
61  * @return True if the validation was successful, otherwise false
62  */
63  static bool testElementwiseMultiplicationCCS(const double testDuration);
64 
65  /**
66  * Benchmarks and validate the FFT performance using the CCS-packed format.
67  * @param testDuration Number of seconds for each test, with range (0, infinity)
68  * @return True if the validation was successful, otherwise false
69  * @tparam TElementType Type used for the test data, can be either float or double
70  * @tparam tConjugateB If true, multiply the first value with the conjugate of the second
71  */
72  template <typename TElementType, bool tConjugateB>
73  static bool testElementwiseMultiplicationCCS(const double testDuration);
74 };
75 
76 } // namespace TestOpenCV
77 
78 } // namespace TestCV
79 
80 } // namespace Test
81 
82 } // namespace Ocean
83 
84 #endif // META_OCEAN_TEST_TESTCV_TESTOPENCV_TEST_FOURIER_TRANSFORM_H
This class tests the performance of Fourier transform algorithms.
Definition: TestFourierTransform.h:30
static bool test(const double testDuration)
Runs the test, validates the code and benchmarks the performance.
static bool testElementwiseMultiplicationCCS(const double testDuration)
Benchmarks and validate the FFT performance using the CCS-packed format.
static bool testElementwiseMultiplicationCCS(const double testDuration)
Benchmarks and validate the FFT performance using the CCS-packed format.
static bool testFFTPadding(const double testDuration)
Uses random data with padding in order to benchmark the FFT performance and validate the results,...
static bool testFFT(const double testDuration)
Benchmarks the FFT performance and validate the results, i.e., identical results with OpenCV.
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15