3 Replies Latest reply on Jun 8, 2009 9:21 AM by hennequi

    gather with streams of different sizes

    hennequi
      gather with streams of different sizes

      Good morning,

      i am wondering if the domain over which a gather stream is reachable can be bigger than the domain of execution of the kernel.

      In my case, I have a 1D input stream a<> of length N, one 2D gather stream b[][] of dimensions {M,N}, a normal 1D out stream c<> of length N, and I do the following

      kernel void mykernel(float4 a<>, float4 b[][], out float4 c<>){

        unsigned int j;

        unsigned int index = instance().x;

        float4 tmp = a;

        for(j=0;j<M;j++) tmp = tmp + b[j][index];

        c = tmp;

      }

      What I noticed was that if N >= M the result is correct,

      on the contrary if M < N it seems to be able to gather only those values b[j][index] for which j < N ...

      is there a way to access the whole gather stream??

      should I use one of those .domain things?

      Thanks a lot

      Guillaume.