<p>It depends what you want to do. If you want to use Thrust you need to change the declaration to</p>

<pre><code>boost::numeric::odeint::runge_kutta_dopri5&lt;
    state_type , double , state_type , double ,
    thrust_algebra , thrust_operations &gt;;
</code></pre>

<p>The <code>thrust_algebra</code> and the <code>thrust_operations</code> ensure that all computations are redirected to appropriate <code>thrust::for_each</code> calls where zipped iterators are used. If you want to use some high-level linear algebra library which runs on the GPU (like VexCL or ViennaCL) you can use your above declaration and only change the <code>state_type</code> to the correct type, for example <code>vexcl::vector&lt; double &gt;</code>. The <code>vector_space_algebra</code> assumes that your <code>state_type</code> can handle operations like <code>y = a1*x1 + a2*x2</code>, which is the case for VexCL and ViennaCL due to the use of expression templates. You can also have a look <a href="http://arxiv.org/abs/1212.6326" rel="nofollow">here</a>.</p>
Template parameters of `boost::numeric::odeint::runge_kutta-X` compatible with CUDA/OpenMP
<p>The type signature for class stepper I am using is summarized here:</p>

<p><a href="http://www.boost.org/doc/libs/1_56_0/libs/numeric/odeint/doc/html/boost/numeric/odeint/runge_kutta_dopri5.html" rel="nofollow noreferrer">http://www.boost.org/doc/libs/1_56_0/libs/numeric/odeint/doc/html/boost/numeric/odeint/runge_kutta_dopri5.html</a> </p>

<p>It can be instantiated as follows:</p>

<pre><code> boost::numeric::odeint::runge_kutta_dopri5&lt; state_type_ &gt; stepper;
</code></pre>

<p>So far so good. It works.</p>

<p>I plan to port my program to cuda (using thrust) and later to openmp. I changed the declaration to following:</p>

<pre><code>boost::numeric::odeint::runge_kutta_dopri5&lt; state_type_
        , double
        , state_type_
        , double
        , boost::numeric::odeint::vector_space_algebra 
        &gt; stepper;
</code></pre>

<p>I followed solution to <a href="https://stackoverflow.com/questions/18808931/odeint-simple-1d-ode-example-does-not-compile/18809739#18809739">this problem</a> but this does not compile. </p>

<pre><code>In file included from /usr/include/boost/numeric/odeint/stepper/euler.hpp:26:
/usr/include/boost/numeric/odeint/algebra/default_operations.hpp:87:27: error: invalid operands to binary expression ('double' and 'const std::vector&lt;double, std::allocator&lt;double&gt; &gt;')
            t1 = m_alpha1 * t2 + m_alpha2 * t3;
                 ~~~~~~~~ ^ ~~
</code></pre>

<p>I am wondering what is the most portable way to declare the stepper so that minimum changes are required later when porting to cuda. </p>