3 boost/numeric/odeint/external/thrust/thrust_operations_dispatcher.hpp
6 operations_dispatcher specialization for thrust
9 Copyright 2013-2014 Karsten Ahnert
10 Copyright 2013-2014 Mario Mulansky
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)
18 #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_DISPATCHER_HPP_DEFINED
19 #define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_DISPATCHER_HPP_DEFINED
21 #include <thrust/host_vector.h>
22 #include <thrust/device_vector.h>
24 #include <boost/numeric/odeint/external/thrust/thrust_operations.hpp>
25 #include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
27 // support for the standard thrust containers
33 // specialization for thrust host_vector
34 template< class T , class A >
35 struct operations_dispatcher< thrust::host_vector< T , A > >
37 typedef thrust_operations operations_type;
40 // specialization for thrust device_vector
41 template< class T , class A >
42 struct operations_dispatcher< thrust::device_vector< T , A > >
44 typedef thrust_operations operations_type;
48 } // namespace numeric
51 // add support for thrust backend vectors, if available
53 #include <thrust/version.h>
55 #if THRUST_VERSION >= 100600
57 // specialization for thrust cpp vector
58 #include <thrust/system/cpp/vector.h>
59 namespace boost { namespace numeric { namespace odeint {
60 template< class T , class A >
61 struct operations_dispatcher< thrust::cpp::vector< T , A > >
63 typedef thrust_operations operations_type;
67 // specialization for thrust omp vector
69 #include <thrust/system/omp/vector.h>
70 namespace boost { namespace numeric { namespace odeint {
71 template< class T , class A >
72 struct operations_dispatcher< thrust::omp::vector< T , A > >
74 typedef thrust_operations operations_type;
79 // specialization for thrust tbb vector
80 #ifdef TBB_VERSION_MAJOR
81 #include <thrust/system/tbb/vector.h>
82 namespace boost { namespace numeric { namespace odeint {
83 template< class T , class A >
84 struct operations_dispatcher< thrust::tbb::vector< T , A > >
86 typedef thrust_operations operations_type;
89 #endif // TBB_VERSION_MAJOR
91 // specialization for thrust cuda vector
93 #include <thrust/system/cuda/vector.h>
94 namespace boost { namespace numeric { namespace odeint {
95 template< class T , class A >
96 struct operations_dispatcher< thrust::cuda::vector< T , A > >
98 typedef thrust_operations operations_type;
103 #endif // THRUST_VERSION >= 100600
106 #endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_DISPATCHER_HPP_DEFINED