From f7ad374fe6b22a9c24a1cf7da0551bae9b6aa4ce Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Sun, 10 Sep 2023 22:45:21 -0500 Subject: [PATCH 1/2] Work around loop nest error --- loopy/transform/array_buffer_map.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopy/transform/array_buffer_map.py b/loopy/transform/array_buffer_map.py index 3c4092b74..9edf46d5b 100644 --- a/loopy/transform/array_buffer_map.py +++ b/loopy/transform/array_buffer_map.py @@ -238,7 +238,7 @@ def __init__(self, kernel, domain, sweep_inames, access_descriptors, non1_storage_shape = [] for saxis_len in storage_shape: - has_length_non1 = saxis_len != 1 + has_length_non1 = False non1_storage_axis_flags.append(has_length_non1) From c34412ff0c25c13ed4df639698d3c22c56b81c41 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Mon, 11 Sep 2023 18:18:33 -0500 Subject: [PATCH 2/2] force lengths to be non1 --- loopy/transform/array_buffer_map.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/loopy/transform/array_buffer_map.py b/loopy/transform/array_buffer_map.py index 9edf46d5b..419f90f5d 100644 --- a/loopy/transform/array_buffer_map.py +++ b/loopy/transform/array_buffer_map.py @@ -238,7 +238,7 @@ def __init__(self, kernel, domain, sweep_inames, access_descriptors, non1_storage_shape = [] for saxis_len in storage_shape: - has_length_non1 = False + has_length_non1 = True non1_storage_axis_flags.append(has_length_non1) @@ -279,12 +279,12 @@ def __init__(self, kernel, domain, sweep_inames, access_descriptors, from loopy.symbolic import aff_from_expr for saxis, bi, s in zip(storage_axis_names, storage_base_indices, storage_shape): - if s != 1: - cns = isl.Constraint.equality_from_aff( - aff_from_expr(aug_domain.get_space(), - var(saxis) - (var(saxis+"'") - bi))) + # if s != 1: + cns = isl.Constraint.equality_from_aff( + aff_from_expr(aug_domain.get_space(), + var(saxis) - (var(saxis+"'") - bi))) - aug_domain = aug_domain.add_constraint(cns) + aug_domain = aug_domain.add_constraint(cns) # }}} @@ -299,6 +299,7 @@ def __init__(self, kernel, domain, sweep_inames, access_descriptors, self.aug_domain = aug_domain self.storage_base_indices = storage_base_indices self.non1_storage_shape = non1_storage_shape + assert non1_storage_shape == storage_shape def augment_domain_with_sweep(self, domain, new_non1_storage_axis_names, boxify_sweep=False):