I would like to replace some of my calculations formerly written with armadillo with ArrayFire, in order to use some GPU capabilities. I do not want to replace everything, just the time-critical spots. Thus I need to convert armadillo-structures into arrayfire-structures and back. The first step is easy:
arma::colvec A_arma(5, arma::fill::ones);
af::array A_array(5, A_arma.memptr());//Done
Going back is more difficult. How do I get the data from the arrayfire-structure into the armadillo-structure? I can iterate over all elements and write them into the armadillo structure, but that would take a lot of time. Are there easier ways?