Hi Karl,

(Is it Karl or Karli?)

Thanks for your quick answer! I should further investigate. However, I
could not find how to execute an exclusive_scan() without downloading the
number of elements per row from the GPU to the host.

Best wishes,
Pepe

2016-03-29 22:24 GMT+02:00 Karl Rupp <r...@iue.tuwien.ac.at>:

> Hi Jose,
>
> > I have been looking for documentation regarding how to handle a matrix
>
>> (sparse) in an OpenCL kernel. My main objective is to can fill a sparse
>> matrix using an OpenCL kernel.
>>
>> Would it be possible??
>>
>> P.S. I can eventually precompute the matrix and indexes arrays sizes.
>>
>
> Yes, that's possible. The typical procedure for doing so is:
>
> 1. Compute number of elements per row, store in a buffer
> 2. Run exclusive_scan() on the buffer to obtain the row-array for the
> three-array CSR format.
> 3. Allocate the column index and value array (CSR format)
> 4. Populate these two arrays with values
> 5. Pass the arrays to a viennacl::compressed_matrix<>.
>
> Instead of 5. you may already start with a viennacl::compressed_matrix<>
> and operate on the OpenCL buffers directly.
>
> There is no ready-to-go example, but the pattern shows up in e.g. the
> sparse matrix-matrix product
> (viennacl/linalg/opencl/sparse_matrix_operations.hpp).
>
> Best regards,
> Karli
>
>
>
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to