Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler: Enable AVX512 compiler support when available. #2184

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions devito/arch/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from codepy.toolchain import GCCToolchain, call_capture_output

from devito.arch import (AMDGPUX, Cpu64, M1, NVIDIAX, POWER8, POWER9, GRAVITON,
INTELGPUX, IntelSkylake, get_nvidia_cc, check_cuda_runtime,
INTELGPUX, get_nvidia_cc, check_cuda_runtime,
get_m1_llvm_path)
from devito.exceptions import CompilationError
from devito.logger import debug, warning, error
Expand Down Expand Up @@ -394,7 +394,7 @@ def __init__(self, *args, **kwargs):
else:
self.cflags.append('-ffast-math')

if isinstance(platform, IntelSkylake):
if platform.isa == 'avx512':
# The default is `=256` because avx512 slows down the CPU frequency;
# however, we empirically found that stencils generally benefit
# from `=512`
Expand Down Expand Up @@ -698,7 +698,6 @@ class IntelCompiler(Compiler):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need this back, and same for GCC one

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

self.cflags.append("-xHost")
Expand All @@ -708,8 +707,8 @@ def __init__(self, *args, **kwargs):
else:
self.cflags.append('-fp-model=fast')

if isinstance(platform, IntelSkylake):
# Systematically use 512-bit vectors on skylake
if platform.isa == 'avx512':
# Systematically use 512-bit vectors if avx512 is available.
self.cflags.append("-qopt-zmm-usage=high")

if language == 'openmp':
Expand Down