-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtbb-2020.3-e2k.patch
103 lines (95 loc) · 3.85 KB
/
tbb-2020.3-e2k.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
From bd21380c7b36b403e9f85c5eb20c847288176e31 Mon Sep 17 00:00:00 2001
From: Ilya Kurdyukov <[email protected]>
Date: Mon, 16 Aug 2021 12:56:13 +0700
Subject: [PATCH] TBB-2020.3 e2k support
---
build/linux.gcc.inc | 4 ++++
build/linux.inc | 3 +++
include/tbb/tbb_config.h | 6 +++++-
src/test/test_malloc_pools.cpp | 4 ++++
src/test/test_task_arena.cpp | 4 ++++
5 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc
index d820c15..f6b8d98 100644
--- a/build/linux.gcc.inc
+++ b/build/linux.gcc.inc
@@ -105,6 +105,10 @@ ifeq (ppc32,$(arch))
LIB_LINK_FLAGS += -m32
endif
+ifeq (e2k,$(arch))
+ CPLUS_FLAGS += -mno-avx
+endif
+
ifeq (bg,$(arch))
CPLUS = $(firstword $(notdir $(shell which powerpc{64,32,}-bg{z..a}-linux-g++ 2>/dev/null)))
CONLY = $(firstword $(notdir $(shell which powerpc{64,32,}-bg{z..a}-linux-gcc 2>/dev/null)))
diff --git a/build/linux.inc b/build/linux.inc
index ad1841c..e02fa88 100644
--- a/build/linux.inc
+++ b/build/linux.inc
@@ -101,6 +101,9 @@ endif
ifeq ($(arch),armv7)
def_prefix = lin32
endif
+ifeq ($(arch),e2k)
+ def_prefix = lin64
+endif
ifeq (,$(def_prefix))
ifeq (64,$(findstring 64,$(arch)))
def_prefix = lin64
diff --git a/include/tbb/tbb_config.h b/include/tbb/tbb_config.h
index 7a8d06a..d70785b 100644
--- a/include/tbb/tbb_config.h
+++ b/include/tbb/tbb_config.h
@@ -262,7 +262,11 @@
#define __TBB_CPP11_TEMPLATE_ALIASES_PRESENT (__GXX_EXPERIMENTAL_CXX0X__ && __TBB_GCC_VERSION >= 40700)
#define __TBB_CPP14_INTEGER_SEQUENCE_PRESENT (__cplusplus >= 201402L && __TBB_GCC_VERSION >= 50000)
#define __TBB_CPP14_VARIABLE_TEMPLATES_PRESENT (__cplusplus >= 201402L && __TBB_GCC_VERSION >= 50000)
+#ifdef __EDG__
+ #define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT 0
+#else
#define __TBB_CPP17_DEDUCTION_GUIDES_PRESENT (__cpp_deduction_guides >= 201606L)
+#endif
#define __TBB_CPP17_INVOKE_RESULT_PRESENT (__cplusplus >= 201703L && __TBB_GCC_VERSION >= 70000)
#elif _MSC_VER
// These definitions are also used with Intel C++ Compiler in "default" mode (__INTEL_CXX11_MODE__ == 0);
@@ -517,7 +521,7 @@ There are four cases that are supported:
/** __TBB_WEAK_SYMBOLS_PRESENT denotes that the system supports the weak symbol mechanism **/
#ifndef __TBB_WEAK_SYMBOLS_PRESENT
-#define __TBB_WEAK_SYMBOLS_PRESENT ( !_WIN32 && !__APPLE__ && !__sun && (__TBB_GCC_VERSION >= 40000 || __INTEL_COMPILER ) )
+#define __TBB_WEAK_SYMBOLS_PRESENT ( !_WIN32 && !__APPLE__ && !__sun && !__e2k__ && (__TBB_GCC_VERSION >= 40000 || __INTEL_COMPILER ) )
#endif
/** __TBB_DYNAMIC_LOAD_ENABLED describes the system possibility to load shared libraries at run time **/
diff --git a/src/test/test_malloc_pools.cpp b/src/test/test_malloc_pools.cpp
index abacce3..eb42c5d 100644
--- a/src/test/test_malloc_pools.cpp
+++ b/src/test/test_malloc_pools.cpp
@@ -419,7 +419,11 @@ void TestFixedBufferPool()
}
{
size_t maxSz;
+#ifdef __e2k__
+ const int p = 128;
+#else
const int p = 512;
+#endif
Harness::SpinBarrier barrier(p);
// Find maximal useful object size. Start with MAX_OBJECT/2,
diff --git a/src/test/test_task_arena.cpp b/src/test/test_task_arena.cpp
index 32cf576..d38aa21 100644
--- a/src/test/test_task_arena.cpp
+++ b/src/test/test_task_arena.cpp
@@ -1451,8 +1451,12 @@ void TestDefaultWorkersLimit() {
// Shared RML might limit the number of workers even if you specify the limits
// by the reason of (default_concurrency==max_concurrency) for shared RML
#ifndef RML_USE_WCRM
+#ifdef __e2k__
+ TestAbilityToCreateWorkers(128);
+#else
TestAbilityToCreateWorkers(256);
#endif
+#endif
}
//--------------------------------------------------//
--
2.17.1