[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:
24
cccl_upstream/thrust/testing/cuda/complex.cu
Normal file
24
cccl_upstream/thrust/testing/cuda/complex.cu
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <cuda_fp16.h>
|
||||
|
||||
#include <thrust/complex.h>
|
||||
#include <thrust/detail/alignment.h>
|
||||
#include <thrust/detail/preprocessor.h>
|
||||
|
||||
#include <unittest/unittest.h>
|
||||
|
||||
template <typename T, typename VectorT>
|
||||
void TestComplexAlignment()
|
||||
{
|
||||
static_assert(sizeof(thrust::complex<T>) == sizeof(VectorT));
|
||||
static_assert(alignof(thrust::complex<T>) == alignof(VectorT));
|
||||
|
||||
static_assert(sizeof(thrust::complex<T const>) == sizeof(VectorT));
|
||||
static_assert(alignof(thrust::complex<T const>) == alignof(VectorT));
|
||||
}
|
||||
DECLARE_UNITTEST_WITH_NAME(THRUST_PP_EXPAND_ARGS(TestComplexAlignment<char, char2>), TestComplexCharAlignment);
|
||||
DECLARE_UNITTEST_WITH_NAME(THRUST_PP_EXPAND_ARGS(TestComplexAlignment<short, short2>), TestComplexShortAlignment);
|
||||
DECLARE_UNITTEST_WITH_NAME(THRUST_PP_EXPAND_ARGS(TestComplexAlignment<int, int2>), TestComplexIntAlignment);
|
||||
DECLARE_UNITTEST_WITH_NAME(THRUST_PP_EXPAND_ARGS(TestComplexAlignment<long, long2>), TestComplexLongAlignment);
|
||||
DECLARE_UNITTEST_WITH_NAME(THRUST_PP_EXPAND_ARGS(TestComplexAlignment<__half, __half2>), TestComplexHalfAlignment);
|
||||
DECLARE_UNITTEST_WITH_NAME(THRUST_PP_EXPAND_ARGS(TestComplexAlignment<float, float2>), TestComplexFloatAlignment);
|
||||
DECLARE_UNITTEST_WITH_NAME(THRUST_PP_EXPAND_ARGS(TestComplexAlignment<double, double2>), TestComplexDoubleAlignment);
|
||||
Reference in New Issue
Block a user