Skip to content
Snippets Groups Projects
Commit fbf1ec12 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Assert non-empty assignments on kernelcreation

This yields better error messages
parent 212776a3
Branches
Tags
1 merge request!108AssignmentCollection.__bool__
...@@ -16,6 +16,7 @@ def create_cuda_kernel(assignments, ...@@ -16,6 +16,7 @@ def create_cuda_kernel(assignments,
ghost_layers=None, ghost_layers=None,
skip_independence_check=False, skip_independence_check=False,
use_textures_for_interpolation=True): use_textures_for_interpolation=True):
assert assignments, "Assignments must not be empty!"
fields_read, fields_written, assignments = add_types(assignments, type_info, not skip_independence_check) fields_read, fields_written, assignments = add_types(assignments, type_info, not skip_independence_check)
all_fields = fields_read.union(fields_written) all_fields = fields_read.union(fields_written)
read_only_fields = set([f.name for f in fields_read - fields_written]) read_only_fields = set([f.name for f in fields_read - fields_written])
......
from types import MappingProxyType
from itertools import combinations from itertools import combinations
from types import MappingProxyType
import sympy as sp import sympy as sp
...@@ -74,6 +74,7 @@ def create_kernel(assignments, ...@@ -74,6 +74,7 @@ def create_kernel(assignments,
[0., 0., 0., 0., 0.]]) [0., 0., 0., 0., 0.]])
""" """
# ---- Normalizing parameters # ---- Normalizing parameters
assert assignments, "Assignments must not be empty!"
split_groups = () split_groups = ()
if isinstance(assignments, AssignmentCollection): if isinstance(assignments, AssignmentCollection):
if 'split_groups' in assignments.simplification_hints: if 'split_groups' in assignments.simplification_hints:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment