From cd3c08f85ecbee9e1379303ca8c6c3a60619a611 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Fri, 13 Sep 2013 20:50:22 -0500 Subject: [PATCH] Fix an error message for multi-D indexing on arrays without dim_tags --- loopy/kernel/array.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/loopy/kernel/array.py b/loopy/kernel/array.py index e829d7001..ebaff7283 100644 --- a/loopy/kernel/array.py +++ b/loopy/kernel/array.py @@ -917,18 +917,20 @@ def get_access_info(ary, index, eval_expr): array_name = ary.name - if ary.shape is None: + if ary.dim_tags is None: if len(index) != 1: - raise LoopyError("Array '%s' has unknown shape (shape is None) and " - "therefore only supports one-dimensional indexing." + raise LoopyError("Array '%s' has no known axis implementation " + "tags and therefore only supports one-dimensional " + "indexing. (Did you mean 'shape=loopy.auto' instead of " + "'shape=None'?)" % ary.name) return AccessInfo(array_name=array_name, subscripts=index, vector_index=None) - if len(ary.shape) != len(index): + if len(ary.dim_tags) != len(index): raise LoopyError("subscript to '%s[%s]' has the wrong " "number of indices (got: %d, expected: %d)" % ( - ary.name, index, len(index), len(ary.shape))) + ary.name, index, len(index), len(ary.dim_tags))) num_target_axes = ary.num_target_axes() -- GitLab