Skip to content
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

[OpenMP][NFC] Rename OmptCallback.cpp into OpenMP/OMPT/Callback.cpp #73813

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

jdoerfert
Copy link
Member

Also revert the ifdef OMPT_SUPPORT order to have the short fallback first and not after 400 lines.

Also revert the ifdef OMPT_SUPPORT order to have the short fallback
first and not after 400 lines.
@jdoerfert jdoerfert added openmp openmp:libomptarget OpenMP offload runtime labels Nov 29, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 29, 2023

@llvm/pr-subscribers-openmp

Author: Johannes Doerfert (jdoerfert)

Changes

Also revert the ifdef OMPT_SUPPORT order to have the short fallback first and not after 400 lines.


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

2 Files Affected:

  • (modified) openmp/libomptarget/src/CMakeLists.txt (+1-1)
  • (renamed) openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp (+10-8)
diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
index a83965f59b3eb04..8d85662888090a8 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/openmp/libomptarget/src/CMakeLists.txt
@@ -19,10 +19,10 @@ add_llvm_library(omptarget
   device.cpp
   interface.cpp
   omptarget.cpp
-  OmptCallback.cpp
   rtl.cpp
   LegacyAPI.cpp
   OpenMP/InteropAPI.cpp
+  OpenMP/OMPT/Callback.cpp
 
   ADDITIONAL_HEADER_DIRS
   ${LIBOMPTARGET_INCLUDE_DIR}
diff --git a/openmp/libomptarget/src/OmptCallback.cpp b/openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
similarity index 99%
rename from openmp/libomptarget/src/OmptCallback.cpp
rename to openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
index a45d1a0f282ac02..f1a8ad0e3cafb7b 100644
--- a/openmp/libomptarget/src/OmptCallback.cpp
+++ b/openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
@@ -1,4 +1,4 @@
-//===-- OmptCallback.cpp - Target independent OpenMP target RTL --- C++ -*-===//
+//===-- OpenMP/OMPT/Callback.cpp - OpenMP Tooling Callback implementation -===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 // See https://llvm.org/LICENSE.txt for license information.
@@ -10,9 +10,14 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifdef OMPT_SUPPORT
+#ifndef OMPT_SUPPORT
 
-#include "llvm/Support/DynamicLibrary.h"
+extern "C" {
+/// Dummy definition when OMPT is disabled
+void ompt_libomptarget_connect() {}
+}
+
+#else // OMPT_SUPPORT is set
 
 #include <cstdlib>
 #include <cstring>
@@ -24,6 +29,8 @@
 #include "OpenMP/OMPT/Connector.h"
 #include "OpenMP/OMPT/Interface.h"
 
+#include "llvm/Support/DynamicLibrary.h"
+
 #undef DEBUG_PREFIX
 #define DEBUG_PREFIX "OMPT"
 
@@ -491,9 +498,4 @@ void ompt_libomptarget_connect(ompt_start_tool_result_t *result) {
   DP("Leave ompt_libomptarget_connect\n");
 }
 }
-#else
-extern "C" {
-/// Dummy definition when OMPT is disabled
-void ompt_libomptarget_connect() {}
-}
 #endif // OMPT_SUPPORT

@jdoerfert jdoerfert merged commit bdecfeb into llvm:main Nov 29, 2023
5 checks passed
@jdoerfert jdoerfert deleted the offload_prep branch November 29, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomptarget OpenMP offload runtime openmp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants