Skip to content

Commit

Permalink
Use get_nvidia_cc to get Nvidia gpu architecture rather than using 'n…
Browse files Browse the repository at this point in the history
…ative'. This fixes compilation errors on the Nvidia Jetson.
  • Loading branch information
Gerard Gorman committed Apr 2, 2024
1 parent 39ea32a commit 2391d5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,9 @@ 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}')

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

0 comments on commit 2391d5a

Please sign in to comment.