2 Replies Latest reply on Feb 6, 2010 2:51 PM by ankurdh

    2D arrays in kernels.

    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. 

       



        • 2D arrays in kernels.
          genaganna

           

          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 ];