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

Structured bindings for all data parallel types #57

Open
bernhardmgruber opened this issue Mar 21, 2023 · 0 comments
Open

Structured bindings for all data parallel types #57

bernhardmgruber opened this issue Mar 21, 2023 · 0 comments

Comments

@bernhardmgruber
Copy link

bernhardmgruber commented Mar 21, 2023

Although the proposed data parallel types are conceptually not arrays, they still provide the subscript operator and can at least be treated similarly to arrays. A notable missing piece is the ability to destructure data parallel types, possibly into packs:

int main() {
    auto s = std::experimental::native_simd<double>{[](auto ic) -> float { return ic * 2; }};
    auto& [a, b, c, d] = s; // only with e.g. AVX2
    const auto [...parts] = s; // generic, P1061
}

The implementation should not be too hard, here is a sketch: https://godbolt.org/z/zGYx1vezv

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

No branches or pull requests

1 participant