Skip to content

Commit dd74d3c

Browse files
committed
compiler: fix linearization padding check
1 parent 5d07778 commit dd74d3c

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

devito/passes/iet/linearization.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,7 @@ def key1(f, d):
7070
if f.is_regular:
7171
# For paddable objects the following holds:
7272
# `same dim + same halo + same padding_dtype => same (auto-)padding`
73-
if d is f.dimensions[-1]:
74-
# Only the last dimension is padded
75-
try:
76-
if f.padding == f.mapped.padding:
77-
# Padding set from the mapped Function
78-
# e.g. from buffering or fft temp array
79-
pad_key = f.mapped.__padding_dtype__
80-
else:
81-
pad_key = f.__padding_dtype__
82-
except AttributeError:
83-
pad_key = f.__padding_dtype__
84-
else:
85-
pad_key = None
73+
pad_key = f.__padding_dtype__ if d is f.dimensions[-1] else None
8674

8775
return (d, f._size_halo[d], pad_key)
8876
else:

devito/types/array.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,14 @@ class MappedArrayMixin:
247247

248248

249249
class ArrayMapped(MappedArrayMixin, Array):
250-
is_autopaddable = True
250+
251+
@property
252+
def is_autopaddable(self):
253+
return self.mapped.is_autopaddable
254+
255+
@property
256+
def __padding_dtype__(self):
257+
return self.mapped.__padding_dtype__
251258

252259

253260
class ArrayObject(ArrayBasic):

0 commit comments

Comments
 (0)