Skip to content

Commit

Permalink
arch: Correct march to mcpu for ppc
Browse files Browse the repository at this point in the history
Switch between -march=native (x86) and -mcpu=native -mtune=native (PowerPC)

Costmetic changes so `mcpu` and `march` remain the first flag

Fix indentation

arch: Correct march to mcpu for ppc

Correcting commit message since editing the title on github webui wasn't enough (I couldn't figure out how to rebase from the webui, sorry!).

Maybe you can squash to this commit when merging?
  • Loading branch information
raminammour authored and mloubout committed Aug 8, 2023
1 parent a1506b6 commit 511e59d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def __init__(self, *args, **kwargs):

platform = kwargs.pop('platform', configuration['platform'])

self.cflags += ['-march=native', '-Wno-unused-result',
self.cflags += ['-Wno-unused-result',
'-Wno-unused-variable', '-Wno-unused-but-set-variable']

if configuration['safe-math']:
Expand All @@ -400,6 +400,12 @@ def __init__(self, *args, **kwargs):
# from `=512`
self.cflags.append('-mprefer-vector-width=512')

if platform in [POWER8, POWER9]:
# -march isn't supported on power architectures, is -mtune needed?
self.cflags = ['-mcpu=native'] + self.cflags
else:
self.cflags = ['-march=native'] + self.cflags

language = kwargs.pop('language', configuration['language'])
try:
if self.version >= Version("4.9.0"):
Expand Down

0 comments on commit 511e59d

Please sign in to comment.