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

WIP: Generalize @simd to multi-dimensional ranges. #9871

Closed
wants to merge 1 commit into from

Conversation

ArchRobison
Copy link
Contributor

This is work in progress to address #9858. I'll need help from @timholy to write the three necessary simd_... overloads for CartesianRange.

See Issue JuliaLang#9858 for discussion and design.
@timholy
Copy link
Member

timholy commented Jan 21, 2015

Very nice. I will submit a PR against your PR. The exciting bit: given the function definitions in #9858,

A = rand(Float32, 10^4, 10^4);

julia> @time f3(A)
elapsed time: 0.225945334 seconds (96 bytes allocated)
4.9999244533296704e7

julia> @time f3_broken(A)
elapsed time: 0.078786508 seconds (96 bytes allocated)
4.9999244533296704e7

julia> @time f1(A)
elapsed time: 0.084660836 seconds (96 bytes allocated)
4.9999244533296704e7

julia> @time f2(A)
elapsed time: 0.131078207 seconds (96 bytes allocated)
4.9999244533296704e7

So with @simd, we're back to being just as fast as manually-written nested loops. (Presumably this is true only for arrays with a sizable first dimension, but still...)

@timholy
Copy link
Member

timholy commented Jan 22, 2015

Incorporated via #9876. Thanks, @ArchRobison, for tackling this so quickly!

@timholy timholy closed this Jan 22, 2015
@timholy
Copy link
Member

timholy commented Jan 22, 2015

This gave me a 3.5-fold speed improvement in a computation I care a lot about, just by adding @simd in front of two lines. Thanks!

IainNZ added a commit that referenced this pull request May 9, 2015
(cherry picked from commit 64e2dbd)
ref PR #9783

Conflicts:
	test/strings.jl
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.

2 participants