Skip to content
Snippets Groups Projects
Commit 2e688ada authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Diagnostic message shuffling to support doctests

parent e410aebb
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
......@@ -37,11 +37,11 @@ class LoopyAdvisory(LoopyWarningBase):
pass
class ParameterFinderWarning(LoopyWarningBase):
class ParameterFinderWarning(LoopyWarning):
pass
class WriteRaceConditionWarning(LoopyWarningBase):
class WriteRaceConditionWarning(LoopyWarning):
pass
# }}}
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment