Created
October 15, 2018 17:32
-
-
Save natschil/57e9adb11c84e3d388aadf6ebfb2c3a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SharedArrays,BenchmarkTools,StaticArrays | |
U = SharedArray{Float64}(zeros(100,100,100)) | |
function mytestfun(U) | |
function getIndices(i,j,k) | |
#return U[i,j,k] | |
return U[mod(i,3)+1,j,k] | |
end | |
uvals = @SArray [getIndices(i,j,k) for i in 1:4, j in 1:4, k in 1:4] | |
return uvals[1] | |
end | |
@btime mytestfun($U) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment