diff --git a/loopy/__init__.py b/loopy/__init__.py index f2b04d49f16edff1fd8b28c0adb1994ea1f19e87..dcd8e27c1eaf02a0f7aee133598b0e2fd34f70b9 100644 --- a/loopy/__init__.py +++ b/loopy/__init__.py @@ -32,7 +32,7 @@ from islpy import dim_type from loopy.symbolic import (RuleAwareIdentityMapper, RuleAwareSubstitutionMapper, SubstitutionRuleMappingContext, TaggedVariable, Reduction, LinearSubscript, ) -from loopy.diagnostic import LoopyError +from loopy.diagnostic import LoopyError, LoopyWarning # {{{ imported user interface @@ -111,6 +111,8 @@ __all__ = [ "make_kernel", "c_preprocess", "parse_transformed_fortran", "parse_fortran", + "LoopyError", "LoopyWarning", + # {{{ from this file "split_iname", "join_inames", "tag_inames", "duplicate_inames", diff --git a/loopy/diagnostic.py b/loopy/diagnostic.py index 56d7f6706c8932a9a97202768bdd0053c5c36d10..93cbd125de96e0481a3f466c0a7e96dd04c89cd7 100644 --- a/loopy/diagnostic.py +++ b/loopy/diagnostic.py @@ -37,11 +37,11 @@ class LoopyAdvisory(LoopyWarningBase): pass -class ParameterFinderWarning(LoopyWarningBase): +class ParameterFinderWarning(LoopyWarning): pass -class WriteRaceConditionWarning(LoopyWarningBase): +class WriteRaceConditionWarning(LoopyWarning): pass # }}} diff --git a/loopy/target/pyopencl/__init__.py b/loopy/target/pyopencl/__init__.py index a0a119dce42e1095ff327f38f6b836f80091b159..174506cd65a81b405053c212c9683f9dd2df2cc1 100644 --- a/loopy/target/pyopencl/__init__.py +++ b/loopy/target/pyopencl/__init__.py @@ -125,16 +125,16 @@ def adjust_local_temp_var_storage(kernel, device): def check_sizes(kernel, device): import loopy as lp + from loopy.diagnostic import LoopyAdvisory, LoopyError + if device is None: from loopy.diagnostic import warn warn(kernel, "no_device_in_pre_codegen_checks", "No device parameter was passed to the PyOpenCLTarget. " "Perhaps you want to pass a device to benefit from " - "additional checking.") + "additional checking.", LoopyAdvisory) return - from loopy.diagnostic import LoopyAdvisory, LoopyError - parameters = {} for arg in kernel.args: if isinstance(arg, lp.ValueArg) and arg.approximately is not None: