From 2391d5afd15dbb9b07139da6189c7c36f9d2dd36 Mon Sep 17 00:00:00 2001 From: Gerard Gorman Date: Tue, 2 Apr 2024 10:39:44 +0100 Subject: [PATCH] Use get_nvidia_cc to get Nvidia gpu architecture rather than using 'native'. This fixes compilation errors on the Nvidia Jetson. --- devito/arch/compiler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/devito/arch/compiler.py b/devito/arch/compiler.py index 8151a9f68fd..beec68f52af 100644 --- a/devito/arch/compiler.py +++ b/devito/arch/compiler.py @@ -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