35#ifndef _BLAZE_MATH_FUNCTORS_CLAMP_H_
36#define _BLAZE_MATH_FUNCTORS_CLAMP_H_
77 template<
typename T1,
typename T2,
typename T3 >
79 operator()( T1&& v, T2&& lo, T3&& hi )
const
81 return clamp( std::forward<T1>( v ), std::forward<T2>( lo ), std::forward<T3>( hi ) );
90 template<
typename T1,
typename T2,
typename T3 >
91 static constexpr bool simdEnabled() {
return HasSIMDMax_v<T1,T2> && HasSIMDMin_v<T1,T3>; }
110 template<
typename T1,
typename T2,
typename T3 >
116 return min(
max( v, lo ), hi );
Header file for the HasSIMDMax type trait.
Header file for the HasSIMDMin type trait.
Macro for CUDA compatibility.
Header file for the SIMD set functionality.
Constraint on the data type.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375
decltype(auto) clamp(const DenseMatrix< MT, SO > &dm, const DT &min, const DT &max)
Restricts each single element of the dense matrix dm to the range .
Definition: DMatMapExpr.h:1740
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.
Definition: SIMDPack.h:60
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
Header file for the SIMD max functionality.
Header file for the SIMD min functionality.
Header file for the clamp shim.
Generic wrapper for the clamp() function.
Definition: Clamp.h:68
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Clamp.h:91
BLAZE_ALWAYS_INLINE decltype(auto) load(const T1 &v, const T2 &lo, const T3 &hi) const
Returns the result of the clamp() function for the given SIMD vector.
Definition: Clamp.h:111
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Clamp.h:99
System settings for the inline keywords.