[CCCL] Add missing CCCL components: c2h, nvbench_helper, cmake, cudax, AGENTS.md
Added 863 files from NVIDIA/cccl sparse checkout: - c2h/ (27 files): Catch2 test helpers — generators, validators, runner - nvbench_helper/ (10 files): Benchmark harness utilities - cmake/ (29 files): CMake presets and build helpers - cudax/ (794 files): Experimental CUDA extensions - AGENTS.md: NVIDIA's official AI agent instructions for CCCL - CMakePresets.json: Standardized build configurations - cccl-version.json: Version tracking Also added CCCL_ASSET_MAP.md mapping all 4295 CCCL files to competition value and PRD items. cccl_upstream now covers 100% of competition-critical assets: - 27 tuning headers (SM80/90/100 benchmark data) - 32 dispatch headers (algorithm implementations) - 60 Thrust examples (correctness verification) - 217 CUB Catch2 tests (regression matrix) - 153 CUB benchmarks (parameter space search) - 18 CUB examples (API verification) - 27 test helpers + benchmark harness - 794 cudax experimental extensions
This commit is contained in:
15
cccl_upstream/cudax/test/multi_gpu/concepts/CMakeLists.txt
Normal file
15
cccl_upstream/cudax/test/multi_gpu/concepts/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
#===----------------------------------------------------------------------===##
|
||||
#
|
||||
# Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
#
|
||||
#===----------------------------------------------------------------------===##
|
||||
|
||||
file(GLOB test_srcs LIST_DIRECTORIES FALSE CONFIGURE_DEPENDS *.cu *.cpp)
|
||||
|
||||
foreach (src IN LISTS test_srcs)
|
||||
cudax_add_multi_gpu_test("concepts" test_target "${src}")
|
||||
endforeach()
|
||||
@@ -0,0 +1,66 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _CUDAX_TEST_MULTI_GPU_COLLECTIVE_CONCEPTS_COMMON_CUH
|
||||
#define _CUDAX_TEST_MULTI_GPU_COLLECTIVE_CONCEPTS_COMMON_CUH
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
#include "concepts_common.cuh"
|
||||
|
||||
namespace cudax_multi_gpu_concepts
|
||||
{
|
||||
struct collective_communicator_model : communicator_model
|
||||
{
|
||||
template <class Tp, class Op>
|
||||
void reduce(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, Op, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
|
||||
template <class Tp, class Op>
|
||||
void all_reduce(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, Op, ::cuda::stream_ref);
|
||||
|
||||
template <class Tp>
|
||||
void gather(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
|
||||
template <class Tp>
|
||||
void gather_v(
|
||||
group_guard_type&,
|
||||
Tp*,
|
||||
::cuda::std::size_t,
|
||||
Tp*,
|
||||
const ::cuda::std::size_t*,
|
||||
const ::cuda::std::size_t*,
|
||||
::cuda::std::int32_t,
|
||||
::cuda::stream_ref);
|
||||
|
||||
template <class Tp>
|
||||
void all_gather(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::stream_ref);
|
||||
|
||||
template <class Tp>
|
||||
void broadcast(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
|
||||
template <class Tp>
|
||||
void all_to_all(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::stream_ref);
|
||||
|
||||
template <class Tp>
|
||||
void all_to_all_v(
|
||||
group_guard_type&,
|
||||
Tp*,
|
||||
const ::cuda::std::size_t*,
|
||||
const ::cuda::std::size_t*,
|
||||
Tp*,
|
||||
const ::cuda::std::size_t*,
|
||||
const ::cuda::std::size_t*,
|
||||
::cuda::stream_ref);
|
||||
};
|
||||
} // namespace cudax_multi_gpu_concepts
|
||||
|
||||
#endif // _CUDAX_TEST_MULTI_GPU_COLLECTIVE_CONCEPTS_COMMON_CUH
|
||||
44
cccl_upstream/cudax/test/multi_gpu/concepts/communicator.cu
Normal file
44
cccl_upstream/cudax/test/multi_gpu/concepts/communicator.cu
Normal file
@@ -0,0 +1,44 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct no_send : types::basic_communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
void recv(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
struct no_recv : types::basic_communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
void send(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("communicator concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__communicator<types::communicator_model>);
|
||||
STATIC_REQUIRE(!cudax::__communicator<no_send>);
|
||||
STATIC_REQUIRE(!cudax::__communicator<no_recv>);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _CUDAX_TEST_MULTI_GPU_CONCEPTS_COMMON_CUH
|
||||
#define _CUDAX_TEST_MULTI_GPU_CONCEPTS_COMMON_CUH
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
namespace cudax_multi_gpu_concepts
|
||||
{
|
||||
struct group_guard
|
||||
{};
|
||||
|
||||
struct basic_communicator_model
|
||||
{
|
||||
using native_handle_type = int;
|
||||
using group_guard_type = group_guard;
|
||||
|
||||
native_handle_type native_handle() noexcept;
|
||||
::cuda::std::int32_t rank() noexcept;
|
||||
::cuda::std::int32_t size() noexcept;
|
||||
group_guard_type group_guard();
|
||||
};
|
||||
|
||||
struct communicator_model : basic_communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
void send(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
template <class Tp>
|
||||
void recv(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
} // namespace cudax_multi_gpu_concepts
|
||||
|
||||
#endif // _CUDAX_TEST_MULTI_GPU_CONCEPTS_COMMON_CUH
|
||||
@@ -0,0 +1,43 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct all_gather_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
int all_gather(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_all_gather concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_all_gather<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_all_gather<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_all_gather<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_all_gather<all_gather_returns_int>);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/__type_traits/enable_if.h>
|
||||
#include <cuda/std/__type_traits/is_void.h>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct all_reduce_rejects_void : types::communicator_model
|
||||
{
|
||||
template <class Tp, class Op, ::cuda::std::enable_if_t<!::cuda::std::is_void_v<Tp>, int> = 0>
|
||||
void all_reduce(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, Op, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
struct all_reduce_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp, class Op>
|
||||
int all_reduce(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, Op, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_all_reduce concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_all_reduce<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_all_reduce<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_all_reduce<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_all_reduce<all_reduce_returns_int>);
|
||||
STATIC_REQUIRE(cudax::__has_all_reduce<all_reduce_rejects_void, int*>);
|
||||
STATIC_REQUIRE(!cudax::__has_all_reduce<all_reduce_rejects_void, void*>);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct all_to_all_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
int all_to_all(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_all_to_all concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_all_to_all<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_all_to_all<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_all_to_all<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_all_to_all<all_to_all_returns_int>);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct all_to_all_v_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
int all_to_all_v(
|
||||
group_guard_type&,
|
||||
Tp*,
|
||||
const ::cuda::std::size_t*,
|
||||
const ::cuda::std::size_t*,
|
||||
Tp*,
|
||||
const ::cuda::std::size_t*,
|
||||
const ::cuda::std::size_t*,
|
||||
::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_all_to_all_v concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_all_to_all_v<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_all_to_all_v<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_all_to_all_v<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_all_to_all_v<all_to_all_v_returns_int>);
|
||||
}
|
||||
44
cccl_upstream/cudax/test/multi_gpu/concepts/has_broadcast.cu
Normal file
44
cccl_upstream/cudax/test/multi_gpu/concepts/has_broadcast.cu
Normal file
@@ -0,0 +1,44 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct broadcast_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
int broadcast(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_broadcast concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_broadcast<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_broadcast<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_broadcast<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_broadcast<broadcast_returns_int>);
|
||||
}
|
||||
44
cccl_upstream/cudax/test/multi_gpu/concepts/has_gather.cu
Normal file
44
cccl_upstream/cudax/test/multi_gpu/concepts/has_gather.cu
Normal file
@@ -0,0 +1,44 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct gather_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
int gather(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_gather concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_gather<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_gather<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_gather<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_gather<gather_returns_int>);
|
||||
}
|
||||
51
cccl_upstream/cudax/test/multi_gpu/concepts/has_gather_v.cu
Normal file
51
cccl_upstream/cudax/test/multi_gpu/concepts/has_gather_v.cu
Normal file
@@ -0,0 +1,51 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct gather_v_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
int gather_v(group_guard_type&,
|
||||
Tp*,
|
||||
::cuda::std::size_t,
|
||||
Tp*,
|
||||
const ::cuda::std::size_t*,
|
||||
const ::cuda::std::size_t*,
|
||||
::cuda::std::int32_t,
|
||||
::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_gather_v concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_gather_v<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_gather_v<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_gather_v<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_gather_v<gather_v_returns_int>);
|
||||
}
|
||||
50
cccl_upstream/cudax/test/multi_gpu/concepts/has_recv.cu
Normal file
50
cccl_upstream/cudax/test/multi_gpu/concepts/has_recv.cu
Normal file
@@ -0,0 +1,50 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct recv_returns_int : types::basic_communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
int recv(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
struct no_recv : types::basic_communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
void send(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_recv concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_recv<types::communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_recv<types::communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_recv<no_recv>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_recv<recv_returns_int>);
|
||||
}
|
||||
44
cccl_upstream/cudax/test/multi_gpu/concepts/has_reduce.cu
Normal file
44
cccl_upstream/cudax/test/multi_gpu/concepts/has_reduce.cu
Normal file
@@ -0,0 +1,44 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "collective_concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct reduce_returns_int : types::communicator_model
|
||||
{
|
||||
template <class Tp, class Op>
|
||||
int reduce(group_guard_type&, Tp*, Tp*, ::cuda::std::size_t, Op, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_reduce concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_reduce<types::collective_communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_reduce<types::collective_communicator_model, long*>);
|
||||
STATIC_REQUIRE(!cudax::__has_reduce<types::communicator_model>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_reduce<reduce_returns_int>);
|
||||
}
|
||||
50
cccl_upstream/cudax/test/multi_gpu/concepts/has_send.cu
Normal file
50
cccl_upstream/cudax/test/multi_gpu/concepts/has_send.cu
Normal file
@@ -0,0 +1,50 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of CUDA Experimental in CUDA C++ Core 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 & AFFILIATES.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include <cuda/__stream/stream_ref.h>
|
||||
#include <cuda/std/__cstddef/types.h>
|
||||
#include <cuda/std/cstdint>
|
||||
|
||||
#include <cuda/experimental/__multi_gpu/concepts.h>
|
||||
|
||||
#include <testing.cuh>
|
||||
|
||||
#include "concepts_common.cuh"
|
||||
|
||||
namespace
|
||||
{
|
||||
namespace types = cudax_multi_gpu_concepts;
|
||||
|
||||
// nvcc ignores [[maybe_unused]] entirely
|
||||
_CCCL_BEGIN_NV_DIAG_SUPPRESS(177)
|
||||
|
||||
struct no_send : types::basic_communicator_model
|
||||
{
|
||||
template <class Tp>
|
||||
void send_sync(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t);
|
||||
};
|
||||
|
||||
struct send_returns_int : no_send
|
||||
{
|
||||
template <class Tp>
|
||||
int send(group_guard_type&, Tp*, ::cuda::std::size_t, ::cuda::std::int32_t, ::cuda::stream_ref);
|
||||
};
|
||||
|
||||
_CCCL_END_NV_DIAG_SUPPRESS()
|
||||
} // namespace
|
||||
|
||||
C2H_TEST("__has_send concept", "[multi_gpu][concepts]")
|
||||
{
|
||||
STATIC_REQUIRE(cudax::__has_send<types::communicator_model>);
|
||||
STATIC_REQUIRE(cudax::__has_send<types::communicator_model, long*>);
|
||||
|
||||
STATIC_REQUIRE(!cudax::__has_send<no_send>);
|
||||
STATIC_REQUIRE(!cudax::__has_send<send_returns_int>);
|
||||
}
|
||||
Reference in New Issue
Block a user