-
Notifications
You must be signed in to change notification settings - Fork 43
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
bench mapreduce with array accesses #63
Changes from 7 commits
842b493
14cb9e4
16642b3
62ef8b7
f2f8879
b2427a1
569ed63
2edcb42
d029b2e
787d3a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,20 @@ function perf_ind2sub(sz, lrange) | |
si, sj, sk | ||
end | ||
|
||
function setup_mapr_access(A) | ||
z = zero(eltype(A)) | ||
zz = z*z | ||
n = Base.LinAlg.checksquare(A) | ||
B = Vector{typeof(zz)}(n) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the benchmark is testing the performance of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like this? |
||
B, zz, n | ||
end | ||
function perf_mapr_access(A, B, zz, n) #20517 | ||
@inbounds for j in 1:n | ||
B[j] = mapreduce(k -> A[j,k]*A[k,j], +, zz, 1:j) | ||
end | ||
B | ||
end | ||
|
||
########################## | ||
# supporting definitions # | ||
########################## | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A
here needs to be interpolated since it's coming from the loop scope rather than thesetup
scope.