[PATCH] D145591: [clang][HIP][OpenMP] Add warning if mixed HIP / OpenMP offloading
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 9 10:07:10 PST 2023
tra added a subscriber: jhuber6.
tra added a comment.
In D145591#4180908 <https://reviews.llvm.org/D145591#4180908>, @mhalk wrote:
> For example: when using `-x hip -fopenmp --offload-arch=...` (+ other reasonable parameters) a HIP program with OpenMP target directives will compile without warning / error.
> But only host-related OpenMP code will be executed properly.
>
> Another hint that HIP and OpenMP target offloading do not work concurrently ATM is that when compiling with `-x hip -fopenmp -fopenmp-targets=...` clang will throw an error.
It sounds like what we want is to make `-x hip` and `-fopenmp` mutually exclusive, with a hard error when both are used. If you look at the problem as "-fopenmp completely breaks HIP compilation", a warning is a bit too weak of a measure, IMO.
We can restate it all as "mixing offloading modes is not supported" and generalize it to both CUDA and HIP.
@jhuber6 - WDYT?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145591/new/
https://reviews.llvm.org/D145591
More information about the cfe-commits
mailing list