Skip to content

Commit c9e5a98

Browse files
committed
Moved std::once_flag to a private member
1 parent 3e90237 commit c9e5a98

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/adapters/cuda/queue.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct ur_queue_handle_t_ {
3232
// Stream used solely when profiling is enabled
3333
native_type ProfStream;
3434
bool IsProfStreamCreated{false};
35+
std::once_flag ProfStreamFlag;
3536
// delay_compute_ keeps track of which streams have been recently reused and
3637
// their next use should be delayed. If a stream has been recently reused it
3738
// will be skipped the next time it would be selected round-robin style. When
@@ -107,7 +108,6 @@ struct ur_queue_handle_t_ {
107108
// Function which creates the profiling stream. Called only if profiling is
108109
// enabled.
109110
void createProfilingStream() {
110-
static std::once_flag ProfStreamFlag;
111111
std::call_once(ProfStreamFlag, [&]() {
112112
UR_CHECK_ERROR(
113113
cuStreamCreateWithPriority(&ProfStream, CU_STREAM_NON_BLOCKING, 0));

source/adapters/hip/queue.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct ur_queue_handle_t_ {
2828
// Stream used solely when profiling is enabled
2929
native_type ProfStream;
3030
bool IsProfStreamCreated{false};
31+
std::once_flag ProfStreamFlag;
3132
// DelayCompute keeps track of which streams have been recently reused and
3233
// their next use should be delayed. If a stream has been recently reused it
3334
// will be skipped the next time it would be selected round-robin style. When
@@ -104,7 +105,6 @@ struct ur_queue_handle_t_ {
104105
// Function which creates the profiling stream. Called only if profiling is
105106
// enabled.
106107
void createProfilingStream() {
107-
static std::once_flag ProfStreamFlag;
108108
std::call_once(ProfStreamFlag, [&]() {
109109
UR_CHECK_ERROR(
110110
hipStreamCreateWithFlags(&ProfStream, hipStreamNonBlocking));

0 commit comments

Comments
 (0)