OpenFPM  5.2.0
Project that contain the implementation of distributed structures
cudify_vars.cpp
1 #include "util/cuda_util.hpp"
2 #ifdef HAVE_BOOST_CONTEXT
3 #include <boost/context/continuation.hpp>
4 #endif
5 #include <vector>
6 #include "config.h"
7 
8 #ifdef HAVE_ALPAKA
9 #include "alpala/cudify_hardware_alpaka.hpp"
10 
11 alpa_base_structs __alpa_base__;
12 #endif
13 
14 #if defined(CUDIFY_USE_SEQUENTIAL) || defined(CUDIFY_USE_OPENMP)
15 
16 thread_local dim3 threadIdx;
17 thread_local dim3 blockIdx;
18 
19 unsigned int * tid_x[OPENMP_MAX_NUM_THREADS];
20 unsigned int * tid_y[OPENMP_MAX_NUM_THREADS];
21 unsigned int * tid_z[OPENMP_MAX_NUM_THREADS];
22 
23 dim3 blockDim;
24 dim3 gridDim;
25 
26 #endif
27 
28 bool init_wrappers_call = false;
29 
30 thread_local int vct_atomic_add;
31 thread_local int vct_atomic_rem;
32 
33 size_t n_workers = 1;
34 
35 #ifdef HAVE_BOOST_CONTEXT
36 std::vector<void *> mem_stack;
37 
38 std::vector<boost::context::detail::fcontext_t> contexts;
39 thread_local void * par_glob;
40 thread_local boost::context::detail::fcontext_t main_ctx;
41 #endif