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

Commit

Permalink
Merge pull request #524 from senior-zero/fix-main/github/debug_stream…
Browse files Browse the repository at this point in the history
…_sync_bp

Fix device-side debug synchronous usage for seg sort
  • Loading branch information
gevtushenko committed Jul 8, 2022
2 parents 585201d + b54be7d commit c64885b
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions cub/device/dispatch/dispatch_segmented_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,14 @@ DeviceSegmentedSortContinuation(
}

// Sync the stream if specified to flush runtime errors
if (debug_synchronous)
if (CUB_IS_HOST_CODE && debug_synchronous)
{
#if CUB_INCLUDE_HOST_CODE
if (CubDebug(error = SyncStream(stream)))
{
return error;
}
#endif
}
}

Expand Down Expand Up @@ -664,12 +666,14 @@ DeviceSegmentedSortContinuation(
}

// Sync the stream if specified to flush runtime errors
if (debug_synchronous)
if (CUB_IS_HOST_CODE && debug_synchronous)
{
#if CUB_INCLUDE_HOST_CODE
if (CubDebug(error = SyncStream(stream)))
{
return error;
}
#endif
}
}

Expand Down Expand Up @@ -1664,14 +1668,6 @@ private:
{
return error;
}

if (debug_synchronous)
{
if (CubDebug(error = SyncStream(stream)))
{
return error;
}
}
#else
error = CubDebug(cudaErrorNotSupported);
#endif
Expand Down Expand Up @@ -1728,12 +1724,14 @@ private:
}

// Sync the stream if specified to flush runtime errors
if (debug_synchronous)
if (CUB_IS_HOST_CODE && debug_synchronous)
{
#if CUB_INCLUDE_HOST_CODE
if (CubDebug(error = SyncStream(stream)))
{
return error;
}
#endif
}

return error;
Expand Down

0 comments on commit c64885b

Please sign in to comment.