Disclaimer: this page is about an experimental feature in Eigen.
Staring from CUDA 5.0, the CUDA compiler, nvcc
, is able to properly parse Eigen's code (almost). A few adaptations of the Eigen's code already allows to use some parts of Eigen in your own CUDA kernels. To this end you need the devel branch of Eigen, CUDA 5.0 or greater with GCC.
Known issues:
nvcc
with MS Visual Studio does not work (patch welcome)nvcc
with clang
does not work (patch welcome)nvcc
5.5 with gcc-4.7 (or greater) has issues with the standard <limits>
header file. To workaround this, you can add the following before including any other files: long
int
as the default type for indexes and sizes. On CUDA device, it would make sense to default to 32 bits int
. However, to keep host and CUDA code compatible, this cannot be done automatically by Eigen, and the user is thus required to define EIGEN_DEFAULT_DENSE_INDEX_TYPE
to int
throughout his code (or only for CUDA code if there is no interaction between host and CUDA code through Eigen's object).