Skip to content

Commit

Permalink
arch: Use get_nvidia_cc to get Nvidia gpu architecture rather than us…
Browse files Browse the repository at this point in the history
…ing 'native'. This fixes compilation errors on the Nvidia Jetson.
  • Loading branch information
Gerard Gorman authored and mloubout committed Apr 2, 2024
1 parent 39ea32a commit 6e64c16
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 6e64c16

Please sign in to comment.