Skip to content

Commit 5352b42

Browse files
authored
[SYCL][PI][CUDA] Fix too many streams getting synchronized (#6333)
Fixed off-by-one error introduced in #6201 that would cause queue synchronization to synchronize all streams when no stream has been used. The code worked correctly, but this can in some cases impact performance.
1 parent 74369c8 commit 5352b42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sycl/plugins/cuda/pi_cuda.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ struct _pi_queue {
535535
} else {
536536
start %= size;
537537
end %= size;
538-
if (start < end) {
538+
if (start <= end) {
539539
sync_compute(start, end);
540540
} else {
541541
sync_compute(start, size);
@@ -557,7 +557,7 @@ struct _pi_queue {
557557
} else {
558558
start %= size;
559559
end %= size;
560-
if (start < end) {
560+
if (start <= end) {
561561
sync_transfer(start, end);
562562
} else {
563563
sync_transfer(start, size);

0 commit comments

Comments
 (0)