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

Commit

Permalink
Fix device-side debug synchronous usage for seg sort
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed Jul 7, 2022
1 parent cdaa955 commit b54be7d
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 b54be7d

Please sign in to comment.