* \brief Converts the specified Eigen matrix into the * corresponding cuMat matrix. * Note that Eigen does not support batched matrices. Hence, this * conversion is only possible, if * a) the target matrix has a compile-time batch size of 1, or * b) the target matrix has a dynamic batch size and the batch size is 1 during runtime. * A new cuMat matrix is returned. * * * De
| 920 | * \return the Eigen matrix with the contents of this matrix. |
| 921 | */ |
| 922 | static Type fromEigen(const EigenMatrix_t& mat) |
| 923 | { |
| 924 | CUMAT_STATIC_ASSERT(_Batches == 1 || _Batches == Dynamic, "Compile-time batches>1 not allowed. Eigen does not support batches"); |
| 925 | Type m(mat.rows(), mat.cols()); |
| 926 | m.copyFromHost(reinterpret_cast<const _Scalar*>(mat.data())); |
| 927 | return m; |
| 928 | } |
| 929 | |
| 930 | #endif |
| 931 |