xref: /oneTBB/test/common/config.h (revision 68e075cb)
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_COLLABORATIVE_CALL_ONCE
34 #define TBB_PREVIEW_COLLABORATIVE_CALL_ONCE 1
35 #endif
36 #ifndef TBB_PREVIEW_CONCURRENT_LRU_CACHE
37 #define TBB_PREVIEW_CONCURRENT_LRU_CACHE 1
38 #endif
39 #ifndef TBB_PREVIEW_VARIADIC_PARALLEL_INVOKE
40 #define TBB_PREVIEW_VARIADIC_PARALLEL_INVOKE 1
41 #endif
42 #ifndef TBB_PREVIEW_BLOCKED_RANGE_ND
43 #define TBB_PREVIEW_BLOCKED_RANGE_ND 1
44 #endif
45 #ifndef TBB_PREVIEW_ISOLATED_TASK_GROUP
46 #define TBB_PREVIEW_ISOLATED_TASK_GROUP 1
47 #endif
48 #endif
49 
50 #include "oneapi/tbb/detail/_config.h"
51 #if __FreeBSD__
52 #include <sys/param.h>  // for __FreeBSD_version
53 #endif
54 
55 #if __INTEL_COMPILER
56   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT (__cplusplus >= 201402L)
57 #elif __clang__
58   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT (__has_feature(cxx_generic_lambdas))
59 #elif __GNUC__
60   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT           (__cplusplus >= 201402L)
61   #define __TBB_GCC_WARNING_IGNORED_ATTRIBUTES_PRESENT  (__TBB_GCC_VERSION >= 60100)
62 #elif _MSC_VER
63   #define __TBB_CPP14_GENERIC_LAMBDAS_PRESENT (_MSC_VER >= 1922)
64 #endif
65 
66 // The tuple-based tests with more inputs take a long time to compile.  If changes
67 // are made to the tuple implementation or any switch that controls it, or if testing
68 // with a new platform implementation of std::tuple, the test should be compiled with
69 // MAX_TUPLE_TEST_SIZE >= 10 (or the largest number of elements supported) to ensure
70 // all tuple sizes are tested.  Expect a very long compile time.
71 #ifndef MAX_TUPLE_TEST_SIZE
72     #define MAX_TUPLE_TEST_SIZE 10
73 #endif
74 
75 #if MAX_TUPLE_TEST_SIZE > __TBB_VARIADIC_MAX
76     #undef MAX_TUPLE_TEST_SIZE
77     #define MAX_TUPLE_TEST_SIZE __TBB_VARIADIC_MAX
78 #endif
79 
80 const unsigned MByte = 1024*1024;
81 
82 #if (_WIN32 && !__TBB_WIN8UI_SUPPORT) || (__linux__ && !__ANDROID__ && !__bg__) || __FreeBSD_version >= 701000
83 #define __TBB_TEST_SKIP_AFFINITY 0
84 #else
85 #define __TBB_TEST_SKIP_AFFINITY 1
86 #endif
87 
88 #endif /* __TBB_test_common_config_H */
89