xref: /oneTBB/test/common/config.h (revision cf0a6739)
1 /*
2     Copyright (c) 2005-2021 Intel Corporation
3 
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7 
8         http://www.apache.org/licenses/LICENSE-2.0
9 
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15 */
16 
17 #ifndef __TBB_test_common_config_H
18 #define __TBB_test_common_config_H
19 
20 #if __TBB_CPF_BUILD
21 #ifndef  TBB_PREVIEW_FLOW_GRAPH_FEATURES
22 #define TBB_PREVIEW_FLOW_GRAPH_FEATURES 1
23 #endif
24 #ifndef TBB_PREVIEW_ALGORITHM_TRACE
25 #define TBB_PREVIEW_ALGORITHM_TRACE 1
26 #endif
27 #ifndef TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR
28 #define TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR 1
29 #endif
30 #ifndef TBB_PREVIEW_TASK_GROUP_EXTENSIONS
31 #define TBB_PREVIEW_TASK_GROUP_EXTENSIONS 1
32 #endif
33 #ifndef TBB_PREVIEW_CONCURRENT_LRU_CACHE
34 #define TBB_PREVIEW_CONCURRENT_LRU_CACHE 1
35 #endif
36 #ifndef TBB_PREVIEW_VARIADIC_PARALLEL_INVOKE
37 #define TBB_PREVIEW_VARIADIC_PARALLEL_INVOKE 1
38 #endif
39 #ifndef TBB_PREVIEW_BLOCKED_RANGE_ND
40 #define TBB_PREVIEW_BLOCKED_RANGE_ND 1
41 #endif
42 #ifndef TBB_PREVIEW_ISOLATED_TASK_GROUP
43 #define TBB_PREVIEW_ISOLATED_TASK_GROUP 1
44 #endif
45 #endif
46 
47 #include "oneapi/tbb/detail/_config.h"
48 #if __FreeBSD__
49 #include <sys/param.h>  // for __FreeBSD_version
50 #endif
51 
52 #if __INTEL_COMPILER
53   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT (__cplusplus >= 201402L)
54 #elif __clang__
55   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT (__has_feature(cxx_generic_lambdas))
56 #elif __GNUC__
57   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT           (__cplusplus >= 201402L)
58   #define __TBB_GCC_WARNING_IGNORED_ATTRIBUTES_PRESENT  (__TBB_GCC_VERSION >= 60100)
59 #elif _MSC_VER
60   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT (_MSC_VER >= 1922)
61 #endif
62 
63 // The tuple-based tests with more inputs take a long time to compile.  If changes
64 // are made to the tuple implementation or any switch that controls it, or if testing
65 // with a new platform implementation of std::tuple, the test should be compiled with
66 // MAX_TUPLE_TEST_SIZE >= 10 (or the largest number of elements supported) to ensure
67 // all tuple sizes are tested.  Expect a very long compile time.
68 #ifndef MAX_TUPLE_TEST_SIZE
69     #define MAX_TUPLE_TEST_SIZE 10
70 #endif
71 
72 #if MAX_TUPLE_TEST_SIZE > __TBB_VARIADIC_MAX
73     #undef MAX_TUPLE_TEST_SIZE
74     #define MAX_TUPLE_TEST_SIZE __TBB_VARIADIC_MAX
75 #endif
76 
77 const unsigned MByte = 1024*1024;
78 
79 #if (_WIN32 && !__TBB_WIN8UI_SUPPORT) || (__linux__ && !__ANDROID__ && !__bg__) || __FreeBSD_version >= 701000
80 #define __TBB_TEST_SKIP_AFFINITY 0
81 #else
82 #define __TBB_TEST_SKIP_AFFINITY 1
83 #endif
84 
85 #endif /* __TBB_test_common_config_H */
86