Skip to content

Commit

Permalink
make not installed warning dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
omlins committed Mar 20, 2024
1 parent 5b830ef commit 1daaa7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ParallelKernel/init_parallel_kernel.jl
Expand Up @@ -27,13 +27,13 @@ end

function init_parallel_kernel(caller::Module, package::Symbol, numbertype::DataType, inbounds::Bool; datadoc_call=:())
if package == PKG_CUDA
if (!CUDA_IS_INSTALLED) @NotInstalledError("CUDA was selected as package for parallelization, but CUDA.jl is not installed. CUDA functionality is provided with an extension of ParallelStencil and CUDA.jl needs therefore to be installed independently.") end
if (!is_installed("CUDA")) @NotInstalledError("CUDA was selected as package for parallelization, but CUDA.jl is not installed. CUDA functionality is provided with an extension of ParallelStencil and CUDA.jl needs therefore to be installed independently.") end
indextype = INT_CUDA
data_module = Data_cuda(numbertype, indextype)
data_module_shared = Data_shared(numbertype, indextype)
pkg_import_cmd = :(import CUDA)
elseif package == PKG_AMDGPU
if (!AMDGPU_IS_INSTALLED) @NotInstalledError("AMDGPU was selected as package for parallelization, but AMDGPU.jl is not installed. AMDGPU functionality is provided with an extension of ParallelStencil and AMDGPU.jl needs therefore to be installed independently.") end
if (!is_installed("AMDGPU")) @NotInstalledError("AMDGPU was selected as package for parallelization, but AMDGPU.jl is not installed. AMDGPU functionality is provided with an extension of ParallelStencil and AMDGPU.jl needs therefore to be installed independently.") end
indextype = INT_AMDGPU
data_module = Data_amdgpu(numbertype, indextype)
data_module_shared = Data_shared(numbertype, indextype)
Expand Down
4 changes: 1 addition & 3 deletions src/ParallelKernel/shared.jl
Expand Up @@ -10,8 +10,6 @@ gensym_world(tag::String, generator::Module) = gensym(string(tag, GENSYM_SEPARAT
gensym_world(tag::Symbol, generator::Module) = gensym(string(tag, GENSYM_SEPARATOR, generator))
gensym_world(tag::Expr, generator::Module) = gensym(string(tag, GENSYM_SEPARATOR, generator))

const CUDA_IS_INSTALLED = (Base.find_package("CUDA")!==nothing)
const AMDGPU_IS_INSTALLED = (Base.find_package("AMDGPU")!==nothing)
const PKG_CUDA = :CUDA
const PKG_AMDGPU = :AMDGPU
const PKG_THREADS = :Threads
Expand Down Expand Up @@ -68,10 +66,10 @@ macro ranges() esc(RANGES_VARNAME) end
macro rangelengths() esc(:(($(RANGELENGTHS_VARNAMES...),))) end



## FUNCTIONS TO CHECK EXTENSIONS SUPPORT

is_loaded(arg) = false
is_installed(package::String) = (Base.find_package(package)!==nothing)


## FUNCTIONS TO DEAL WITH KERNEL DEFINITIONS: SIGNATURES, BODY AND RETURN STATEMENT
Expand Down

0 comments on commit 1daaa7d

Please sign in to comment.