Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a03f952
[cub] Add cooperative global-memory histogram baseline
brycelelbach Jul 31, 2026
9a3fe34
[cub] Add shared-memory cache for high-bin histograms
brycelelbach Jul 31, 2026
95ae80d
[cub] Address cooperative histogram review
brycelelbach Aug 11, 2026
9eb7692
[cub] Harden cooperative histogram dispatch
brycelelbach Aug 30, 2026
975ff8d
[cub] Fix cooperative launch compatibility
brycelelbach Aug 30, 2026
6ae0302
[cub] Keep histogram stream operators inline
brycelelbach Aug 31, 2026
ff77e2e
[cub] Port production high-bin histogram optimizations
brycelelbach Aug 31, 2026
3b09ba1
[cub] Handle full-width histogram ranges
brycelelbach Aug 31, 2026
249253e
[cub] Fix full-width histogram range validation
brycelelbach Sep 3, 2026
8690561
[cub] Isolate high-bin histogram optimizations
brycelelbach Sep 3, 2026
6b44874
[cub] Isolate high-bin histogram dispatch
brycelelbach Sep 4, 2026
ae75ab7
[cub] Match raw high-bin cache occupancy
brycelelbach Sep 4, 2026
cae2d72
[cub] Use explicit high-bin launch tuning
brycelelbach Sep 4, 2026
a67568c
[cub] Match raw high-bin launch and hot paths
brycelelbach Sep 4, 2026
4cdffc6
[cub] Match raw histogram fallback and hot path
brycelelbach Sep 4, 2026
a4100ca
[cub] Match raw RANGE cache capacity
brycelelbach Sep 4, 2026
ef4d7b4
[cub] Match raw cooperative grid sizing
brycelelbach Sep 4, 2026
fe59656
[cub] Tune high-bin work-grid size
brycelelbach Sep 4, 2026
0db9dec
[cub] Fix high-bin policy validation
brycelelbach Sep 4, 2026
73f3129
[cub] Match raw multi-channel RANGE occupancy
brycelelbach Sep 4, 2026
3fa4251
[cub] Preserve multi-channel EVEN SMEM range
brycelelbach Sep 5, 2026
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
26 changes: 26 additions & 0 deletions cub/cub/detail/launcher/cuda_driver.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,32 @@ struct CudaDriverLauncherFactory
::cuOccupancyMaxActiveBlocksPerMultiprocessor(&sm_occupancy, kernel_fn, block_size, dynamic_smem_bytes));
}

_CCCL_HIDE_FROM_ABI ::cudaError_t CooperativeLaunchSupported(bool& supported) const
Comment thread
brycelelbach marked this conversation as resolved.
{
int attribute = 0;
const auto status =
static_cast<::cudaError_t>(::cuDeviceGetAttribute(&attribute, ::CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, device_));
supported = status == ::cudaSuccess && attribute != 0;
return status;
}

template <typename... Args>
_CCCL_HIDE_FROM_ABI ::cudaError_t LaunchCooperative(
dim3 grid, dim3 block, unsigned int shared_mem, ::CUstream stream, ::CUkernel kernel, Args const&... args) const
{
void* kernel_args[] = {const_cast<void*>(static_cast<void const*>(&args))...};

::CUfunction kernel_fn;
auto status = static_cast<::cudaError_t>(::cuKernelGetFunction(&kernel_fn, kernel));
if (status != cudaSuccess)
{
return status;
}

return static_cast<::cudaError_t>(::cuLaunchCooperativeKernel(
kernel_fn, grid.x, grid.y, grid.z, block.x, block.y, block.z, shared_mem, stream, kernel_args));
}

_CCCL_HIDE_FROM_ABI ::cudaError_t MaxGridDimX(int& max_grid_dim_x) const
{
return static_cast<::cudaError_t>(
Expand Down
38 changes: 38 additions & 0 deletions cub/cub/detail/launcher/cuda_runtime.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,44 @@ struct TripleChevronFactory
return ::cudaOccupancyMaxActiveBlocksPerMultiprocessor(&sm_occupancy, kernel_ptr, block_size, dynamic_smem_bytes);
}

_CCCL_HIDE_FROM_ABI CUB_RUNTIME_FUNCTION ::cudaError_t CooperativeLaunchSupported(bool& supported) const
{
NV_IF_ELSE_TARGET(
NV_IS_HOST,
({
int device_ordinal = 0;
if (const auto error = CubDebug(::cudaGetDevice(&device_ordinal)))
{
return error;
}

int attribute = 0;
if (const auto error =
CubDebug(::cudaDeviceGetAttribute(&attribute, ::cudaDevAttrCooperativeLaunch, device_ordinal)))
{
return error;
}

supported = attribute != 0;
return ::cudaSuccess;
}),
({
supported = false;
return ::cudaSuccess;
}))
}

template <typename Kernel, typename... Args>
_CCCL_HIDE_FROM_ABI CUB_RUNTIME_FUNCTION ::cudaError_t LaunchCooperative(
dim3 grid, dim3 block, ::cuda::std::size_t shared_mem, ::cudaStream_t stream, Kernel kernel, Args const&... args)
const {NV_IF_ELSE_TARGET(NV_IS_HOST,
({
void* kernel_args[] = {const_cast<void*>(static_cast<void const*>(&args))...};
return ::cudaLaunchCooperativeKernel(
reinterpret_cast<void const*>(kernel), grid, block, kernel_args, shared_mem, stream);
}),
({ return ::cudaErrorNotSupported; }))}

_CCCL_HIDE_FROM_ABI CUB_RUNTIME_FUNCTION ::cudaError_t MaxGridDimX(int& max_grid_dim_x) const
{
int device_ordinal;
Expand Down
Loading
Loading