Skip to content

Commit 2ada7bb

Browse files
committed
[OpenMP][NFCI] Remove effectively unused mutex
The only use was already guarded by a different lock in the caller of loadBinary.
1 parent f0ccaee commit 2ada7bb

File tree

3 files changed

+0
-11
lines changed

3 files changed

+0
-11
lines changed

openmp/libomptarget/include/PluginManager.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ struct PluginAdaptorTy {
8282

8383
llvm::DenseSet<const __tgt_device_image *> UsedImages;
8484

85-
// Mutex for thread-safety when calling RTL interface functions.
86-
// It is easier to enforce thread-safety at the libomptarget level,
87-
// so that developers of new RTLs do not have to worry about it.
88-
std::mutex Mtx;
89-
9085
private:
9186
/// Number of devices the underling plugins sees.
9287
int32_t NumberOfPluginDevices = -1;

openmp/libomptarget/src/device.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,6 @@ llvm::Error DeviceTy::init() {
561561

562562
// Load binary to device.
563563
__tgt_target_table *DeviceTy::loadBinary(__tgt_device_image *Img) {
564-
std::lock_guard<decltype(RTL->Mtx)> LG(RTL->Mtx);
565564
return RTL->load_binary(RTLDeviceID, Img);
566565
}
567566

openmp/libomptarget/src/interface.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
#include "OpenMP/OMPT/Interface.h"
1515
#include "OpenMP/OMPT/Callback.h"
1616
#include "PluginManager.h"
17-
#include "device.h"
18-
#include "omptarget.h"
1917
#include "private.h"
20-
#include "rtl.h"
2118

2219
#include "Shared/EnvironmentVar.h"
2320
#include "Shared/Profile.h"
@@ -28,8 +25,6 @@
2825
#include <cstdint>
2926
#include <cstdio>
3027
#include <cstdlib>
31-
#include <mutex>
32-
#include <type_traits>
3328

3429
#ifdef OMPT_SUPPORT
3530
using namespace llvm::omp::target::ompt;

0 commit comments

Comments
 (0)