I wrote a function incorporating several calls to 2d-ffts and matrix-vector-multiplications in C++, using arrayfire
, such that I can run and compile the program both on the CPU and GPU. Reason for that is that my dev. PC does not have a GPU, but my production PC has one.
Now, this function serves as right hand side for an ODE, which I would like to solve. One approach is to use odeint
, but odeint
does not (natively) support arrayfire-arrays. Thus, before each step using odeint
I have to copy the 2d-arrays from arrayfire into a std::vector<>
, put them into the odeint
-function and call my function, where I have to transfer the data back into af::arrays
in that function. After processing the data I have to transfer the data back into vectors, before returning to the ode-solver. This approach seems unnecessarily complex and slow.
Therefore, are there other options I could use for solving this ODE? Based on my experience I would like to run it on the GPU to access the performance advantages for zgemv and 2d-FFT, but am (currently) not able to develop it natively due to the lack of a GPU.
I saw that boost.odeint supports thrust. Would that be another option (which means that I have to rewrite the functions), or are there better solutions?
Asked
Active
Viewed 64 times
1

arc_lupus
- 3,942
- 5
- 45
- 81