Skip to content

Commit

Permalink
Merge pull request #2461 from devitocodes/avoid-deprecated-flags
Browse files Browse the repository at this point in the history
arch: Avoid deprecated compiler flags
  • Loading branch information
mloubout authored Oct 9, 2024
2 parents 9548e67 + 6054f29 commit 1cd8cf3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand All @@ -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)
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit 1cd8cf3

Please sign in to comment.