3#include <cuda_runtime.h>
6#include <cuda/std/concepts>
15#if __CUDA_ARCH__ >= 1000
33 static_assert(
sizeof(
T) == 4 ||
sizeof(
T) == 8,
"T must be uint32_t or uint64_t");
35 if constexpr (
sizeof(
T) == 8) {
36 asm volatile(
"ld.global.nc.v4.u64 {%0, %1, %2, %3}, [%4];"
40 asm volatile(
"ld.global.nc.v8.u32 {%0, %1, %2, %3, %4, %5, %6, %7}, [%8];"
61 asm volatile(
"ld.global.nc.v4.u64 {%0, %1, %2, %3}, [%4];"
75 asm volatile(
"ld.global.nc.v2.u64 {%0, %1}, [%2];" :
"=l"(
out0),
"=l"(
out1) :
"l"(
ptr));
85#if __CUDA_ARCH__ >= 800
114template <
typename Kernel>
__device__ __forceinline__ void load128BitGlobalNC(const uint64_t *ptr, uint64_t &out0, uint64_t &out1)
Loads 128 bits from global memory using the non-coherent cache path.
__device__ __forceinline__ uint64_t warpReduceOr(uint32_t peers, uint64_t value)
OR-reduce a uint64_t across the lanes in a peer mask.
__device__ __forceinline__ void load256BitGlobalNC(const T *ptr, T *out)
Loads 256 bits from global memory using the non-coherent cache path.
consteval bool separatorPositionAlwaysEncodesInvalid(char *input, uint64_t separatorPosition, uint64_t index)
Recursively tests whether placing the separator byte at any position in an input of valid bytes alway...
uint64_t maxOccupancyGridSize(int32_t blockSize, Kernel kernel, uint64_t dynamicSMemSize)
Calculates the maximum occupancy grid size for a kernel.