MorphoGraphX  2.0-1-227
Thrust.hpp
Go to the documentation of this file.
1 #ifndef THRUST_HPP
2 #define THRUST_HPP
3 
4 #include "Config.hpp"
5 
6 #include <thrust/version.h>
7 
8 #if defined(USE_TBB)
9  #define USING_TBB
10  #include <thrust/system/tbb/vector.h>
11  #include <thrust/iterator/retag.h>
12  #define THRUST_RETAG(x) thrust::reinterpret_tag<thrust::tbb::tag>(x)
13  #define THRUST_TAG "Threading Building Blocks"
14 #elif defined(USE_OPENMP)
15  #define USING_OPENMP
16  #include <thrust/system/omp/vector.h>
17  #include <thrust/iterator/retag.h>
18  #define THRUST_RETAG(x) thrust::reinterpret_tag<thrust::omp::tag>(x)
19  #define THRUST_TAG "OpenMP"
20 #else
21  #include <thrust/system/cpp/vector.h>
22  #include <thrust/iterator/retag.h>
23  #define THRUST_RETAG(x) thrust::reinterpret_tag<thrust::cpp::tag>(x)
24  #define THRUST_TAG "Plain C++"
25 #endif
26 
27 inline const char* thrust_device_system_str(unsigned device_system) {
28  switch (device_system) {
29  case THRUST_DEVICE_SYSTEM_CPP:
30  return "CPP";
31  case THRUST_DEVICE_SYSTEM_CUDA:
32  return "CUDA";
33  case THRUST_DEVICE_SYSTEM_OMP:
34  return "OMP";
35  case THRUST_DEVICE_SYSTEM_TBB:
36  return "TBB";
37  case 0:
38  return "Undefined";
39  default:
40  return "Unknown";
41  }
42 }
43 
44 #endif
45 
thrust_device_system_str
const char * thrust_device_system_str(unsigned device_system)
Definition: Thrust.hpp:27