From 7b1e9be3220584f1f56d9df9d2201d4ce5100aa2 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 33186ead9c..6e08f511aa 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) @@ -601,7 +604,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':