[PATCH] D120353: [OpenMP] Add option to make offloading mandatory

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 22 14:07:47 PST 2022


jhuber6 added a comment.

In D120353#3338589 <https://reviews.llvm.org/D120353#3338589>, @ABataev wrote:

>> This is necessary for implementing features like conditional offloading and ensuring that unhandled pragmas don't result in missing symbols.
>
> This behavior is part of the standard.

I believe it's reasonable to have this as an option flag to defy the standard, we have other flags that do this already (e.g. -fopenmp-cuda-mode).

>> For offloading tests we can silently fail to the host without realizing that offloading failed.
>
> It is controlled by the OMP_TARGET_OFFLOAD env variable, no? You can set this env var to mandatory to avoid this problem.

Yes, I don't think we set it in the tests right now for some reason. But the main reason I made this patch is for interoperability. Without this if you want to call a CUDA function from the OpenMP device you'd need a variant and a dummy implementation. If you don't write a dummy implementation you'll get a linker error, if you don't use a variant you'll override the CUDA version.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120353/new/

https://reviews.llvm.org/D120353



More information about the cfe-commits mailing list