I am currently working on setting up an existing project which uses
ViennaCL with the OpenCL backend to also compile with the CUDA backend.  I
have encountered two issues that I would like to ask about.

1. CUDA 'contexts'
I previously was making sure that new viennacl::matrix objects were being
created with the correct context.  For example:

// ctx_id previously passed as int
viennacl::context ctx(viennacl::ocl::get_context(ctx_id));

// new matrix
viennacl::matrix<T> vclMat(K,M, ctx = ctx);

Now, obviously if I am using the CUDA backend, there is no
`viennacl::ocl::get_contex` method.  What is the recommendation in this

2. Compilation is failing with Eigen::Map classes
I thought this was previously resolved with a previous issue ( but when I try to
compile with nvcc I get the following error (representative example of

error: class "Eigen::Map<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 0,
Eigen::OuterStride<-1>>" has no member "size1"
          detected during:
            instantiation of "viennacl::vcl_size_t
viennacl::traits::size1(const MatrixType &) [with
MatrixType=Eigen::Map<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 0,
            instantiation of "void viennacl::copy(const
viennacl::matrix<NumericT, F, AlignmentV> &, CPUMatrixT &) [with
CPUMatrixT=Eigen::Map<Eigen::Matrix<int, -1, -1, 0, -1, -1>, 0,
Eigen::OuterStride<-1>>, NumericT=int, F=viennacl::row_major,
../inst/include/gpuR/dynEigenMat.hpp(353): here
            instantiation of "void dynEigenMat<T>::to_host() [with T=int]"
../inst/include/gpuR/dynEigenMat.hpp(377): here

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
ViennaCL-devel mailing list

Reply via email to