Fair enough, thank you Karl. One follow-up question, where is this in the documentation? I am trying to get a feel of where everything is so I don't have to ask these simple questions on here.
Regards, Charles On Mon, Aug 17, 2015 at 8:15 AM, Karl Rupp <[email protected]> wrote: > Hi Charles, > > you can extract the row or column of a matrix using viennacl::row() and > viennacl::column(), e.g. > > viennacl::matrix<T> A(N, N); > viennacl::vector<T> x(N); > > x = viennacl::row(A, 2); > x = viennacl::column(A, 3); > > The assignment of a vector to a matrix row or matrix column is more > involved, though... > > In either case you really want to iterate over elements and use > per-element access. This is because each access entails a host<->device > communication, which is very costly with CUDA and OpenCL. > > Best regards, > Karli > > > > > On 08/17/2015 03:08 PM, Charles Determan wrote: > >> I have seen in the documentation that it is simple to access an >> individual element in a viennacl::matrix with >> >> mat(i,j) >> >> but how could I access an entire row or column? Is there similar syntax >> or would I need to iterate over each element of a row/column? >> >> Thanks, >> Charles >> >> >> >> ------------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> ViennaCL-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/viennacl-devel >> >> >
------------------------------------------------------------------------------
_______________________________________________ ViennaCL-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/viennacl-devel
