Skip to content

Commit ce7c594

Browse files
authored
[SYCL][CUDA][HIP] Fix incorrectly constructed guards (#7382)
This showed up as a warning in the Windows build, I'm unsure if it's related but it may fix the sporadic barrier issue we've been seeing.
1 parent 5ee066e commit ce7c594

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3922,7 +3922,7 @@ pi_result cuda_piEnqueueEventsWaitWithBarrier(pi_queue command_queue,
39223922
CUstream cuStream = command_queue->get_next_compute_stream(
39233923
num_events_in_wait_list, event_wait_list, guard, &stream_token);
39243924
{
3925-
std::lock_guard(command_queue->barrier_mutex_);
3925+
std::lock_guard<std::mutex> guard(command_queue->barrier_mutex_);
39263926
if (command_queue->barrier_event_ == nullptr) {
39273927
PI_CHECK_ERROR(cuEventCreate(&command_queue->barrier_event_,
39283928
CU_EVENT_DISABLE_TIMING));

sycl/plugins/hip/pi_hip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3747,7 +3747,7 @@ pi_result hip_piEnqueueEventsWaitWithBarrier(pi_queue command_queue,
37473747
hipStream_t hipStream = command_queue->get_next_compute_stream(
37483748
num_events_in_wait_list, event_wait_list, guard, &stream_token);
37493749
{
3750-
std::lock_guard(command_queue->barrier_mutex_);
3750+
std::lock_guard<std::mutex> guard(command_queue->barrier_mutex_);
37513751
if (command_queue->barrier_event_ == nullptr) {
37523752
PI_CHECK_ERROR(hipEventCreate(&command_queue->barrier_event_));
37533753
}

0 commit comments

Comments
 (0)