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

Give a good error message for missing variables in get_problems().

parent 94107a5e
No related branches found
No related tags found
No related merge requests found
......@@ -37,14 +37,14 @@ Things to consider
To-do
^^^^^
- Just touching a variable written to by a non-idempotent
instruction makes that instruction also not idempotent
- assert dependencies <= parent_inames in loopy/__init__.py
???
- user interface for dim length prescription
- Give a good error message if a parameter assignment in get_problems()
is missing.
- Deal with equality constraints.
(These arise, e.g., when partitioning a loop of length 16 into 16s.)
......@@ -83,6 +83,9 @@ Future ideas
Dealt with
^^^^^^^^^^
- Give a good error message if a parameter assignment in get_problems()
is missing.
- Slab decomposition for ILP
-> I don't think that's possible.
......
......@@ -411,8 +411,15 @@ def get_problems(kernel, parameters):
glens, llens = kernel.get_grid_sizes_as_exprs()
from pymbolic import evaluate
glens = evaluate(glens, parameters)
llens = evaluate(llens, parameters)
from pymbolic.mapper.evaluator import UnknownVariableError
try:
glens = evaluate(glens, parameters)
llens = evaluate(llens, parameters)
except UnknownVariableError, name:
raise RuntimeError("When checking your kernel for problems, "
"a value for parameter '%s' was not available. Pass "
"it in the 'parameters' kwarg to check_kernels()."
% name)
if (max(len(glens), len(llens))
> kernel.device.max_work_item_dimensions):
......
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