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

Fix cub::Debug for builds without RDC #533

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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