File tree Expand file tree Collapse file tree 4 files changed +9
-11
lines changed
unified-runtime/source/adapters/level_zero/v2 Expand file tree Collapse file tree 4 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ static constexpr size_t EVENTS_BURST = 64;
20
20
ur_event_handle_t event_pool::allocate () {
21
21
TRACK_SCOPE_LATENCY (" event_pool::allocate" );
22
22
23
- std::unique_lock<std::mutex > lock (* mutex);
23
+ std::unique_lock<ur_mutex > lock (mutex);
24
24
25
25
if (freelist.empty ()) {
26
26
auto start = events.size ();
@@ -46,7 +46,7 @@ ur_event_handle_t event_pool::allocate() {
46
46
void event_pool::free (ur_event_handle_t event) {
47
47
TRACK_SCOPE_LATENCY (" event_pool::free" );
48
48
49
- std::unique_lock<std::mutex > lock (* mutex);
49
+ std::unique_lock<ur_mutex > lock (mutex);
50
50
51
51
event->reset ();
52
52
freelist.push_back (event);
Original file line number Diff line number Diff line change @@ -31,11 +31,10 @@ class event_pool {
31
31
// store weak reference to the queue as event_pool is part of the queue
32
32
event_pool (ur_context_handle_t hContext,
33
33
std::unique_ptr<event_provider> Provider)
34
- : hContext(hContext), provider(std::move(Provider)),
35
- mutex (std::make_unique<std::mutex>()) {};
34
+ : hContext(hContext), provider(std::move(Provider)) {};
36
35
37
- event_pool (event_pool &&other) = default ;
38
- event_pool &operator =(event_pool &&other) = default ;
36
+ event_pool (event_pool &&other) = delete ;
37
+ event_pool &operator =(event_pool &&other) = delete ;
39
38
40
39
event_pool (const event_pool &) = delete ;
41
40
event_pool &operator =(const event_pool &) = delete ;
@@ -58,7 +57,7 @@ class event_pool {
58
57
std::deque<ur_event_handle_t_> events;
59
58
std::vector<ur_event_handle_t > freelist;
60
59
61
- std::unique_ptr<std::mutex> mutex;
60
+ ur_mutex mutex;
62
61
};
63
62
64
63
} // namespace v2
Original file line number Diff line number Diff line change 13
13
14
14
template <typename T> struct locked {
15
15
public:
16
- locked (T *object, std::unique_lock<std::mutex > &&lock)
16
+ locked (T *object, std::unique_lock<ur_mutex > &&lock)
17
17
: lock_(std::move(lock)) {
18
18
object_ = object;
19
19
}
20
20
T *operator ->() { return object_; }
21
21
22
22
private:
23
- std::unique_lock<std::mutex > lock_;
23
+ std::unique_lock<ur_mutex > lock_;
24
24
T *object_;
25
25
};
26
26
@@ -54,5 +54,5 @@ template <typename T> struct lockable {
54
54
55
55
private:
56
56
T object_;
57
- std::mutex mut_;
57
+ ur_mutex mut_;
58
58
};
Original file line number Diff line number Diff line change 19
19
#include " ../image_common.hpp"
20
20
#include " command_list_manager.hpp"
21
21
#include " common.hpp"
22
- #include " lockable.hpp"
23
22
24
23
using usm_unique_ptr_t = std::unique_ptr<void , std::function<void (void *)>>;
25
24
You can’t perform that action at this time.
0 commit comments