thrust_operations_dispatcher.hpp 2.9 KB

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