Skip to content

Commit

Permalink
use similar when possible
Browse files Browse the repository at this point in the history
`similar` creates the same array type instead of the hard-coded
Array. This can be useful to support for instance CuArray.
  • Loading branch information
johnnychen94 committed May 30, 2022
1 parent 182841f commit 5347905
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/extreme_filter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ function _extreme_filter_C4_2D!(

#creating temporaries
ySize, xSize = size(A)
tmp = Array{T,1}(undef, ySize)
tmp = similar(out, eltype(out), ySize)
tmp2 = similar(tmp)

# applying radius=r filter is equivalent to applying radius=1 filter r times
Expand Down

0 comments on commit 5347905

Please sign in to comment.