Hi, I’m trying to use parallelstencil.jl
with Threads or CUDA and ran into the following error:
julia> using ParallelStencil
julia> using CUDA
julia> pscheme=CUDA
CUDA
julia> @init_parallel_stencil(pscheme, Float64, 2)
ERROR: ArgumentError: package has to be functional and one of the following: Threads, CUDA, AMDGPU (obtained: pscheme).
It looks like the initialization macro only takes literally Threads
or CUDA
as inputs. Moreover, this error is even more intriguing:
julia> if false
@init_parallel_stencil(pscheme, Float64, 2)
end
ERROR: ArgumentError: package has to be functional and one of the following: Threads, CUDA, AMDGPU (obtained: pscheme).
It looks like the macro has to run even the condition is not met? It looks like I don’t seem to know how macro works. If I do it straightforwardly, there is no complaint:
julia> @init_parallel_stencil(CUDA, Float64, 2)
julia>
So how should I initialize conditionally and / or parametrically? I’m using Julia 1.9.2