cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

ankurdh
Journeyman III

2D arrays in kernels.

Is it not possible to use a 2D array in a kernel?

like say. .

outputArr[globIdY]  [  x ]= inputArr1[globIdX] [ x ] * inputArr2[globIdX] [ x ];

when i compile it with clc, i get error in the second square brace saying the value must be a pointer-to-object. 

 



0 Likes
2 Replies
genaganna
Journeyman III

Originally posted by: ankurdh Is it not possible to use a 2D array in a kernel?

 

like say. .

 

outputArr[globIdY]  [  x ]= inputArr1[globIdX] [ x ] * inputArr2[globIdX] [ x ];

 

 

when i compile it with clc, i get error in the second square brace saying the value must be a pointer-to-object. 

 

 

 

 

You should use like following

outputArr[globIdY * Width+  x ]= inputArr1[globIdX * Width +  x ]  * inputArr2[globIdX * Width + x ];

0 Likes

Thanks . .

0 Likes