I am writing a Eigen on the GPU and would like to use Eigen. I have a float*
that represent data triplets (e.g. xyz, rgb, etc) of a known size n
. I would like to use them as an Eigen vector, but only with casting (no memory copying, as I am on the device), e.g:
const float* input=...
Eigen::Vector3f* inputAsFloat = ????
You can use Eigen::Map
to create a view on a data array:
float* raw_data = ....;
Eigen::Map<Vector3f> vector_map(raw_data, raw_data_size);
There are various options you can use:
Not entirely sure how well this interacts with GPU and/or CUDA.