Drop Cast
- group NVCV_CPP_CUDATOOLS_DROPCAST
Functions
- template<int N, typename T, class = Require<HasEnoughComponents<T, N>>> __host__ __device__ auto DropCast (T v)
Metafunction to drop components of a compound value.
The template parameter
N
defines the number of components to cast the CUDA compound typeT
passed as function argumentv
. This is done by dropping the last components afterN
fromv
. For instance, an uint3 can have its z component dropped by passing it as function argument to DropCast and the number 2 as template argument (see example below). The typeT
is not needed as it is inferred from the argumentv
. It is a requirement of the DropCast function that the typeT
has at least N components.uint2 dstIdx = DropCast<2>(blockIdx * blockDim + threadIdx);
- Template Parameters:
N – Number of components to return.
- Parameters:
v – [in] Value to drop components from.
- Returns:
The compound value with N components dropping the last, extra components.