Skip to content

Commit e8d3a53

Browse files
committed
compiler: add option to skip mapped alloc for rcompile
1 parent 763890f commit e8d3a53

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

devito/passes/iet/definitions.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ class DataManager:
8686
The language used to express data allocations, deletions, and host-device transfers.
8787
"""
8888

89-
def __init__(self, rcompile=None, sregistry=None, platform=None, **kwargs):
89+
def __init__(self, rcompile=None, sregistry=None, platform=None,
90+
options=None, **kwargs):
9091
self.rcompile = rcompile
9192
self.sregistry = sregistry
9293
self.platform = platform
94+
self.alloc_mapped = (options or {}).get('alloc_mapped', True)
9395

9496
def _alloc_object_on_low_lat_mem(self, site, obj, storage):
9597
"""
@@ -176,6 +178,10 @@ def _alloc_mapped_array_on_high_bw_mem(self, site, obj, storage, *args):
176178
"""
177179
Allocate a mapped Array in the host high bandwidth memory.
178180
"""
181+
if not self.alloc_mapped:
182+
# Mapped array assumed to be preallocated, likely from rcompile
183+
return
184+
179185
decl = Definition(obj)
180186

181187
sizeof_dtypeN = SizeOf(obj.indexed._C_typedata)

0 commit comments

Comments
 (0)