Skip to content

Commit b7c7b95

Browse files
committed
arch: separate intel and oneapi compilers
1 parent 9bd9877 commit b7c7b95

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

devito/arch/compiler.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ def __init_finalize__(self, **kwargs):
912912
warning("Running on Intel KNL without OpenMP is highly discouraged")
913913

914914

915-
class OneapiCompiler(IntelCompiler):
915+
class OneapiCompiler(Compiler):
916916

917917
def __init_finalize__(self, **kwargs):
918918
IntelCompiler.__init_finalize__(self, **kwargs)
@@ -955,8 +955,6 @@ def __init_intel_mpi__(self, **kwargs):
955955
def __init_intel_mpi_flags__(self, **kwargs):
956956
pass
957957

958-
get_version = Compiler.get_version
959-
960958
def __lookup_cmds__(self):
961959
# OneAPI HPC ToolKit comes with icpx, which is clang++,
962960
# and icx, which is clang

devito/passes/iet/languages/openmp.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from devito.arch import AMDGPUX, INTELGPUX, NVIDIAX, PVC
88
from devito.arch.compiler import (
9-
CustomCompiler, GNUCompiler, IntelCompiler, NvidiaCompiler, OneapiCompiler
9+
CustomCompiler, GNUCompiler, IntelCompiler, NvidiaCompiler
1010
)
1111
from devito.ir import (
1212
Call, Conditional, DeviceCall, FindSymbols, List, ParallelBlock, PointerCast, Pragma,
@@ -283,10 +283,8 @@ def _support_nested_parallelism(cls, compiler):
283283
# In case we have a CustomCompiler
284284
if isinstance(compiler, CustomCompiler):
285285
compiler = compiler._base()
286-
# Only supported by icc (IntelCompiler) but not by
287-
# OneAPI's DPC++ compiler (OneapiCompiler) that inherits from IntelCompiler
288-
return isinstance(compiler, IntelCompiler) and not \
289-
isinstance(compiler, OneapiCompiler)
286+
# Only supported by icc (IntelCompiler)
287+
return isinstance(compiler, IntelCompiler)
290288

291289

292290
class Ompizer(AbstractOmpizer):

tests/test_dle.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
SparseTimeFunction, SubDimension, TimeFunction, configuration, cos, dimensions, info,
1313
switchconfig
1414
)
15-
from devito.arch.compiler import IntelCompiler, OneapiCompiler
15+
from devito.arch.compiler import IntelCompiler
1616
from devito.exceptions import InvalidArgument
1717
from devito.ir.iet import (
1818
Expression, FindNodes, IsPerfectIteration, Iteration, retrieve_iteration_tree
@@ -1489,8 +1489,7 @@ def test_nested_parallelism_support(self):
14891489
# Check omp pargams
14901490
assert trees[0][0].pragmas[0].ccode.value == \
14911491
'omp for collapse(2) schedule(dynamic,1)'
1492-
if isinstance(configuration['compiler'], IntelCompiler) and \
1493-
not isinstance(configuration['compiler'], OneapiCompiler):
1492+
if isinstance(configuration['compiler'], IntelCompiler):
14941493
# Supports nested parallelism
14951494
assert trees[0][2].pragmas[0].ccode.value == \
14961495
'omp parallel for collapse(2) schedule(dynamic,1)'\

0 commit comments

Comments
 (0)