# HG changeset patch # User Tuomo Valkonen # Date 1576328399 -7200 # Node ID 8ff7da7bc77dc4d7fa1c62c34afe0590d2cc6779 # Parent 9b0cfc67d6cb5b37d8743a8b62457a12b0e31bee Some threading diff -r 9b0cfc67d6cb -r 8ff7da7bc77d src/Translate.jl --- a/src/Translate.jl Wed Dec 11 18:46:02 2019 +0200 +++ b/src/Translate.jl Sat Dec 14 14:59:59 2019 +0200 @@ -96,10 +96,10 @@ # Translation ############## -@polly function translate_image!(x, z, u::DisplacementFull) +function translate_image!(x, z, u::DisplacementFull) @assert(size(u, 1)==2 && size(x)==size(u)[2:end] && size(x)==size(z)) - @inbounds @simd for i=1:size(x, 1) + @inbounds Threads.@threads for i=1:size(x, 1) @simd for j=1:size(x, 2) pt = (i - u[1, i, j], j - u[2, i, j]) x[i, j] = interpolate2d_quadrants(z, pt) @@ -107,10 +107,10 @@ end end -@polly function translate_image!(x, z, u::DisplacementConstant) +function translate_image!(x, z, u::DisplacementConstant) @assert(size(u)==(2,) && size(x)==size(z)) - @inbounds @simd for i=1:size(x, 1) + @inbounds Threads.@threads for i=1:size(x, 1) @simd for j=1:size(x, 2) pt = (i - u[1], j - u[2]) x[i, j] = interpolate2d_quadrants(z, pt) @@ -122,7 +122,7 @@ # Subimage extraction ###################### -@polly function extract_subimage!(b, im, v::DisplacementConstant) +function extract_subimage!(b, im, v::DisplacementConstant) (imx, imy) = size(im) (bx, by) = size(b) @@ -138,8 +138,8 @@ b .= 0 - @inbounds @simd for i=px:qx - for j=py:qy + @inbounds Threads.@threads for i=px:qx + @simd for j=py:qy b[i, j] = interpolate2d_quadrants(im, (i+vxʹ, j+vyʹ)) end end