diff --git a/devito/arch/compiler.py b/devito/arch/compiler.py index dbd361ae4e..151bba868a 100644 --- a/devito/arch/compiler.py +++ b/devito/arch/compiler.py @@ -434,10 +434,8 @@ def __init_finalize__(self, **kwargs): if platform in [POWER8, POWER9]: # -march isn't supported on power architectures, is -mtune needed? self.cflags = ['-mcpu=native'] + self.cflags - elif platform is Graviton: - # Graviton flag - mx = platform.march - self.cflags = ['-mcpu=%s' % mx] + self.cflags + elif isinstance(platform, Graviton): + self.cflags = ['-mcpu=%s' % platform.march] + self.cflags else: self.cflags = ['-march=native'] + self.cflags @@ -466,9 +464,8 @@ def __init_finalize__(self, **kwargs): platform = kwargs.pop('platform', configuration['platform']) # Graviton flag - if platform is Graviton: - mx = platform.march - self.cflags += ['-mcpu=%s' % mx] + if isinstance(platform, Graviton): + self.cflags += ['-mcpu=%s' % platform.march] class ClangCompiler(Compiler): @@ -979,11 +976,8 @@ def __getitem__(self, key): return partial(GNUCompiler, suffix=i) return super().__getitem__(key) - def has_key(self, k): - return k in self.keys() or k.startswith('gcc-') - def __contains__(self, k): - return self.has_key(k) + return k in self.keys() or k.startswith('gcc-') _compiler_registry = {