Skip to content

Commit

Permalink
Merge pull request #2343 from devitocodes/sm_cc
Browse files Browse the repository at this point in the history
arch: Use get_nvidia_cc to get Nvidia GPU architecture
  • Loading branch information
ggorman authored Apr 3, 2024
2 parents 39ea32a + 6e64c16 commit 311cd4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,11 @@ def __init_finalize__(self, **kwargs):
proc_link_flags.append(i)
self.ldflags.extend(proc_link_flags)

self.cflags.append('-arch=native')
cc = get_nvidia_cc()
if cc:
self.cflags.append(f'-arch=sm_{cc}')
else:
self.cflags.append('-arch=native')

# Disable `warning #1650-D: result of call is not used`
# See `https://gist.github.com/gavinb/f2320f9eaa0e0a7efca6877a34047a9d` about
Expand Down

0 comments on commit 311cd4e

Please sign in to comment.