cub::LoadDirectBlocked

Defined in /home/runner/work/cccl/cccl/cub/cub/block/block_load.cuh

template<typename InputT, typename DefaultT, int ITEMS_PER_THREAD, typename InputIteratorT>
void cub::LoadDirectBlocked(int linear_tid, InputIteratorT block_itr, InputT (&items)[ITEMS_PER_THREAD], int valid_items, DefaultT oob_default)

Load a linear segment of items into a blocked arrangement across the thread block, guarded by range, with a fall-back assignment of out-of-bound elements.

Assumes a blocked arrangement of (block-threads * items-per-thread) items across the thread block, where threadi owns the ith range of items-per-thread contiguous items. For multi-dimensional thread blocks, a row-major thread ordering is assumed.

Template Parameters
  • T[inferred] The data type to load.

  • ITEMS_PER_THREAD[inferred] The number of consecutive items partitioned onto each thread.

  • InputIteratorT[inferred] The random-access iterator type for input (may be a simple pointer type).

Parameters
  • linear_tid[in] A suitable 1D thread-identifier for the calling thread (e.g., (threadIdx.y * blockDim.x) + linear_tid for 2D thread blocks)

  • block_itr[in] The thread block’s base input iterator for loading from

  • items[out] Data to load

  • valid_items[in] Number of valid items to load

  • oob_default[in] Default value to assign out-of-bound items