Math operators
- group NVCV_CPP_CUDATOOLS_MATHOPERATORS
Operators on CUDA compound types resembling the same operator on corresponding regular C type.
This whole group defines a set of arithmetic and bitwise operators defined on CUDA compound types. They work the same way as the corresponding regular C type. For instance, three int3 a, b and c, will accept the operation a += b * c (see example below). Furthermore, the operators accept mixed operands as CUDA compound and regular C types, e.g. two int3 a and b and one int c will accept the operation a += b * c, where the scalar c propagates its value for all components of b in the multiplication and the int3 result in the assignment to a.
using DataType = ...; DataType pix = ...; float kernel = ...; ConvertBaseTypeTo<float, DataType> res = {0}; res += kernel * pix;
- tparam T
Type of the first CUDA compound or regular C type operand.
- tparam U
Type of the second CUDA compound or regular C type operand.
- param a
[in] First operand.
- param b
[in] Second operand.
- return
Return value of applying the operator on
a
andb
.
Defines
-
NVCV_CUDA_UNARY_OPERATOR(OPERATOR, REQUIREMENT)
-
NVCV_CUDA_BINARY_OPERATOR(OPERATOR, REQUIREMENT)
Functions
- template<typename T, class = nvcv::cuda::Require< nvcv::cuda::IsCompound <T>>> inline __host__ __device__ auto operator- (T a)
- template<typename T, class = nvcv::cuda::Require< nvcv::cuda::IsCompound <T>>> inline __host__ __device__ auto operator+ (T a)
- template<typename T, class = nvcv::cuda::Require< nvcv::cuda::detail::IsIntegralCompound <T>>> inline __host__ __device__ auto operator~ (T a)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompound <T, U>>> inline __host__ __device__ auto operator- (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator-= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompound <T, U>>> inline __host__ __device__ auto operator+ (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator+= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompound <T, U>>> inline __host__ __device__ auto operator* (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator*= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompound <T, U>>> inline __host__ __device__ auto operator/ (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator/= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompoundAndBothAreIntegral <T, U>>> inline __host__ __device__ auto operator% (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator%= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompoundAndBothAreIntegral <T, U>>> inline __host__ __device__ auto operator& (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator&= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompoundAndBothAreIntegral <T, U>>> inline __host__ __device__ auto operator| (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator|= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompoundAndBothAreIntegral <T, U>>> inline __host__ __device__ auto operator^ (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator^= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompoundAndBothAreIntegral <T, U>>> inline __host__ __device__ auto operator<< (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator<<= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require< nvcv::cuda::detail::OneIsCompoundAndBothAreIntegral <T, U>>> inline __host__ __device__ auto operator>> (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::IsCompound<T>>> inline __host__ __device__ T & operator>>= (T &a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::detail::IsSameCompound<T, U>>> inline __host__ __device__ bool operator== (T a, U b)
- template<typename T, typename U, class = nvcv::cuda::Require<nvcv::cuda::detail::IsSameCompound<T, U>>> inline __host__ __device__ bool operator!= (T a, U b)