Skip to content

Commit 1fe09ba

Browse files
committed
compiler: Add CXX support types
1 parent 927bc82 commit 1fe09ba

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

devito/types/misc.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
from devito.types import Array, CompositeObject, Indexed, Symbol, LocalObject
1212
from devito.types.basic import IndexedData
13-
from devito.tools import Pickable, frozendict
13+
from devito.tools import CustomDtype, Pickable, frozendict
1414

1515
__all__ = ['Timer', 'Pointer', 'VolatileInt', 'FIndexed', 'Wildcard', 'Fence',
1616
'Global', 'Hyperplane', 'Indirection', 'Temp', 'TempArray', 'Jump',
17-
'nop', 'WeakFence', 'CriticalRegion']
17+
'nop', 'WeakFence', 'CriticalRegion', 'Auto', 'AutoRef', 'auto']
1818

1919

2020
class Timer(CompositeObject):
@@ -342,3 +342,19 @@ def closing(self):
342342
A wildcard for use in the RHS of Eqs that encode some kind of semantics
343343
(e.g., a synchronization operation) but no computation.
344344
"""
345+
346+
347+
# *** CXX support types
348+
349+
# NOTE: In C++, `auto` is a type specifier more than a type itself, but
350+
# it's a distinction we can afford to ignore, at least for now
351+
auto = CustomDtype('auto')
352+
auto_ref = CustomDtype('auto', modifier='&')
353+
354+
355+
class Auto(LocalObject):
356+
dtype = auto
357+
358+
359+
class AutoRef(LocalObject, sympy.Expr):
360+
dtype = auto_ref

0 commit comments

Comments
 (0)