1 /*
2   [auto_generated]
3   boost/numeric/odeint/external/thrust/thrust_algebra_dispatcher.hpp
4 
5   [begin_description]
6   algebra_dispatcher specialization for thrust
7   [end_description]
8 
9   Copyright 2013 Karsten Ahnert
10   Copyright 2013 Mario Mulansky
11 
12   Distributed under the Boost Software License, Version 1.0.
13   (See accompanying file LICENSE_1_0.txt or
14   copy at http://www.boost.org/LICENSE_1_0.txt)
15 */
16 
17 
18 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_DISPATCHER_HPP_DEFINED
19 #define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_DISPATCHER_HPP_DEFINED
20 
21 #include <thrust/host_vector.h>
22 #include <thrust/device_vector.h>
23 
24 #include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp>
25 #include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
26 
27 // specializations for the standard thrust containers
28 
29 namespace boost {
30 namespace numeric {
31 namespace odeint {
32 
33 // specialization for thrust host_vector
34 template< class T , class A >
35 struct algebra_dispatcher< thrust::host_vector< T , A > >
36 {
37     typedef thrust_algebra algebra_type;
38 };
39 
40 // specialization for thrust device_vector
41 template< class T , class A >
42 struct algebra_dispatcher< thrust::device_vector< T , A > >
43 {
44     typedef thrust_algebra algebra_type;
45 };
46 
47 } // namespace odeint
48 } // namespace numeric
49 } // namespace boost
50 
51 
52 // add support for thrust backend vectors, if available
53 
54 #include <thrust/version.h>
55 
56 #if THRUST_VERSION >= 100600
57 
58 // specialization for thrust cpp vector
59 #include <thrust/system/cpp/vector.h>
60 namespace boost { namespace numeric { namespace odeint {
61     template< class T , class A >
62     struct algebra_dispatcher< thrust::cpp::vector< T , A > >
63     {
64         typedef thrust_algebra algebra_type;
65     };
66 } } }
67 
68 // specialization for thrust omp vector
69 #ifdef _OPENMP
70 #include <thrust/system/omp/vector.h>
71 namespace boost { namespace numeric { namespace odeint {
72     template< class T , class A >
73     struct algebra_dispatcher< thrust::omp::vector< T , A > >
74     {
75         typedef thrust_algebra algebra_type;
76     };
77 } } }
78 #endif // _OPENMP
79 
80 // specialization for thrust tbb vector
81 #ifdef TBB_VERSION_MAJOR
82 #include <thrust/system/tbb/vector.h>
83 namespace boost { namespace numeric { namespace odeint {
84     template< class T , class A >
85     struct algebra_dispatcher< thrust::tbb::vector< T , A > >
86     {
87         typedef thrust_algebra algebra_type;
88     };
89 } } }
90 #endif // TBB_VERSION_MAJOR
91 
92 // specialization for thrust cuda vector
93 #ifdef __CUDACC__
94 #include <thrust/system/cuda/vector.h>
95 namespace boost { namespace numeric { namespace odeint {
96     template< class T , class A >
97     struct algebra_dispatcher< thrust::cuda::vector< T , A > >
98     {
99         typedef thrust_algebra algebra_type;
100     };
101 } } }
102 #endif // __CUDACC__
103 
104 #endif // THRUST_VERSION >= 100600
105 
106 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_DISPATCHER_HPP_DEFINED
107 
108