Skip to content

[OpenMP][Offload] - Ensure OPENMP_STANDALONE_BUILD is defined #94801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

estewart08
Copy link
Contributor

Without a value set conditional checks like
if(NOT ${OPENMP_STANDALONE_BUILD})
will not be able to evaluate to true.
Fixes issue introduced from PR #93463, which did not allow the OMPT variable to be propogated up to offload during a runtimes build.

Without a value set conditional checks like
if(NOT ${OPENMP_STANDALONE_BUILD})
will not be able to evaluate to true.
Fixes issue introduced from PR llvm#93463, which did not allow
the OMPT variable to be propogated up to offload during a
runtimes build.
@llvmbot llvmbot added openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime offload labels Jun 7, 2024
@estewart08 estewart08 requested review from ronlieb and jhuber6 June 7, 2024 20:21
@llvmbot
Copy link
Member

llvmbot commented Jun 7, 2024

@llvm/pr-subscribers-offload

Author: None (estewart08)

Changes

Without a value set conditional checks like
if(NOT ${OPENMP_STANDALONE_BUILD})
will not be able to evaluate to true.
Fixes issue introduced from PR #93463, which did not allow the OMPT variable to be propogated up to offload during a runtimes build.


Full diff: https://github.com/llvm/llvm-project/pull/94801.diff

2 Files Affected:

  • (modified) offload/CMakeLists.txt (+2)
  • (modified) openmp/CMakeLists.txt (+2)
diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index 03b6201865620..ead2aed414ffe 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -7,6 +7,8 @@ set(LLVM_SUBPROJECT_TITLE "liboffload")
 if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
   set(OPENMP_STANDALONE_BUILD TRUE)
   project(offload C CXX ASM)
+else()
+  set(OPENMP_STANDALONE_BUILD FALSE)
 endif()
 
 # Check that the library can actually be built.
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index e565354ccc7f2..3b4259dfa380e 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -13,6 +13,8 @@ list(INSERT CMAKE_MODULE_PATH 0
 if (OPENMP_STANDALONE_BUILD OR "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
   set(OPENMP_STANDALONE_BUILD TRUE)
   project(openmp C CXX ASM)
+else()
+  set(OPENMP_STANDALONE_BUILD FALSE)
 endif()
 
 # Must go below project(..)

@estewart08 estewart08 requested review from jhuber6 and dhruvachak June 7, 2024 20:22
@jhuber6 jhuber6 merged commit 89c92b0 into llvm:main Jun 7, 2024
9 checks passed
@estewart08 estewart08 deleted the openmp-standalone-variable-fix branch June 7, 2024 20:44
nekoshirro pushed a commit to nekoshirro/Alchemist-LLVM that referenced this pull request Jun 9, 2024
…4801)

Without a value set conditional checks like
if(NOT ${OPENMP_STANDALONE_BUILD})
will not be able to evaluate to true.
Fixes issue introduced from PR llvm#93463, which did not allow the OMPT
variable to be propogated up to offload during a runtimes build.

Signed-off-by: Hafidz Muzakky <ais.muzakky@gmail.com>
@HerrCai0907 HerrCai0907 mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
offload openmp:libomp OpenMP host runtime openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants