cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

lxp121
Journeyman III

can gather and scatter stream be a struct?

can gather and scatter stream be a struct?

for example:

typedef struct testRec
{
    int x;
    float y;
}test;

kernel void test1(test a<>, test b[], out test c[])
{
      c[a.x].y = b[a.x].y;
}

 

is this legal? if so, what the size limitation of c in this programm?

thanks

0 Likes
2 Replies
gaurav_garg
Adept I

As the compiler converts a struct into multiple basic streams and underlying hardware doesn't allow muliple scatter streams in a kernel, using struct for a scatter stream is not possible.

Using struct for gather streams should not be a problem.

0 Likes
Ceq
Journeyman III

There could be a bug if you use two gather streams based on structs, if you
see you aren't getting the right elements it could be this.
I've only tested this bug using two "float5" (>128 bits) gather streams.
0 Likes