DianaM
DianaM

Reputation: 267

OpenCL pass matrix as argument

How can I pass a List of Lists of ints to OpenCl?

I know how to sent an array of type int[], but I can't find a workaround to somehow send the above structure.

I could transform my List of Lists in an int[][], can that be send?

Upvotes: 2

Views: 421

Answers (1)

Jovasa
Jovasa

Reputation: 445

Transform your 2D list into a 1D.

For example for a list [[0,1], [2,3]] change it to a [0,1,2,3]. And accessing elements list[y][x] becomes list[x + y*a] where a is number of columns.

Upvotes: 2

Related Questions