3#include <cuda_runtime.h>
5#include <cuda/std/cstddef>
6#include <cuda/std/cstdint>
16template <
size_t BucketCount,
typename Layout = default_register_layout>
20 cuda::stream_ref stream,
21 cuda::std::optional<blacklist_view>
blacklist = cuda::std::nullopt
27 auto const multiprocessors =
28 stream.device().attribute(cuda::device_attributes::multiprocessor_count);
29 auto const vector_input = (
reinterpret_cast<uintptr_t
>(input.data()) & 31U) == 0U;
32 auto const needed = input.size() / capacity + (input.size() % capacity != 0U);
34 static_cast<uint32_t
>(cuda::std::min<size_t>(multiprocessors * 2U, needed));
35 auto launch = [&]<
bool Filter>() {
36 add_shared_kernel<BucketCount, Layout, Filter>
46 launch.template operator()<
true>();
48 launch.template operator()<
false>();
50 return cudaGetLastError();
__global__ size_t uint32_t bool blacklist_view blacklist
constexpr uint32_t shared_construction_block_size
Threads per CTA for the CTA-local construction kernel.
__host__ Result< void > launch_construction(device_span< uint64_t const > input, device_span< uint32_t > registers, cuda::stream_ref stream, cuda::std::optional< blacklist_view > blacklist=cuda::std::nullopt)
Launches construction of a sketch through a CTA-local shared register array merged into registers (ad...
__global__ size_t uint32_t * registers
__global__ size_t uint32_t bool vector_input
Result< void > cuda_try(cudaError_t error, std::source_location location=std::source_location::current())
Checks a CUDA runtime call and returns an error on failure.
Fallible API result: cuda::std::expected<T, Error> with cuDDL factories.
Exact membership within the candidate's destination bucket.
A span that is assumed to point to device-accessible memory.