This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Disable libomptarget integration on unsupported platforms
ClosedPublic

Authored by gValarini on Dec 20 2022, 10:38 AM.

Diff Detail

Event Timeline

gValarini created this revision.Dec 20 2022, 10:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2022, 10:38 AM
gValarini requested review of this revision.Dec 20 2022, 10:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2022, 10:38 AM

It's a simple fix that should work, but could someone try compiling it on macOS? I don´t have a mac computer...

jhuber6 added inline comments.Dec 20 2022, 10:50 AM
openmp/runtime/src/kmp_config.h.cmake
97

Is this enough? We need to check the target OS, because even if the user builds on MacOS with libomptarget it won't always be included like if the user just passed -fopenmp.

gValarini added inline comments.Dec 20 2022, 11:08 AM
openmp/runtime/src/kmp_config.h.cmake
97

If I am not mistaken, that is already checked on the OpenMP CMakeLists.txt file. OPENMP_ENABLE_LIBOMPTARGET can only be set to 1 if the target OS is not either macOS or Windows.

But do you think it would be better to tie that to something like ! (KMP_OS_WINDOWS || KMP_OS_DARWIN)?

jhuber6 accepted this revision.Dec 20 2022, 11:10 AM
jhuber6 added inline comments.
openmp/runtime/src/kmp_config.h.cmake
97

You're right, forgot we did that check. It'll work for now and I guess we can revisit it if we ever want to lift that restriction.

This revision is now accepted and ready to land.Dec 20 2022, 11:10 AM
gValarini marked 2 inline comments as done.Dec 20 2022, 11:30 AM
gValarini added inline comments.
openmp/runtime/src/kmp_config.h.cmake
97

Perfect! I'll land it then.

This revision was automatically updated to reflect the committed changes.
gValarini marked an inline comment as done.