Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kylelutz opened this issue Jan 7, 2014 · 1 comment
Open

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

kylelutz opened this issue Jan 7, 2014 · 1 comment
Labels

Comments

@kylelutz
Copy link
Collaborator

kylelutz commented Jan 7, 2014

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).

@roshanrags
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants