Skip to content

Commit

Permalink
arch: fix oneapi flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Oct 13, 2023
1 parent 5aaedf9 commit 7e67b81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 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 as _call_capture_output

from devito.arch import (AMDGPUX, Cpu64, M1, NVIDIAX, POWER8, POWER9, GRAVITON,
INTELGPUX, get_nvidia_cc, check_cuda_runtime,
INTELGPUX, PVC, 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 @@ -730,7 +730,7 @@ def __init__(self, *args, **kwargs):
self.cflags.append("-qopt-zmm-usage=high")

if language == 'openmp':
self.ldflags.append('-qopenmp')
self.cflags.append('-fiopenmp')

# Make sure the MPI compiler uses `icc` underneath -- whatever the MPI distro is
if kwargs.get('mpi'):
Expand Down Expand Up @@ -792,8 +792,8 @@ def __init__(self, *args, **kwargs):

# Earlier versions to OneAPI 2023.2.0 (clang17 underneath), have an OpenMP bug
if self.version < Version('17.0.0') and language == 'openmp':
self.ldflags.remove('-qopenmp')
self.ldflags.append('-fopenmp')
self.cflags.remove('-fiopenmp')
self.cflags.append('-fopenmp')

if language == 'sycl':
self.cflags.append('-fsycl')
Expand All @@ -804,9 +804,9 @@ def __init__(self, *args, **kwargs):

if platform is NVIDIAX:
self.cflags.append('-fopenmp-targets=nvptx64-cuda')
if platform is INTELGPUX:
self.cflags.append('-fopenmp-targets=spir64')
self.cflags.append('-fopenmp-target-simd')
if platform in [INTELGPUX, PVC]:
self.cflags.append('-fopenmp-targets=spir64')
self.cflags.append('-fopenmp-target-simd')

if platform is INTELGPUX:
self.cflags.remove('-g') # -g disables some optimizations in IGC
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https:/

# Drivers mandatory for intel gpus
RUN curl -fsSL https://repositories.intel.com/graphics/intel-graphics.key | apt-key add -
RUN echo "deb [trusted=yes arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main" > /etc/apt/sources.list.d/intel-graphics.list
RUN echo "deb [trusted=yes arch=amd64] https://repositories.intel.com/graphics/ubuntu all main" > /etc/apt/sources.list.d/intel-graphics.list

# Intel advisor and drivers
RUN apt-get update -y && \
Expand Down

0 comments on commit 7e67b81

Please sign in to comment.