Autovectorization on x86

Open
#355 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
performance

Research direction

Start with the two implementations in the linked Godbolt example, nd_mul_u64_view and nd_mul_u64_slice, and compare the generated code for view-based and slice-based iteration. Investigate why the view version is not autovectorized; done means the view implementation produces vectorized code comparable to the slice implementation.

Written by the indexing model from the issue text.

Description

I have a, b, c of type Array1<u64>. a is mutable reference, whereas b & c are just reference. I want to set each element in a as product of elements in b & c at corresponding indices. Implementation is relatively straightforward and can be vectorized by compiler. However, I noticed that compiler only vectorizes when I iter using a, b, and c as slices but not as.view().

This is link to both implementations. Notice that nd_mul_u64_view is not vectorized and nd_mul_u64_slice is.

Dominant language
Rust
Stars
452
Forks
95
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-ndarray/ndarray-linalg

All issues in rust-ndarray/ndarray-linalg

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.