/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/detail/casting.hpp File Reference

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/detail/casting.hpp File Reference#

2 min read time

Applies to Linux

rocCV: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/detail/casting.hpp File Reference
casting.hpp File Reference
#include <algorithm>
#include "core/detail/type_traits.hpp"

Go to the source code of this file.

Namespaces

 roccv
 
 roccv::detail
 

Functions

template<typename T , typename U , class = std::enable_if_t<(HasTypeTraits<T> && HasTypeTraits<U>) && (NumElements<T> <= NumElements<U>)>>
__device__ __host__ T roccv::detail::SaturateCast (U v)
 Performs a saturation cast from one type to another. Each type must have type traits supported. A saturation cast converts one type to another, clamping values down to the minimum/maximum of the desired cast if the value being cast goes out of bounds. For example, casting a float with a value of 256.0f to a uchar would result in a uchar with value 255. More...
 
template<typename T , typename U , class = std::enable_if_t<(HasTypeTraits<T> && HasTypeTraits<U>) && (!IsCompound<T> && !IsCompound<U>)>>
__device__ __host__ T roccv::detail::ScalarRangeCast (U v)
 ScalarRangeCast is for implementation purposes only. Use RangeCast directly instead. More...
 
template<typename T , typename U , class = std::enable_if_t<!IsCompound<T> && !IsCompound<U>>>
__device__ __host__ T roccv::detail::ScalarSaturateCast (U v)
 ScalarSaturateCast is for implementation purposes only. Use SaturateCast directly. More...