From 569e4dd84c17a0e6a989cb4320a014791a27c654 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Fri, 13 Sep 2013 20:43:52 -0500 Subject: [PATCH] Add an error message for multi-D indexing on unknown-shape arrays --- loopy/kernel/array.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/loopy/kernel/array.py b/loopy/kernel/array.py index 85c905e3f..e829d7001 100644 --- a/loopy/kernel/array.py +++ b/loopy/kernel/array.py @@ -918,6 +918,11 @@ def get_access_info(ary, index, eval_expr): array_name = ary.name if ary.shape is None: + if len(index) != 1: + raise LoopyError("Array '%s' has unknown shape (shape is None) and " + "therefore only supports one-dimensional indexing." + % ary.name) + return AccessInfo(array_name=array_name, subscripts=index, vector_index=None) if len(ary.shape) != len(index): -- GitLab