and pardon my possible double-post for I was not sure whether HTML was
prohibited or not.
Thanks for the suggestion and your quick response, however I don't think
this will gonna solve my case. More precisely I try to process a stack
of Python/OpenCV images in CUDA. I know one sole image can easily be
transformed to a 1D-Pointer, but a list of images is what I'm thinking
about right know. One workaround would be appending all images , create
so a huge one, and keep the offsets. This way I know exactly at which
(x,y) a next image starts on the huge picture. It is working but not
very nice to maintain at least for my goals.
Another case would be a list of 1D-lists as suggested of random sizes (m
x 1) :
Do you think one of the two cases can be transformed to a sparse matrix?
If so is there an example about these matrices for CUDA ?
On 12.05.2016 06:31, Andreas Kloeckner wrote:
Frank Ihle <frank.ihle(a)yahoo.de> writes:
> I try to speed up my Python program with a not so trivial algorithm, so
> I need to know. What is the correct way of transferring a list of lists
> of floats to the (Py)CUDA Kernel?
Nested, variable-sized structures are generally tricky to map onto
array-shape hardware. You'll likely want to store your data in a
CSR-like data structure:
Scans (such as the one in PyCUDA) can help significantly with the
resulting index computations.
Hope that helps,