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 dot_product example #128

Merged
merged 7 commits into from
Dec 4, 2022
Merged

Conversation

miguelraz
Copy link
Contributor

@miguelraz miguelraz commented Jun 4, 2021

Scratching this off the #110 list.

Special thanks to @Lokathor, @workingjubilee and the Zulip chat for answering questions on this one.

@miguelraz
Copy link
Contributor Author

Failure on riscv64gc seems unrelated because something couldn't pull the proptest lib.

@miguelraz
Copy link
Contributor Author

I think this is good to merge. Any objections @workingjubilee ?

@miguelraz
Copy link
Contributor Author

miguelraz commented Jun 21, 2021

Todo:

@workingjubilee
Copy link
Member

With #138 that is now unblocked~
( it should be zero-cost, tbh )

@workingjubilee
Copy link
Member

I believe this can proceed if it is rebased/updated, with a minimal effort. @miguelraz Would you like to do so?

@miguelraz
Copy link
Contributor Author

Alright, I think I have some bandwidth now... once more unto the breach my friends! 🎉

@miguelraz
Copy link
Contributor Author

miguelraz commented Mar 29, 2022

I've addressed all of my TODOs from above, (except for the benchmarking). I'm punting the benchmarking to a future PR once more examples take shape and the proper benchmarking infra makes sense.

@miguelraz
Copy link
Contributor Author

@calebzulawski This should be good to go now.

@workingjubilee
Copy link
Member

Would you kindly rebase commit miguelraz@340491b out of existence?

// TODO handle remainder when a.len() % 4 != 0
a.array_chunks::<4>()
.map(|&a| f32x4::from_array(a))
.zip(b.array_chunks::<4>().map(|&b| f32x4::from_array(b)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could use slice::as_simd

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that better codegen?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably, but i was more thinking that it's the function designed to split a slice into simd chunks, so we should use it instead of going through arrays.

@workingjubilee workingjubilee merged commit 582239a into rust-lang:master Dec 4, 2022
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

Successfully merging this pull request may close these issues.

7 participants