Skip to content

Commit

Permalink
add exception for missing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
omlins committed Aug 16, 2024
1 parent 7670abb commit f31c223
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ParallelKernel/init_parallel_kernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ macro init_parallel_kernel(args...)
esc(init_parallel_kernel(__module__, package, numbertype_val, inbounds_val))
end

function init_parallel_kernel(caller::Module, package::Symbol, numbertype::DataType, inbounds::Bool; datadoc_call=:(), parent_module::Module=ParallelStencil.ParallelKernel)
function init_parallel_kernel(caller::Module, package::Symbol, numbertype::DataType, inbounds::Bool; datadoc_call=:(), parent_module::string=ParallelKernel)
modulename = :Data
if package == PKG_CUDA
if (isinteractive() && !is_installed("CUDA")) @NotInstalledError("CUDA was selected as package for parallelization, but CUDA.jl is not installed. CUDA functionality is provided as an extension of $parent_module and CUDA.jl needs therefore to be installed independently (type `add CUDA` in the julia package manager).") end
Expand Down Expand Up @@ -115,7 +115,7 @@ function extract_kwargs_nopos(caller::Module, kwargs::Dict)
return inbounds_val
end

function define_import(caller::Module, package::Symbol, parent_module::Module)
function define_import(caller::Module, package::Symbol, parent_module::string)
if package == PKG_THREADS
return :()
else
Expand Down
2 changes: 1 addition & 1 deletion src/init_parallel_stencil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function init_parallel_stencil(caller::Module, package::Symbol, numbertype::Data
if (numbertype == NUMBERTYPE_NONE) datadoc_call = :(@doc replace(ParallelStencil.ParallelKernel.DATA_DOC_NUMBERTYPE_NONE, "@init_parallel_kernel" => "@init_parallel_stencil") Data)
else datadoc_call = :(@doc replace(ParallelStencil.ParallelKernel.DATA_DOC, "@init_parallel_kernel" => "@init_parallel_stencil") Data)
end
return_expr = ParallelKernel.init_parallel_kernel(caller, package, numbertype, inbounds; datadoc_call=datadoc_call, parent_module=ParallelStencil)
return_expr = ParallelKernel.init_parallel_kernel(caller, package, numbertype, inbounds; datadoc_call=datadoc_call, parent_module="ParallelStencil")
set_package(caller, package)
set_numbertype(caller, numbertype)
set_ndims(caller, ndims)
Expand Down

0 comments on commit f31c223

Please sign in to comment.