Blaze 3.9
Public Member Functions | Static Public Member Functions | List of all members
blaze::Clamp Struct Reference

Generic wrapper for the clamp() function. More...

#include <Clamp.h>

Public Member Functions

template<typename T1 , typename T2 , typename T3 >
BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator() (T1 &&v, T2 &&lo, T3 &&hi) const
 Returns the result of the clamp() function for the given object/value. More...
 
template<typename T1 , typename T2 , typename T3 >
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. More...
 

Static Public Member Functions

template<typename T1 , typename T2 , typename T3 >
static constexpr bool simdEnabled ()
 Returns whether SIMD is enabled for the specified data type T. More...
 
static constexpr bool paddingEnabled ()
 Returns whether the operation supports padding, i.e. whether it can deal with zeros. More...
 

Detailed Description

Generic wrapper for the clamp() function.

Member Function Documentation

◆ load()

template<typename T1 , typename T2 , typename T3 >
BLAZE_ALWAYS_INLINE decltype(auto) blaze::Clamp::load ( const T1 &  v,
const T2 &  lo,
const T3 &  hi 
) const
inline

Returns the result of the clamp() function for the given SIMD vector.

Parameters
vThe SIMD vector to clamp.
loThe minimum to clamp v.
hiThe maximum to clamp v.
Returns
The result of the clamp() function for the given SIMD vector.

◆ operator()()

template<typename T1 , typename T2 , typename T3 >
BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) blaze::Clamp::operator() ( T1 &&  v,
T2 &&  lo,
T3 &&  hi 
) const
inline

Returns the result of the clamp() function for the given object/value.

Parameters
vThe given object/value to clamp.
loThe minimum to clamp v.
hiThe maximum to clamp v.
Returns
The result of the clamp() function for the given object/value.

◆ paddingEnabled()

static constexpr bool blaze::Clamp::paddingEnabled ( )
inlinestaticconstexpr

Returns whether the operation supports padding, i.e. whether it can deal with zeros.

Returns
true in case padding is supported, false if not.

◆ simdEnabled()

template<typename T1 , typename T2 , typename T3 >
static constexpr bool blaze::Clamp::simdEnabled ( )
inlinestaticconstexpr

Returns whether SIMD is enabled for the specified data type T.

Returns
true in case SIMD is enabled for the data type T, false if not.

The documentation for this struct was generated from the following file: