NVIDIA / NVIDIA/cccl

Link `CubDebug` with `CUB_DEBUG_LOG`

Open
#918 0 comments 0 reactions 0 assignees View on GitHub
cub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

We should define `CUB_STDERR` if `CUB_DEBUG_LOG` specified. Otherwise, users are unable to see which kernel produces an error in CUB. Reproducer:
```cpp
#define CUB_DEBUG_LOG
// #define CUB_STDERR // should not be needed
#include
#include

int main() {
std::size_t temp_storage_bytes = 0;
void *d_temp_storage = &temp_storage_bytes;
int *keys = nullptr;
cub::DeviceReduce::Sum(d_temp_storage, temp_storage_bytes, keys, keys, 1 << 20);
}
```

Expected behavior:
```bash
CUDA error 1 [cub/cub/block/../iterator/../util_device.cuh, 98]: invalid argument
CUDA error 1 [cub/cub/device/dispatch/dispatch_reduce.cuh, 743]: invalid argument
CUDA error 1 [cub/cub/device/dispatch/dispatch_reduce.cuh, 952]: invalid argument
```

Current behavior:
```cpp
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.