Skip to content

Commit 26b17d0

Browse files
committed
compiler: add missing C targets
1 parent dcb19e9 commit 26b17d0

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

devito/core/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
Cpu64CustomOperator, Cpu64CustomCXXOperator,
77
Cpu64CXXNoopCOperator, Cpu64CXXNoopOmpOperator,
88
Cpu64AdvCXXOperator, Cpu64AdvCXXOmpOperator,
9-
Cpu64FsgCXXOperator, Cpu64FsgCXXOmpOperator
9+
Cpu64FsgCXXOperator, Cpu64FsgCXXOmpOperator,
10+
Cpu64CustomCXXOmpOperator, Cpu64CustomCOperator
1011
)
1112
from devito.core.intel import (
1213
Intel64AdvCOperator, Intel64AdvOmpOperator,
@@ -33,11 +34,11 @@
3334
from devito.operator.registry import operator_registry
3435

3536
# Register CPU Operators
36-
operator_registry.add(Cpu64CustomOperator, Cpu64, 'custom', 'C')
37+
operator_registry.add(Cpu64CustomCOperator, Cpu64, 'custom', 'C')
3738
operator_registry.add(Cpu64CustomOperator, Cpu64, 'custom', 'openmp')
3839
operator_registry.add(Cpu64CustomOperator, Cpu64, 'custom', 'Copenmp')
3940
operator_registry.add(Cpu64CustomCXXOperator, Cpu64, 'custom', 'CXX')
40-
operator_registry.add(Cpu64CustomCXXOperator, Cpu64, 'custom', 'CXXopenmp')
41+
operator_registry.add(Cpu64CustomCXXOmpOperator, Cpu64, 'custom', 'CXXopenmp')
4142

4243
operator_registry.add(Cpu64NoopCOperator, Cpu64, 'noop', 'C')
4344
operator_registry.add(Cpu64NoopOmpOperator, Cpu64, 'noop', 'openmp')

devito/core/cpu.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,24 @@ def _make_iet_passes_mapper(cls, **kwargs):
321321
assert not (set(_known_passes) & set(_known_passes_disabled))
322322

323323

324-
class Cpu64CustomCXXOperator(Cpu64CustomOperator):
324+
class Cpu64CustomCXXOmpOperator(Cpu64CustomOperator):
325325

326326
_Target = CXXOmpTarget
327327
LINEARIZE = True
328328

329+
330+
class Cpu64CustomCOperator(Cpu64CustomOperator):
331+
332+
_Target = CTarget
333+
LINEARIZE = False
334+
335+
336+
class Cpu64CustomCXXOperator(Cpu64CustomOperator):
337+
338+
_Target = CXXTarget
339+
LINEARIZE = True
340+
341+
329342
# Language level
330343

331344

devito/operator/operator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,11 @@ def parse_kwargs(**kwargs):
15771577
else:
15781578
raise InvalidOperator(f"Illegal `opt={str(opt)}`")
15791579

1580+
# `openmp` in mode e.g `opt=('openmp', 'simd', {})`
1581+
if mode and 'openmp' in mode:
1582+
options['openmp'] = True
1583+
mode = tuple(i for i in as_tuple(mode) if i != 'openmp')
1584+
15801585
# `opt`, deprecated kwargs
15811586
kwopenmp = kwargs.get('openmp', options.get('openmp'))
15821587
if kwopenmp is None:

0 commit comments

Comments
 (0)