Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Commit c64885b

Browse files
authored
Merge pull request #524 from senior-zero/fix-main/github/debug_stream_sync_bp
Fix device-side debug synchronous usage for seg sort
2 parents 585201d + b54be7d commit c64885b

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

cub/device/dispatch/dispatch_segmented_sort.cuh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,14 @@ DeviceSegmentedSortContinuation(
603603
}
604604

605605
// Sync the stream if specified to flush runtime errors
606-
if (debug_synchronous)
606+
if (CUB_IS_HOST_CODE && debug_synchronous)
607607
{
608+
#if CUB_INCLUDE_HOST_CODE
608609
if (CubDebug(error = SyncStream(stream)))
609610
{
610611
return error;
611612
}
613+
#endif
612614
}
613615
}
614616

@@ -664,12 +666,14 @@ DeviceSegmentedSortContinuation(
664666
}
665667

666668
// Sync the stream if specified to flush runtime errors
667-
if (debug_synchronous)
669+
if (CUB_IS_HOST_CODE && debug_synchronous)
668670
{
671+
#if CUB_INCLUDE_HOST_CODE
669672
if (CubDebug(error = SyncStream(stream)))
670673
{
671674
return error;
672675
}
676+
#endif
673677
}
674678
}
675679

@@ -1664,14 +1668,6 @@ private:
16641668
{
16651669
return error;
16661670
}
1667-
1668-
if (debug_synchronous)
1669-
{
1670-
if (CubDebug(error = SyncStream(stream)))
1671-
{
1672-
return error;
1673-
}
1674-
}
16751671
#else
16761672
error = CubDebug(cudaErrorNotSupported);
16771673
#endif
@@ -1728,12 +1724,14 @@ private:
17281724
}
17291725

17301726
// Sync the stream if specified to flush runtime errors
1731-
if (debug_synchronous)
1727+
if (CUB_IS_HOST_CODE && debug_synchronous)
17321728
{
1729+
#if CUB_INCLUDE_HOST_CODE
17331730
if (CubDebug(error = SyncStream(stream)))
17341731
{
17351732
return error;
17361733
}
1734+
#endif
17371735
}
17381736

17391737
return error;

0 commit comments

Comments
 (0)