diff --git a/loopy/__init__.py b/loopy/__init__.py index ce2e50ecb03c4801386a263bce031ea7ac8156a0..cc5fc0c14372da7b785c0146dee41e74466b0630 100644 --- a/loopy/__init__.py +++ b/loopy/__init__.py @@ -28,6 +28,7 @@ import pyopencl as cl # TODO: Common subexpressions # TODO: Vectorize # TODO: Unroll +# TODO: Parallelize reduction @@ -114,13 +115,6 @@ class LoopDimension(Record): class LoopDomain(Record): __slots__ = ["dims"] - def name_to_idx(self, name): - for i, dim in enumerate(self.dims): - if dim.name == name: - return i - else: - raise KeyError("invalid dimension name: %s" % name) - def name_to_idx(self, name): for i, dim in enumerate(self.dims): if dim.name == name: @@ -355,6 +349,12 @@ class LoopKernel(LoopDomain): dim = self.dims[idx] + if dim.tag: + raise ValueError("cannot split already-tagged dimension") + + if new_tags and dim.name not in self.output_indices(): + raise NotImplementedError("cannot yet tag a non-output dimension") + if outer_name is None: outer_name = dim.name+"_outer" if inner_name is None: