diff --git a/src/ParallelKernel/EnzymeExt/AD.jl b/src/ParallelKernel/EnzymeExt/AD.jl index 992868d..7bb3bac 100644 --- a/src/ParallelKernel/EnzymeExt/AD.jl +++ b/src/ParallelKernel/EnzymeExt/AD.jl @@ -21,8 +21,8 @@ using ..Exceptions const ERRMSG_EXTENSION_LOAD_ERROR = "AD: the Enzyme extension was not loaded. Make sure to import Enzyme before ParallelStencil." init_AD(args...) = return # NOTE: a call will be triggered from @init_parallel_kernel, but it will do nothing if the extension is not loaded. Methods are to be defined in the AD extension modules. -autodiff_deferred!(args...) = @ExtensionLoadError(ERRMSG_EXTENSION_LOAD_ERROR) -autodiff_deferred_thunk!(args...) = @ExtensionLoadError(ERRMSG_EXTENSION_LOAD_ERROR) +autodiff_deferred!(args...) = @NotLoadedError(ERRMSG_EXTENSION_NOT_LOADED) +autodiff_deferred_thunk!(args...) = @NotLoadedError(ERRMSG_EXTENSION_NOT_LOADED) export autodiff_deferred!, autodiff_deferred_thunk! diff --git a/src/ParallelKernel/Exceptions.jl b/src/ParallelKernel/Exceptions.jl index 921aadc..cd3bf10 100644 --- a/src/ParallelKernel/Exceptions.jl +++ b/src/ParallelKernel/Exceptions.jl @@ -1,12 +1,12 @@ module Exceptions -export @ModuleInternalError, @MethodPluginError, @IncoherentCallError, @NotInitializedError, @ExtensionLoadError, @IncoherentArgumentError, @KeywordArgumentError, @ArgumentEvaluationError, @ArgumentError -export ModuleInternalError, MethodPluginError, IncoherentCallError, NotInitializedError, ExtensionLoadError, IncoherentArgumentError, KeywordArgumentError, ArgumentEvaluationError +export @ModuleInternalError, @MethodPluginError, @IncoherentCallError, @NotInitializedError, @NotLoadedError, @IncoherentArgumentError, @KeywordArgumentError, @ArgumentEvaluationError, @ArgumentError +export ModuleInternalError, MethodPluginError, IncoherentCallError, NotInitializedError, NotLoadedError, IncoherentArgumentError, KeywordArgumentError, ArgumentEvaluationError macro ModuleInternalError(msg) esc(:(throw(ModuleInternalError($msg)))) end macro MethodPluginError(msg) esc(:(throw(MethodPluginError($msg)))) end macro IncoherentCallError(msg) esc(:(throw(IncoherentCallError($msg)))) end macro NotInitializedError(msg) esc(:(throw(NotInitializedError($msg)))) end -macro ExtensionLoadError(msg) esc(:(throw(ExtensionLoadError($msg)))) end +macro NotLoadedError(msg) esc(:(throw(NotLoadedError($msg)))) end macro IncoherentArgumentError(msg) esc(:(throw(IncoherentArgumentError($msg)))) end macro KeywordArgumentError(msg) esc(:(throw(KeywordArgumentError($msg)))) end macro ArgumentEvaluationError(msg) esc(:(throw(ArgumentEvaluationError($msg)))) end @@ -32,10 +32,10 @@ struct NotInitializedError <: Exception end Base.showerror(io::IO, e::NotInitializedError) = print(io, "NotInitializedError: ", e.msg) -struct ExtensionLoadError <: Exception +struct NotLoadedError <: Exception msg::String end -Base.showerror(io::IO, e::ExtensionLoadError) = print(io, "ExtensionLoadError: ", e.msg) +Base.showerror(io::IO, e::NotLoadedError) = print(io, "NotLoadedError: ", e.msg) struct IncoherentArgumentError <: Exception msg::String diff --git a/src/ParallelKernel/ParallelKernel.jl b/src/ParallelKernel/ParallelKernel.jl index 2aeaa40..443d5ec 100644 --- a/src/ParallelKernel/ParallelKernel.jl +++ b/src/ParallelKernel/ParallelKernel.jl @@ -40,7 +40,7 @@ To see a description of a macro or module type `?` (including the `@` """ module ParallelKernel -## Include off exception module +## Include of exception module include("Exceptions.jl"); using .Exceptions