Skip to content

Commit

Permalink
Merge pull request #2541 from devitocodes/amd-openmp
Browse files Browse the repository at this point in the history
arch: add missing openmp flag for aomp compiler
  • Loading branch information
mloubout authored Feb 19, 2025
2 parents dcc1559 + 9218e0f commit 8321193
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 @@ -549,14 +549,16 @@ def __init_finalize__(self, **kwargs):
if not configuration['safe-math']:
self.cflags.append('-ffast-math')

if language == 'openmp':
self.ldflags += ['-fopenmp']

if isinstance(platform, NvidiaDevice):
self.cflags.remove('-std=c99')
elif platform is AMDGPUX:
self.cflags.remove('-std=c99')
# Add flags for OpenMP offloading
if language in ['C', 'openmp']:
self.ldflags += ['-target', 'x86_64-pc-linux-gnu']
self.ldflags += ['-fopenmp']
self.ldflags += [f'--offload-arch={platform.march}']
elif platform in [POWER8, POWER9]:
# It doesn't make much sense to use AOMP on Power, but it should work
Expand Down

0 comments on commit 8321193

Please sign in to comment.