From 511e59d41ae564d3d74898d21c9e55e791de5ea8 Mon Sep 17 00:00:00 2001 From: Rami Date: Thu, 27 Jul 2023 10:03:00 -0500 Subject: [PATCH 1/2] arch: Correct march to mcpu for ppc 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? --- devito/arch/compiler.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/devito/arch/compiler.py b/devito/arch/compiler.py index fb740e5841..0161ce5a66 100644 --- a/devito/arch/compiler.py +++ b/devito/arch/compiler.py @@ -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']: @@ -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"): From 7caa50cdeb7008021c6a3745bf1288a91f80b196 Mon Sep 17 00:00:00 2001 From: Mathias Louboutin Date: Tue, 8 Aug 2023 15:45:20 -0400 Subject: [PATCH 2/2] misc: fix flake8 --- devito/arch/compiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devito/arch/compiler.py b/devito/arch/compiler.py index 0161ce5a66..738f379105 100644 --- a/devito/arch/compiler.py +++ b/devito/arch/compiler.py @@ -401,10 +401,10 @@ def __init__(self, *args, **kwargs): 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 + # -march isn't supported on power architectures, is -mtune needed? + self.cflags = ['-mcpu=native'] + self.cflags else: - self.cflags = ['-march=native'] + self.cflags + self.cflags = ['-march=native'] + self.cflags language = kwargs.pop('language', configuration['language']) try: