Skip to content

Commit

Permalink
Merge pull request #129 from JanJereczek/fix-parallelstencil
Browse files Browse the repository at this point in the history
Fix parallelstencil initialisation
  • Loading branch information
JanJereczek authored Aug 17, 2024
2 parents c6a7d7e + fd00762 commit 8986aa0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ FFTW = "1.8"
FastGaussQuadrature = "1.0"
Interpolations = "0.14, 0.15"
NLsolve = "4.5"
NetCDF = "0.11"
NetCDF = "0.11, 0.12"
OrdinaryDiffEq = "6.58"
ParallelStencil = "0.13"
Reexport = "1"
Expand Down
4 changes: 4 additions & 0 deletions src/FastIsostasy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ using ParallelStencil: ParallelStencil, @init_parallel_stencil, @parallel,
using Statistics: mean, cov
using SpecialFunctions: besselj0, besselj1

# Init stencil on GPU. Will only be used if specified in ComputationDomain.
allowscalar(false)
@init_parallel_stencil(CUDA, Float64, 3);

using Reexport: Reexport, @reexport
@reexport using Interpolations
@reexport using OrdinaryDiffEq: Euler, Midpoint, Heun, Ralston, BS3, BS5, RK4,
Expand Down
10 changes: 5 additions & 5 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -520,11 +520,11 @@ function zeropad_extension(M::Matrix{T}, Nx::Int, Ny::Int) where {T<:AbstractFlo
return M_zeropadded
end

function init()
println("Initializing CUDA Stencil")
@init_parallel_stencil(CUDA, Float64, 2)
CUDA.allowscalar(false)
end
# function init()
# println("Initializing CUDA Stencil")
# @init_parallel_stencil(CUDA, Float64, 2)
# CUDA.allowscalar(false)
# end

#####################################################
# Example utils
Expand Down

0 comments on commit 8986aa0

Please sign in to comment.