Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / openmax_dl / dl / sp / src / test / test_fft.gyp
1 #  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
2 #
3 #  Use of this source code is governed by a BSD-style license
4 #  that can be found in the LICENSE file in the root of the source
5 #  tree. An additional intellectual property rights grant can be found
6 #  in the file PATENTS.  All contributing project authors may
7 #  be found in the AUTHORS file in the root of the source tree.
8
9 {
10   'variables' : {
11     # Override this value to build with small float FFT tables
12     'big_float_fft%' : 1,
13   },
14   'target_defaults': {
15     'include_dirs': [
16       '../../../../',
17     ],
18     'dependencies' : [
19       '../../../dl.gyp:openmax_dl',
20       'test_utilities',
21     ],
22     'conditions': [
23       ['big_float_fft == 1', {
24         'defines': [
25           'BIG_FFT_TABLE',
26         ],
27       }],
28     ],
29   },
30   'conditions': [
31     ['target_arch == "arm"', {
32       # Test programs supported on ARM
33       'targets': [
34         {
35           # Test complex fixed-point 16-bit FFT
36           'target_name': 'test_fft16',
37           'type': 'executable',
38           'sources': [
39             'test_fft16.c',
40           ],
41         },
42         {
43           # Test complex fixed-point 32-bit FFT
44           'target_name': 'test_fft32',
45           'type': 'executable',
46           'sources': [
47             'test_fft32.c',
48           ],
49         },
50         {
51           # Test real 32-bit fixed-point FFT
52           'target_name': 'test_rfft32',
53           'type': 'executable',
54           'sources': [
55             'test_rfft32.c',
56           ],
57         },
58         {
59           # Test real 16-bit fixed-point FFT implemented with S32 routines.
60           'target_name': 'test_rfft16_s32',
61           'type': 'executable',
62           'sources': [
63             'test_rfft16_s32.c',
64           ],
65         },
66         {
67           # Test real 16-bit fixed-point FFT implemented with S16 routines.
68           'target_name': 'test_rfft16_s16',
69           'type': 'executable',
70           'sources': [
71             'test_rfft16_s16.c',
72           ],
73         },
74         {
75           # Test complex floating-point FFT
76           'target_name': 'test_float_fft',
77           'type': 'executable',
78           'sources': [
79             'test_float_fft.c',
80             'support/float_fft_neon.c',
81           ],
82         },
83         # Non-NEON test programs
84         {
85           # Test complex floating-point FFT, non-NEON
86           'target_name': 'test_float_fft_armv7',
87           'type': 'executable',
88           'defines': [
89             'ARM_VFP_TEST'
90           ],
91           'sources': [
92             'test_float_fft.c',
93             'support/float_fft_armv7.c',
94           ],
95         },
96         {
97           # Test real floating-point FFT, non-NEON
98           'target_name': 'test_float_rfft_armv7',
99           'type': 'executable',
100           'sources': [
101             'test_float_rfft.c',
102             'support/float_rfft_armv7.c',
103             'support/float_rfft_thresholds.h',
104           ],
105         },
106         {
107           # Test real floating-point FFT, detecting NEON support
108           'target_name': 'test_float_rfft_detect',
109           'type': 'executable',
110           'sources': [
111             'test_float_rfft.c',
112             'support/float_rfft_detect.c',
113             'support/float_rfft_thresholds.h',
114           ],
115         },
116         {
117           # Simple timing test of FFTs, non-NEON
118           'target_name': 'test_fft_time_armv7',
119           'type': 'executable',
120           'defines': [
121             # Timing test for non-NEON is only supported for float FFTs.
122             'ARM_VFP_TEST',
123             'FLOAT_ONLY',
124           ],
125           'sources': [
126             'test_fft_time.c',
127           ],
128         },
129       ],
130     }],
131     ['target_arch == "arm64"', {
132       'targets': [
133         {
134           # Test complex floating-point FFT
135           'target_name': 'test_float_fft',
136           'type': 'executable',
137           'sources': [
138             'test_float_fft.c',
139             'support/float_fft_neon.c',
140           ],
141         },
142       ],
143     }],
144   ],
145   'targets': [
146     # Targets that should be supported by all architectures
147     {
148       # Test utilities
149       'target_name': 'test_utilities',
150       'type' : 'static_library',
151       'dependencies!' : [
152         'test_utilities'
153       ],
154       'link_settings': {
155         'libraries': [
156           '-lm',
157         ],
158       },
159       'sources' : [
160         'aligned_ptr.c',
161         'compare.c',
162         'gensig.c',
163         'test_util.c',
164         'test_util_fft.c',
165       ],
166     },
167     {
168       # Test real floating-point FFT
169       'target_name': 'test_float_rfft',
170       'type': 'executable',
171       'sources': [
172         'test_float_rfft.c',
173         'support/float_rfft_thresholds.h',
174       ],
175       'conditions': [
176         ['target_arch == "arm" or target_arch == "arm64"', {
177           'sources': [
178             'support/float_rfft_neon.c',
179           ],
180         }],
181         ['target_arch == "ia32" or target_arch == "x64"', {
182           'sources': [
183             'support/float_rfft_x86.c',
184           ],
185         }],
186         ['target_arch == "mipsel"', {
187           'sources': [
188             'support/float_rfft_mips.c',
189           ],
190         }],
191       ],
192     },
193     {
194       # Simple timing test of FFTs
195       'target_name': 'test_fft_time',
196       'type': 'executable',
197       'sources': [
198         'test_fft_time.c',
199       ],
200       'conditions': [
201         ['target_arch == "ia32" or target_arch == "x64" or target_arch == "arm64" or target_arch == "mipsel"', {
202           'defines': [
203             # Timing test only for float FFTs on x86 and arm64 and MIPSEL.
204             'FLOAT_ONLY',
205           ],
206         }],
207       ],
208     },
209     {
210       # Build all test programs.
211       'target_name': 'All',
212       'type': 'none',
213       'conditions' : [
214         ['target_arch == "arm"', {
215           'conditions' : [
216             ['arm_neon==1 or OS=="android"', {
217               # NEON tests.
218               'dependencies': [
219                 'test_fft16',
220                 'test_fft32',
221                 'test_float_fft',
222                 'test_float_rfft',
223                 'test_rfft16_s32',
224                 'test_rfft16_s16',
225                 'test_rfft32',
226               ],
227             }],
228             ['arm_neon==0 or OS=="android"', {
229               # Non-NEON tests.
230               'dependencies': [
231                 'test_fft_time_armv7',
232                 'test_float_fft_armv7',
233                 'test_float_rfft_armv7',
234               ],
235             }],
236             ['OS=="android"', {
237               # Tests with detection.
238               'dependencies': [
239                 'test_float_rfft_detect',
240               ],
241             }],
242           ],
243         }],
244         ['target_arch == "arm64"', {
245           # Supported test programs for ARM64.
246           'dependencies': [
247             'test_float_fft',
248            ],
249         }],
250       ],
251       'dependencies' : [
252         # All architectures must support at least the float rfft test.
253         'test_float_rfft',
254         'test_fft_time',
255       ],
256     },
257   ],
258 }