Skip to content

Commit 988246e

Browse files
igchorsmaslov-intel
andcommitted
Update sycl/plugins/unified_runtime/ur/ur.hpp
Co-authored-by: smaslov-intel <[email protected]>
1 parent dcf3dba commit 988246e

File tree

1 file changed

+5
-4
lines changed
  • sycl/plugins/unified_runtime/ur

1 file changed

+5
-4
lines changed

sycl/plugins/unified_runtime/ur/ur.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
#pragma once
99

1010
#include <atomic>
11+
#include <cstdint>
1112
#include <iostream>
13+
#include <functional>
1214
#include <mutex>
1315
#include <shared_mutex>
1416
#include <thread>
@@ -99,7 +101,7 @@ class SpinLock {
99101
std::atomic_flag MLock = ATOMIC_FLAG_INIT;
100102
};
101103

102-
// The wrapper for immutable Level-Zero data.
104+
// The wrapper for immutable data.
103105
// The data is initialized only once at first access (via ->) with the
104106
// initialization function provided in Init. All subsequent access to
105107
// the data just returns the already stored data.
@@ -147,7 +149,7 @@ struct ReferenceCounter {
147149

148150
// Supposed to be used in pi*GetInfo* methods where ref count value is
149151
// requested.
150-
pi_uint32 load() { return RefCount.load(); }
152+
uint32_t load() { return RefCount.load(); }
151153

152154
// This method allows to guard a code which needs to be executed when object's
153155
// ref count becomes zero after release. It is important to notice that only a
@@ -167,14 +169,13 @@ struct ReferenceCounter {
167169
bool decrementAndTest() { return --RefCount == 0; }
168170

169171
private:
170-
std::atomic<pi_uint32> RefCount;
172+
std::atomic<uint32_t> RefCount;
171173
};
172174

173175
// Base class to store common data
174176
struct _pi_object {
175177
_pi_object() : RefCount{} {}
176178

177-
// Level Zero doesn't do the reference counting, so we have to do.
178179
// Must be atomic to prevent data race when incrementing/decrementing.
179180
ReferenceCounter RefCount;
180181

0 commit comments

Comments
 (0)