How to work with Eigen in CUDA kernels

前端 未结 4 834

Eigen is a c++ linear algebra library http://eigen.tuxfamily.org.

It\'s easy to work with basic data types, like basic float arrays, and just copy it to device memory an

4条回答
  •  面向向阳花
    2021-02-04 04:45

    If all you want is to access the data of an Eigen::Matrix via a raw C pointer, then you can use the .data() function. Coefficient are stored sequentially in memory in a column major order by default, or row major if you asked for:

    MatrixXd A(10,10);
    double *A_data = A.data();
    

提交回复
热议问题