Skip to content

Commit

Permalink
[OpenMP][NFC] Move rtl.cpp to OffloadRTL.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
jdoerfert committed Dec 12, 2023
1 parent cee6918 commit f0ccaee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
2 changes: 1 addition & 1 deletion openmp/libomptarget/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ add_llvm_library(omptarget
device.cpp
interface.cpp
omptarget.cpp
rtl.cpp
OffloadRTL.cpp
LegacyAPI.cpp
PluginManager.cpp
DeviceImage.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,28 @@
//
//===----------------------------------------------------------------------===//
//
// Functionality for handling RTL plugins.
// Initialization and tear down of the offload runtime.
//
//===----------------------------------------------------------------------===//

#include "llvm/Object/OffloadBinary.h"

#include "DeviceImage.h"
#include "OpenMP/OMPT/Callback.h"
#include "PluginManager.h"
#include "device.h"
#include "private.h"
#include "rtl.h"

#include "Shared/Debug.h"
#include "Shared/Profile.h"
#include "Shared/Utils.h"

#include <cassert>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <mutex>
#include <string>

using namespace llvm;
using namespace llvm::sys;
using namespace llvm::omp::target;

#ifdef OMPT_SUPPORT
extern void ompt::connectLibrary();
extern void llvm::omp::target::ompt::connectLibrary();
#endif

__attribute__((constructor(101))) void init() {
DP("Init target library!\n");
DP("Init offload library!\n");

PM = new PluginManager();

#ifdef OMPT_SUPPORT
// Initialize OMPT first
ompt::connectLibrary();
llvm::omp::target::ompt::connectLibrary();
#endif

PM->init();
Expand All @@ -55,6 +37,6 @@ __attribute__((constructor(101))) void init() {
}

__attribute__((destructor(101))) void deinit() {
DP("Deinit target library!\n");
DP("Deinit offload library!\n");
delete PM;
}

0 comments on commit f0ccaee

Please sign in to comment.