-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathtest-kernel-region-sync.cpp.in
More file actions
102 lines (77 loc) · 2.78 KB
/
Copy pathtest-kernel-region-sync.cpp.in
File metadata and controls
102 lines (77 loc) · 2.78 KB
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
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
// Copyright (c) Lawrence Livermore National Security, LLC and other
// RAJA Project Developers. See top-level LICENSE and COPYRIGHT
// files for dates and other details. No copyright assignment is required
// to contribute to RAJA.
//
// SPDX-License-Identifier: (BSD-3-Clause)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//
// test/include headers
//
#include "RAJA_test-base.hpp"
#include "RAJA_test-camp.hpp"
#include "RAJA_test-index-types.hpp"
//
// Header for tests in ./tests directory
//
// Note: CMake adds ./tests as an include dir for these tests.
//
#include "test-kernel-region-data.hpp"
#include "test-kernel-region-sync.hpp"
//
// Exec pols for kernel region tests
//
#if defined(RAJA_ENABLE_OPENMP)
using OpenMPKernelRegionSyncExecPols =
camp::list<
// Basic check to make sure insertion of thread sync operations
// where they are not really needed don't mess anything up
// RAJA::omp_for_exec actually has a barrier at the end of it.
RAJA::KernelPolicy<
RAJA::statement::Region<RAJA::omp_parallel_region,
RAJA::statement::For<0, RAJA::omp_for_exec,
RAJA::statement::Lambda<0, RAJA::Segs<0>>
>,
RAJA::statement::OmpSyncThreads,
RAJA::statement::For<1, RAJA::omp_for_exec,
RAJA::statement::Lambda<1, RAJA::Segs<1>>
>,
RAJA::statement::OmpSyncThreads,
RAJA::statement::For<0, RAJA::omp_for_exec,
RAJA::statement::Lambda<2, RAJA::Segs<0>>
>
>
>,
// Check thread sync operations inserted where they are
// needed do the right thing.
RAJA::KernelPolicy<
RAJA::statement::Region<RAJA::omp_parallel_region,
RAJA::statement::For<0, RAJA::omp_for_nowait_static_exec< >,
RAJA::statement::Lambda<0, RAJA::Segs<0>>
>,
RAJA::statement::OmpSyncThreads,
RAJA::statement::For<1, RAJA::omp_for_nowait_static_exec< >,
RAJA::statement::Lambda<1, RAJA::Segs<1>>
>,
RAJA::statement::OmpSyncThreads,
RAJA::statement::For<0, RAJA::omp_for_nowait_static_exec< >,
RAJA::statement::Lambda<2, RAJA::Segs<0>>
>
>
>
>;
#endif // RAJA_ENABLE_OPENMP
//
// Cartesian product of types used in parameterized tests
//
using @REGION_BACKEND@KernelRegionSyncTypes =
Test< camp::cartesian_product<RawIdxTypeList,
@REGION_BACKEND@ResourceList,
@REGION_BACKEND@KernelRegionSyncExecPols>>::Types;
//
// Instantiate parameterized test
//
INSTANTIATE_TYPED_TEST_SUITE_P(@REGION_BACKEND@,
KernelRegionSyncTest,
@REGION_BACKEND@KernelRegionSyncTypes);