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

Commit

Permalink
Merge pull request #533 from senior-zero/fix-main/github/debug
Browse files Browse the repository at this point in the history
Fix cub::Debug for builds without RDC
  • Loading branch information
gevtushenko authored Jul 20, 2022
2 parents f4dd6b0 + 35cbe37 commit a8ef99a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion cub/util_debug.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,22 @@ cudaError_t Debug(cudaError_t error, const char *filename, int line)
{
// Clear the global CUDA error state which may have been set by the last
// call. Otherwise, errors may "leak" to unrelated kernel launches.
cudaGetLastError();

// clang-format off
#ifndef CUB_RDC_ENABLED
#define CUB_TEMP_DEVICE_CODE
#else
#define CUB_TEMP_DEVICE_CODE cudaGetLastError()
#endif

NV_IF_TARGET(
NV_IS_HOST,
(cudaGetLastError();),
(CUB_TEMP_DEVICE_CODE;)
);

#undef CUB_TEMP_DEVICE_CODE
// clang-format on

#ifdef CUB_STDERR
if (error)
Expand Down

0 comments on commit a8ef99a

Please sign in to comment.