|
13 | 13 | from codepy.toolchain import GCCToolchain, call_capture_output |
14 | 14 |
|
15 | 15 | from devito.arch import (AMDGPUX, Cpu64, M1, NVIDIAX, POWER8, POWER9, GRAVITON, |
16 | | - INTELGPUX, IntelSkylake, get_nvidia_cc, check_cuda_runtime, |
| 16 | + INTELGPUX, get_nvidia_cc, check_cuda_runtime, |
17 | 17 | get_m1_llvm_path) |
18 | 18 | from devito.exceptions import CompilationError |
19 | 19 | from devito.logger import debug, warning, error |
@@ -394,11 +394,15 @@ def __init__(self, *args, **kwargs): |
394 | 394 | else: |
395 | 395 | self.cflags.append('-ffast-math') |
396 | 396 |
|
397 | | - if isinstance(platform, IntelSkylake): |
398 | | - # The default is `=256` because avx512 slows down the CPU frequency; |
399 | | - # however, we empirically found that stencils generally benefit |
400 | | - # from `=512` |
401 | | - self.cflags.append('-mprefer-vector-width=512') |
| 397 | + if platform.isa == 'avx512': |
| 398 | + if self.version >= Version("8.0.0"): |
| 399 | + # The default is `=256` because avx512 slows down the CPU frequency; |
| 400 | + # however, we empirically found that stencils generally benefit |
| 401 | + # from `=512` |
| 402 | + self.cflags.append('-mprefer-vector-width=512') |
| 403 | + else: |
| 404 | + # Unsupported on earlier versions |
| 405 | + pass |
402 | 406 |
|
403 | 407 | if platform in [POWER8, POWER9]: |
404 | 408 | # -march isn't supported on power architectures, is -mtune needed? |
@@ -708,8 +712,8 @@ def __init__(self, *args, **kwargs): |
708 | 712 | else: |
709 | 713 | self.cflags.append('-fp-model=fast') |
710 | 714 |
|
711 | | - if isinstance(platform, IntelSkylake): |
712 | | - # Systematically use 512-bit vectors on skylake |
| 715 | + if platform.isa == 'avx512': |
| 716 | + # Systematically use 512-bit vectors if avx512 is available. |
713 | 717 | self.cflags.append("-qopt-zmm-usage=high") |
714 | 718 |
|
715 | 719 | if language == 'openmp': |
|
0 commit comments