Originally posted by: MicahVillmow
Ryta,
You indexof variable should be used on your output stream as that determines your domain of execution. Pretty much for every element in your output stream, then your kernel is executed once. |
I'm not sure what you mean. The kernel executes once per output stream? That doesn't sound right, so that must not be what you are saying.
For example:
kernel void foo(float4 in1[120], float4 in2[120], out float4 out1[240], out float4 out2[360])
{
out1[indexof(out1)] = in1[indexof(out1)];
out2[indexof(out2)] = in2[indexof(out1)];
}
How does this work? When operating on the kernel does the out1 stop when it hits it's end point but the kernel execution for the assignment of out2 continues becuase it still has an index?
This is fairly confusing to me, I must admit.
Also, what about using indexof(index) for some functions?
For example:
kernel void foo(float index<>, float4 in[255], out float4[255*8]
{
int idx = indexof(index);
out[idx] = in[idx];
}
I think I have seen samples do this, where they use indexof() on the input streams. Is that not ok?