diff --git a/src/OdeIntegrators/OdeIntegrators.hpp b/src/OdeIntegrators/OdeIntegrators.hpp index 5f4ecbc0e6cef0c60800bf85e3e6b9de35260333..5296b2acee1d719d1495a296a963b28aa7b9807d 100644 --- a/src/OdeIntegrators/OdeIntegrators.hpp +++ b/src/OdeIntegrators/OdeIntegrators.hpp @@ -31,41 +31,6 @@ namespace boost{ #ifdef __NVCC__ #include "OdeIntegrators/vector_algebra_ofp_gpu.hpp" -#endif - -namespace boost { namespace numeric { namespace odeint { - - template<typename T> - struct is_resizeable< vector_dist_expression<0,openfpm::vector<aggregate<T>> > > - { - typedef boost::true_type type; - static const bool value = type::value; - }; - - } } } - -/*! \brief A 1d Odeint and Openfpm compatible structure. - * - * Use the method this.data.get<d>() to refer to property of all the particles in the dimension d. - * - * d starts with 0. - * - */ -struct state_type_1d_ofp{ - state_type_1d_ofp(){ - } - typedef size_t size_type; - typedef int is_state_vector; - aggregate<texp_v<double>> data; - - size_t size() const - { return data.get<0>().size(); } - - void resize(size_t n) - { - data.get<0>().resize(n); - } -}; /*! \brief A 1d Odeint and Openfpm compatible structure. * * Use the method this.data.get<d>() to refer to property of all the particles in the dimension d. @@ -113,6 +78,41 @@ struct state_type_1d_ofp_gpu{ return s1_ker; } }; +#endif + +namespace boost { namespace numeric { namespace odeint { + + template<typename T> + struct is_resizeable< vector_dist_expression<0,openfpm::vector<aggregate<T>> > > + { + typedef boost::true_type type; + static const bool value = type::value; + }; + + } } } + +/*! \brief A 1d Odeint and Openfpm compatible structure. + * + * Use the method this.data.get<d>() to refer to property of all the particles in the dimension d. + * + * d starts with 0. + * + */ +struct state_type_1d_ofp{ + state_type_1d_ofp(){ + } + typedef size_t size_type; + typedef int is_state_vector; + aggregate<texp_v<double>> data; + + size_t size() const + { return data.get<0>().size(); } + + void resize(size_t n) + { + data.get<0>().resize(n); + } +}; /*! \brief A 2d Odeint and Openfpm compatible structure. * @@ -225,13 +225,13 @@ namespace boost { typedef boost::true_type type; static const bool value = type::value; }; - +#ifdef __NVCC__ template<> struct is_resizeable<state_type_1d_ofp_gpu> { typedef boost::true_type type; static const bool value = type::value; }; - +#endif template<> struct is_resizeable<state_type_2d_ofp> { typedef boost::true_type type; diff --git a/src/OdeIntegrators/tests/Odeintegrators_test_gpu.cu b/src/OdeIntegrators/tests/Odeintegrators_test_gpu.cu index bca0527be1c1c29c7dc8341f14d8fbc40950f4a9..a1b2771dc39896409326a3eed476dcaf0bb76de3 100644 --- a/src/OdeIntegrators/tests/Odeintegrators_test_gpu.cu +++ b/src/OdeIntegrators/tests/Odeintegrators_test_gpu.cu @@ -14,6 +14,7 @@ #include "Operators/Vector/vector_dist_operators.hpp" #include "OdeIntegrators/OdeIntegrators.hpp" //#include "DCPSE/DCPSE_op/DCPSE_op.hpp" +#ifdef __NVCC__ typedef state_type_1d_ofp_gpu state_type; //const double a = 2.8e-4; @@ -100,3 +101,4 @@ BOOST_AUTO_TEST_CASE(odeint_base_test_gpu) BOOST_REQUIRE(worst < 1e-6); } BOOST_AUTO_TEST_SUITE_END() +#endif \ No newline at end of file