[INFRA] Import NVIDIA/CCCL upstream as optimization reference library
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
This commit is contained in:
13
cccl_upstream/libcudacxx/test/debugging/array/CMakeLists.txt
Normal file
13
cccl_upstream/libcudacxx/test/debugging/array/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
libcudacxx_add_pretty_printer_test(
|
||||
NAME array
|
||||
SOURCES source.cu
|
||||
CASES
|
||||
# gersemi: off
|
||||
--case inspect_normal 1 array.normal normal
|
||||
--case inspect_empty 1 array.empty empty
|
||||
--case inspect_nested 1 array.nested nested
|
||||
--case inspect_alias 1 array.alias alias
|
||||
--case inspect_before_update 1 array.update.before updated_values
|
||||
--case inspect_after_update 1 array.update.after updated_values
|
||||
# gersemi: on
|
||||
)
|
||||
44
cccl_upstream/libcudacxx/test/debugging/array/gdb.expected
Normal file
44
cccl_upstream/libcudacxx/test/debugging/array/gdb.expected
Normal file
@@ -0,0 +1,44 @@
|
||||
=============== array.normal begin ===============
|
||||
cuda::std::array<int, 3> = {
|
||||
[0] = -7,
|
||||
[1] = 0,
|
||||
[2] = 42
|
||||
}
|
||||
=============== array.normal end ===============
|
||||
=============== array.empty begin ===============
|
||||
cuda::std::array<int, 0>
|
||||
=============== array.empty end ===============
|
||||
=============== array.nested begin ===============
|
||||
cuda::std::array<cuda::std::array<int, 2>, 2> = {
|
||||
[0] = cuda::std::array<int, 2> = {
|
||||
[0] = 13,
|
||||
[1] = -5
|
||||
},
|
||||
[1] = cuda::std::array<int, 2> = {
|
||||
[0] = 0,
|
||||
[1] = 88
|
||||
}
|
||||
}
|
||||
=============== array.nested end ===============
|
||||
=============== array.alias begin ===============
|
||||
cuda::std::array<int, 4> = {
|
||||
[0] = -31,
|
||||
[1] = 17,
|
||||
[2] = 8,
|
||||
[3] = -64
|
||||
}
|
||||
=============== array.alias end ===============
|
||||
=============== array.update.before begin ===============
|
||||
cuda::std::array<int, 3> = {
|
||||
[0] = 6,
|
||||
[1] = -91,
|
||||
[2] = 52
|
||||
}
|
||||
=============== array.update.before end ===============
|
||||
=============== array.update.after begin ===============
|
||||
cuda::std::array<int, 3> = {
|
||||
[0] = 3,
|
||||
[1] = 85,
|
||||
[2] = -12
|
||||
}
|
||||
=============== array.update.after end ===============
|
||||
21
cccl_upstream/libcudacxx/test/debugging/array/lldb.expected
Normal file
21
cccl_upstream/libcudacxx/test/debugging/array/lldb.expected
Normal file
@@ -0,0 +1,21 @@
|
||||
=============== array.normal begin ===============
|
||||
(cuda::std::array<int, 3>) ([0] = -7, [1] = 0, [2] = 42)
|
||||
=============== array.normal end ===============
|
||||
=============== array.empty begin ===============
|
||||
(cuda::std::array<int, 0>)
|
||||
=============== array.empty end ===============
|
||||
=============== array.nested begin ===============
|
||||
(cuda::std::array<cuda::std::array<int, 2>, 2>) {
|
||||
[0] = ([0] = 13, [1] = -5)
|
||||
[1] = ([0] = 0, [1] = 88)
|
||||
}
|
||||
=============== array.nested end ===============
|
||||
=============== array.alias begin ===============
|
||||
(cuda::std::array<int, 4>) ([0] = -31, [1] = 17, [2] = 8, [3] = -64)
|
||||
=============== array.alias end ===============
|
||||
=============== array.update.before begin ===============
|
||||
(cuda::std::array<int, 3>) ([0] = 6, [1] = -91, [2] = 52)
|
||||
=============== array.update.before end ===============
|
||||
=============== array.update.after begin ===============
|
||||
(cuda::std::array<int, 3>) ([0] = 3, [1] = 85, [2] = -12)
|
||||
=============== array.update.after end ===============
|
||||
60
cccl_upstream/libcudacxx/test/debugging/array/source.cu
Normal file
60
cccl_upstream/libcudacxx/test/debugging/array/source.cu
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
#include <cuda/std/array>
|
||||
|
||||
template <class T>
|
||||
[[gnu::noinline]] void keep_for_debugger(const T& value)
|
||||
{
|
||||
asm volatile("" : : "g"(&value) : "memory");
|
||||
}
|
||||
|
||||
using array_alias = cuda::std::array<int, 4>;
|
||||
|
||||
[[gnu::noinline]] void inspect_normal(const cuda::std::array<int, 3>& values)
|
||||
{
|
||||
keep_for_debugger(values);
|
||||
}
|
||||
|
||||
[[gnu::noinline]] void inspect_empty(const cuda::std::array<int, 0>& values)
|
||||
{
|
||||
keep_for_debugger(values);
|
||||
}
|
||||
|
||||
[[gnu::noinline]] void inspect_nested(const cuda::std::array<cuda::std::array<int, 2>, 2>& values)
|
||||
{
|
||||
keep_for_debugger(values);
|
||||
}
|
||||
|
||||
[[gnu::noinline]] void inspect_alias(const array_alias& values)
|
||||
{
|
||||
keep_for_debugger(values);
|
||||
}
|
||||
|
||||
[[gnu::noinline]] void inspect_before_update(const cuda::std::array<int, 3>& values)
|
||||
{
|
||||
keep_for_debugger(values);
|
||||
}
|
||||
|
||||
[[gnu::noinline]] void inspect_after_update(const cuda::std::array<int, 3>& values)
|
||||
{
|
||||
keep_for_debugger(values);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
const cuda::std::array<int, 3> normal = {-7, 0, 42};
|
||||
const cuda::std::array<int, 0> empty = {};
|
||||
const cuda::std::array<cuda::std::array<int, 2>, 2> nested = {{{13, -5}, {0, 88}}};
|
||||
const array_alias alias = {-31, 17, 8, -64};
|
||||
cuda::std::array<int, 3> updated_values = {6, -91, 52};
|
||||
|
||||
inspect_normal(normal);
|
||||
inspect_empty(empty);
|
||||
inspect_nested(nested);
|
||||
inspect_alias(alias);
|
||||
inspect_before_update(updated_values);
|
||||
updated_values = {3, 85, -12};
|
||||
inspect_after_update(updated_values);
|
||||
}
|
||||
Reference in New Issue
Block a user