Skip to content

Commit 70329e7

Browse files
committed
Refactor tests.
TestMaster -> TestMasked Refactor names of result files. Version-dependent use of master/masked.
1 parent fcfb48e commit 70329e7

10 files changed

Lines changed: 52 additions & 12 deletions

tests/results/FirstOrderReverseNestedParallelMaster.ref renamed to tests/results/FirstOrderReverseNestedParallelMasked.ref

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/tests/TestExternalFunctionGlobal.hpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ struct TestExternalFunctionGlobal : public TestBase<4, 1, 3, TestExternalFunctio
8383

8484
OPDI_BARRIER()
8585

86-
OPDI_MASTER()
86+
#if _OPENMP >= 202011
87+
OPDI_MASKED()
88+
#else
89+
OPDI_MASTER()
90+
#endif
8791
{
8892
eh = new ExternalFunctionHelper<T>(true);
8993
for (int i = 0; i < N; ++i) {
@@ -94,7 +98,11 @@ struct TestExternalFunctionGlobal : public TestBase<4, 1, 3, TestExternalFunctio
9498
eh->addOutput(intermediate[i]);
9599
}
96100
}
97-
OPDI_END_MASTER
101+
#if _OPENMP >= 202011
102+
OPDI_END_MASKED
103+
#else
104+
OPDI_END_MASTER
105+
#endif
98106

99107
OPDI_BARRIER()
100108

@@ -113,11 +121,19 @@ struct TestExternalFunctionGlobal : public TestBase<4, 1, 3, TestExternalFunctio
113121
jobResults[i] = cos(exp(intermediate[i]));
114122
}
115123

116-
OPDI_MASTER()
124+
#if _OPENMP >= 202011
125+
OPDI_MASKED()
126+
#else
127+
OPDI_MASTER()
128+
#endif
117129
{
118130
delete eh;
119131
}
120-
OPDI_END_MASTER
132+
#if _OPENMP >= 202011
133+
OPDI_END_MASKED
134+
#else
135+
OPDI_END_MASTER
136+
#endif
121137
}
122138
OPDI_END_PARALLEL
123139

tests/tests/TestExternalFunctionLogicCalls.hpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ struct TestExternalFunctionLogicCalls : public TestBase<4, 1, 3, TestExternalFun
116116

117117
OPDI_BARRIER()
118118

119-
OPDI_MASTER()
119+
#if _OPENMP >= 202011
120+
OPDI_MASKED()
121+
#else
122+
OPDI_MASTER()
123+
#endif
120124
{
121125
eh = new ExternalFunctionHelper<T>(true);
122126
for (int i = 0; i < N; ++i) {
@@ -127,7 +131,11 @@ struct TestExternalFunctionLogicCalls : public TestBase<4, 1, 3, TestExternalFun
127131
eh->addOutput(intermediate[i]);
128132
}
129133
}
130-
OPDI_END_MASTER
134+
#if _OPENMP >= 202011
135+
OPDI_END_MASKED
136+
#else
137+
OPDI_END_MASTER
138+
#endif
131139

132140
OPDI_BARRIER()
133141

@@ -146,11 +154,19 @@ struct TestExternalFunctionLogicCalls : public TestBase<4, 1, 3, TestExternalFun
146154
jobResults[i] = cos(exp(intermediate[i]));
147155
}
148156

149-
OPDI_MASTER()
157+
#if _OPENMP >= 202011
158+
OPDI_MASKED()
159+
#else
160+
OPDI_MASTER()
161+
#endif
150162
{
151163
delete eh;
152164
}
153-
OPDI_END_MASTER
165+
#if _OPENMP >= 202011
166+
OPDI_END_MASKED
167+
#else
168+
OPDI_END_MASTER
169+
#endif
154170
}
155171
OPDI_END_PARALLEL
156172

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
#include "testBase.hpp"
2929

3030
template<typename _Case>
31-
struct TestMaster : public TestBase<4, 1, 3, TestMaster<_Case>> {
31+
struct TestMasked : public TestBase<4, 1, 3, TestMasked<_Case>> {
3232
public:
3333
using Case = _Case;
34-
using Base = TestBase<4, 1, 3, TestMaster<Case>>;
34+
using Base = TestBase<4, 1, 3, TestMasked<Case>>;
3535

3636
template<typename T>
3737
static void test(std::array<T, Base::nIn> const& in, std::array<T, Base::nOut>& out) {
@@ -51,13 +51,21 @@ struct TestMaster : public TestBase<4, 1, 3, TestMaster<_Case>> {
5151

5252
OPDI_BARRIER()
5353

54-
OPDI_MASTER()
54+
#if _OPENMP >= 202011
55+
OPDI_MASKED()
56+
#else
57+
OPDI_MASTER()
58+
#endif
5559
{
5660
for (int i = 0; i < N; ++i) {
5761
out[0] += jobResults[i];
5862
}
5963
}
60-
OPDI_END_MASTER
64+
#if _OPENMP >= 202011
65+
OPDI_END_MASKED
66+
#else
67+
OPDI_END_MASTER
68+
#endif
6169
}
6270
OPDI_END_PARALLEL
6371

0 commit comments

Comments
 (0)