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

API #28

Open
Osveron opened this issue Mar 2, 2018 · 2 comments
Open

API #28

Osveron opened this issue Mar 2, 2018 · 2 comments

Comments

@Osveron
Copy link
Contributor

Osveron commented Mar 2, 2018

Current API is not bad, but it has some problems. Because this crate implements standard Iterator trait simd iterators can be used in for loops(and they are currently used for example in benchmarks), but inside those loops there is no uneven collection handling, this I think can be added, but it would reduce performance. Second thing is that inside for loops there is no in place mutation, you need to manually store. I think it would be better to just have internal iterator trait, and implement functionality on top of it, it would also allow dropping simd prefix on iterators methods. It would make the API more similar to the standard library, with exception of providing defaults. Thoughts?

@AdamNiederer
Copy link
Owner

I like the way the API is at the moment; having Iterator be over full vectors only gives people a way to opt out of our partial vector handling. The lack of in-place mutation may be unintuitive at first, but I think storing the vector on every iteration wouldn't be the right way forward, as simd_for_each lets one do in-place mapping easily.

@Osveron
Copy link
Contributor Author

Osveron commented Mar 4, 2018

If someone wants to opt-out of partial vector handling than, I think it would be better to have something like simd_even_iter, that would be more obvious for someone who just reads the code what the intention was. Not storing on every iteration is exactly what simd_do_each does, any you can store manually from there, if you need to.

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

2 participants