From 2c5b310a7eb08cbc51325aeab994d03fcae45a55 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Wed, 2 Nov 2011 17:20:10 -0400 Subject: [PATCH] Be more rigorous about length-1 axes (don't insert them, don't ignore them). --- loopy/check.py | 6 ++++-- loopy/kernel.py | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/loopy/check.py b/loopy/check.py index fb52b8f15..8eb853035 100644 --- a/loopy/check.py +++ b/loopy/check.py @@ -8,8 +8,10 @@ from __future__ import division def check_for_unused_hw_axes_in_insns(kernel): group_size, local_size = kernel.get_grid_sizes_as_exprs() - group_axes = set(ax for ax, length in enumerate(group_size) if length != 1) - local_axes = set(ax for ax, length in enumerate(local_size) if length != 1) + group_axes = set(ax for ax, length in enumerate(group_size)) + local_axes = set(ax for ax, length in enumerate(local_size)) + + # alternative: just disregard length-1 dimensions? from loopy.kernel import LocalIndexTag, AutoLocalIndexTagBase, GroupIndexTag for insn in kernel.instructions: diff --git a/loopy/kernel.py b/loopy/kernel.py index d6b32c664..25efd65cc 100644 --- a/loopy/kernel.py +++ b/loopy/kernel.py @@ -844,8 +844,7 @@ class LoopKernel(Record): while cur_axis > len(size_list): from loopy import LoopyAdvisory - from warnings import warn - warn("%s axis %d unassigned--assuming length 1" % ( + raise RuntimeError("%s axis %d unused" % ( which, len(size_list)), LoopyAdvisory) size_list.append(zero_aff + 1) -- GitLab