entity279

kernel(float, out float3) issues

Discussion created by entity279 on Nov 14, 2008

[code]

kernel void expand_copy(float distances<>,out float3 new_distances<>
{

 new_distances.x=distances;
 new_distances.yz=0;
 
}
[/code]

When I run this kernel, it doesn't fill the .yz output with 0s. Instead, it just fills the output stream with all the values form the input one, just as if the output were a 3 times larger float stream. So yeah, after one third of new_distances, there are only zeroes in it.

So i don't understand what in this kernel allows the .xyz assignments to be almost completly bypassed (almost because the assiments do happen, just in an unexpected way).

 

And I'm using this aparently stupid code to get the minimum out of a two dimensional stream, along with the indexes of thouse dimensions,  in a single pass; since i can't reduce a float to a float 3 directly(brook won't let me), I have to implement the reduce from a float3 to a float3 - the expand() kernel prepares that by transforming the float stream into a float3 one

Outcomes