Skip to content

Commit c455b7e

Browse files
mlouboutFabioLuporini
authored andcommitted
compiler: prevent array reductions with nvc++
1 parent 6d494db commit c455b7e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

devito/passes/iet/languages/openmp.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from sympy import And, Ne, Not
66

77
from devito.arch import AMDGPUX, NVIDIAX, INTELGPUX, PVC
8-
from devito.arch.compiler import GNUCompiler
8+
from devito.arch.compiler import GNUCompiler, NvidiaCompiler
99
from devito.ir import (Call, Conditional, DeviceCall, List, Pragma, Prodder,
1010
ParallelBlock, PointerCast, While, FindSymbols)
1111
from devito.passes.iet.definitions import DataManager, DeviceAwareDataManager
@@ -224,7 +224,11 @@ def _support_array_reduction(cls, compiler):
224224
if isinstance(compiler, GNUCompiler) and \
225225
compiler.version < Version("6.0"):
226226
return False
227-
return True
227+
elif isinstance(compiler, NvidiaCompiler):
228+
# NVC++ does not support array reduction and leads to segfault
229+
return False
230+
else:
231+
return True
228232

229233

230234
class DeviceOmpizer(PragmaDeviceAwareTransformer):

0 commit comments

Comments
 (0)