CCCL (CUDA C++ Core Libraries) provides: - CUB: device/block/warp-level GPU primitives (reduce, scan, sort, topk) - Thrust: high-level parallel algorithms (transform_reduce, sort, scan) - libcudacxx: CUDA C++ standard library (atomics, barriers, memory) - cudax: experimental features (memory resources, allocators) - Tuning policies: per-SM hardware-specific algorithm parameters Competition optimization vectors mapped to CCCL: - Output TPS (83% weight): warp_reduce, block_reduce, device_topk - Input TPS (14% weight): device_scan, block_load, prefetch - Cache TPS (3% weight): prefix caching strategy patterns - Memory (0.9 util): pooled/cached/buddy allocators Source: https://github.com/NVIDIA/cccl (shallow clone, HEAD only) License: Apache-2.0
128 lines
3.3 KiB
C
128 lines
3.3 KiB
C
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Part of CUDA Experimental in CUDA Core Compute Libraries,
|
|
// under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#pragma once
|
|
// NOLINTBEGIN(modernize-use-using)
|
|
|
|
#ifndef CCCL_C_EXPERIMENTAL
|
|
# error "C exposure is experimental and subject to change. Define CCCL_C_EXPERIMENTAL to acknowledge this notice."
|
|
#endif // !CCCL_C_EXPERIMENTAL
|
|
|
|
#include <cuda.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include <cccl/c/extern_c.h>
|
|
#include <cccl/c/types.h>
|
|
|
|
CCCL_C_EXTERN_C_BEGIN
|
|
|
|
typedef struct cccl_device_scan_build_result_t
|
|
{
|
|
int cc;
|
|
void* payload;
|
|
size_t payload_size;
|
|
void* jit_compiler;
|
|
void* scan_fn;
|
|
bool force_inclusive;
|
|
cccl_init_kind_t init_kind;
|
|
} cccl_device_scan_build_result_t;
|
|
|
|
CCCL_C_API CUresult cccl_device_scan_build(
|
|
cccl_device_scan_build_result_t* build_ptr,
|
|
cccl_iterator_t d_in,
|
|
cccl_iterator_t d_out,
|
|
cccl_op_t op,
|
|
cccl_type_info init,
|
|
bool force_inclusive,
|
|
cccl_init_kind_t init_kind,
|
|
int cc_major,
|
|
int cc_minor,
|
|
const char* cub_path,
|
|
const char* thrust_path,
|
|
const char* libcudacxx_path,
|
|
const char* ctk_path);
|
|
|
|
// Extended version with build configuration
|
|
CCCL_C_API CUresult cccl_device_scan_build_ex(
|
|
cccl_device_scan_build_result_t* build_ptr,
|
|
cccl_iterator_t d_in,
|
|
cccl_iterator_t d_out,
|
|
cccl_op_t op,
|
|
cccl_type_info init,
|
|
bool force_inclusive,
|
|
cccl_init_kind_t init_kind,
|
|
int cc_major,
|
|
int cc_minor,
|
|
const char* cub_path,
|
|
const char* thrust_path,
|
|
const char* libcudacxx_path,
|
|
const char* ctk_path,
|
|
cccl_build_config* config);
|
|
|
|
CCCL_C_API CUresult cccl_device_exclusive_scan(
|
|
cccl_device_scan_build_result_t build,
|
|
void* d_temp_storage,
|
|
size_t* temp_storage_bytes,
|
|
cccl_iterator_t d_in,
|
|
cccl_iterator_t d_out,
|
|
uint64_t num_items,
|
|
cccl_op_t op,
|
|
cccl_value_t init,
|
|
CUstream stream);
|
|
|
|
CCCL_C_API CUresult cccl_device_inclusive_scan(
|
|
cccl_device_scan_build_result_t build,
|
|
void* d_temp_storage,
|
|
size_t* temp_storage_bytes,
|
|
cccl_iterator_t d_in,
|
|
cccl_iterator_t d_out,
|
|
uint64_t num_items,
|
|
cccl_op_t op,
|
|
cccl_value_t init,
|
|
CUstream stream);
|
|
|
|
CCCL_C_API CUresult cccl_device_exclusive_scan_future_value(
|
|
cccl_device_scan_build_result_t build,
|
|
void* d_temp_storage,
|
|
size_t* temp_storage_bytes,
|
|
cccl_iterator_t d_in,
|
|
cccl_iterator_t d_out,
|
|
uint64_t num_items,
|
|
cccl_op_t op,
|
|
cccl_iterator_t init,
|
|
CUstream stream);
|
|
|
|
CCCL_C_API CUresult cccl_device_inclusive_scan_future_value(
|
|
cccl_device_scan_build_result_t build,
|
|
void* d_temp_storage,
|
|
size_t* temp_storage_bytes,
|
|
cccl_iterator_t d_in,
|
|
cccl_iterator_t d_out,
|
|
uint64_t num_items,
|
|
cccl_op_t op,
|
|
cccl_iterator_t init,
|
|
CUstream stream);
|
|
|
|
CCCL_C_API CUresult cccl_device_inclusive_scan_no_init(
|
|
cccl_device_scan_build_result_t build,
|
|
void* d_temp_storage,
|
|
size_t* temp_storage_bytes,
|
|
cccl_iterator_t d_in,
|
|
cccl_iterator_t d_out,
|
|
uint64_t num_items,
|
|
cccl_op_t op,
|
|
CUstream stream);
|
|
|
|
CCCL_C_API CUresult cccl_device_scan_cleanup(cccl_device_scan_build_result_t* bld_ptr);
|
|
|
|
CCCL_C_EXTERN_C_END
|
|
// NOLINTEND(modernize-use-using)
|