From 6054f2998afdee9f0636fb4734cd08aa04d30f7c Mon Sep 17 00:00:00 2001 From: Fabio Luporini Date: Thu, 3 Oct 2024 09:25:17 +0000 Subject: [PATCH] arch: Avoid deprecated compiler flags --- devito/arch/compiler.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devito/arch/compiler.py b/devito/arch/compiler.py index cc5c0bc85d..4166c8022e 100644 --- a/devito/arch/compiler.py +++ b/devito/arch/compiler.py @@ -47,6 +47,7 @@ def sniff_compiler_version(cc, allow_fail=False): else: raise RuntimeError("The `%s` compiler isn't available on this system" % cc) + ver = ver.strip() if ver.startswith("gcc"): compiler = "gcc" elif ver.startswith("clang"): @@ -63,13 +64,15 @@ def sniff_compiler_version(cc, allow_fail=False): compiler = "icx" elif ver.startswith("pgcc"): compiler = "pgcc" + elif ver.startswith("nvc++"): + compiler = "nvc" elif ver.startswith("cray"): compiler = "cray" else: compiler = "unknown" ver = Version("0") - if compiler in ["gcc", "icc", "icx"]: + if compiler in ["gcc", "icc", "icx", "nvc"]: try: # gcc-7 series only spits out patch level on dumpfullversion. res = run([cc, "-dumpfullversion"], stdout=PIPE, stderr=DEVNULL) @@ -605,7 +608,11 @@ def __init_finalize__(self, **kwargs): platform = kwargs.pop('platform', configuration['platform']) if platform is NVIDIAX: - self.cflags.append('-gpu=pinned') + if self.version >= Version("24.9"): + self.cflags.append('-gpu=mem:separate:pinnedalloc') + else: + self.cflags.append('-gpu=pinned') + if language == 'openacc': self.cflags.extend(['-mp', '-acc:gpu']) elif language == 'openmp':