Skip to content

Commit 59ff1bf

Browse files
committed
compiler: Add LocalType._C_tag
1 parent 24db970 commit 59ff1bf

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

devito/ir/iet/visitors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ def _gen_value(self, obj, mode=1, masked=()):
305305
qualifiers = [v for k, v in self._qualifiers_mapper.items()
306306
if getattr(obj.function, k, False) and v not in masked]
307307

308+
if obj.is_LocalObject and mode == 2:
309+
qualifiers.extend(as_tuple(obj._C_tag))
310+
308311
if (obj._mem_stack or obj._mem_constant) and mode == 1:
309312
strtype = self.ccode(obj._C_typedata)
310313
strshape = ''.join(f'[{self.ccode(i)}]' for i in obj.symbolic_shape)

devito/types/basic.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,8 +1875,17 @@ def _mem_internal_lazy(self):
18751875
return self._liveness == 'lazy'
18761876

18771877
"""
1878-
A modifier added to the subclass C declaration when it appears
1879-
in a function signature. For example, a subclass might define `_C_modifier = '&'`
1878+
A modifier added to the declaration of the LocalType when it appears in a
1879+
function signature. For example, a subclass might define `_C_modifier = '&'`
18801880
to impose pass-by-reference semantics.
18811881
"""
18821882
_C_modifier = None
1883+
1884+
"""
1885+
One or more optional keywords added to the declaration of the LocalType
1886+
in between the type and the variable name when it appears in a function
1887+
signature. For example, some languages support these to modify the way
1888+
the compiler generates code for passing the parameter and how the
1889+
runtime accesses it.
1890+
"""
1891+
_C_tag = None

0 commit comments

Comments
 (0)