compute icon indicating copy to clipboard operation
compute copied to clipboard

Add .x, .y, .z accessors to vector types

Open kylelutz opened this issue 12 years ago • 1 comments

Make is possible to access components of vector types (e.g. float4_, int8_) by names (e.g. .x, .y).

For example, this should be possible:

boost::compute::float4_ v;
v.x = 1;
v.y = 2;
v.z = 3;
v.w = 4;
assert(v == boost::compute::float4_(1, 2, 3, 4));

Note that names should only be available if the type actually has enough values (e.g. float2_ should not have a .z field).

kylelutz avatar Jan 07 '14 03:01 kylelutz

Have almost completed support for accessors of the form .s#. Will soon extend it to .x, .y, etc.

roshanrags avatar Mar 20 '14 00:03 roshanrags