|
10 | 10 |
|
11 | 11 | from devito.types import Array, CompositeObject, Indexed, Symbol, LocalObject |
12 | 12 | from devito.types.basic import IndexedData |
13 | | -from devito.tools import Pickable, frozendict |
| 13 | +from devito.tools import CustomDtype, Pickable, frozendict |
14 | 14 |
|
15 | 15 | __all__ = ['Timer', 'Pointer', 'VolatileInt', 'FIndexed', 'Wildcard', 'Fence', |
16 | 16 | 'Global', 'Hyperplane', 'Indirection', 'Temp', 'TempArray', 'Jump', |
17 | | - 'nop', 'WeakFence', 'CriticalRegion'] |
| 17 | + 'nop', 'WeakFence', 'CriticalRegion', 'Auto', 'AutoRef', 'auto'] |
18 | 18 |
|
19 | 19 |
|
20 | 20 | class Timer(CompositeObject): |
@@ -342,3 +342,19 @@ def closing(self): |
342 | 342 | A wildcard for use in the RHS of Eqs that encode some kind of semantics |
343 | 343 | (e.g., a synchronization operation) but no computation. |
344 | 344 | """ |
| 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