math Namespace Reference

math Namespace Reference#

Composable Kernel: ck::math Namespace Reference
ck::math Namespace Reference

Classes

struct  scales
 
struct  plus
 
struct  minus
 
struct  multiplies
 
struct  maximize
 
struct  minimize
 
struct  integer_divide_ceiler
 
struct  less
 

Functions

template<typename X , typename Y >
__host__ constexpr __device__ auto integer_divide_floor (X x, Y y)
 
template<typename X , typename Y >
__host__ constexpr __device__ auto integer_divide_ceil (X x, Y y)
 
template<typename X , typename Y >
__host__ constexpr __device__ auto integer_least_multiple (X x, Y y)
 
template<typename T >
__host__ constexpr __device__ T max (T x)
 
template<typename T >
__host__ constexpr __device__ T max (T x, T y)
 
template<index_t X>
__host__ constexpr __device__ index_t max (Number< X >, index_t y)
 
template<index_t Y>
__host__ constexpr __device__ index_t max (index_t x, Number< Y >)
 
template<typename X , typename... Ys>
__host__ constexpr __device__ auto max (X x, Ys... ys)
 
template<typename T >
__host__ constexpr __device__ T min (T x)
 
template<typename T >
__host__ constexpr __device__ T min (T x, T y)
 
template<index_t X>
__host__ constexpr __device__ index_t min (Number< X >, index_t y)
 
template<index_t Y>
__host__ constexpr __device__ index_t min (index_t x, Number< Y >)
 
template<typename X , typename... Ys>
__host__ constexpr __device__ auto min (X x, Ys... ys)
 
template<typename T >
__host__ constexpr __device__ T clamp (const T &x, const T &lowerbound, const T &upperbound)
 
__host__ constexpr __device__ index_t gcd (index_t x, index_t y)
 
template<index_t X, index_t Y>
__host__ constexpr __device__ auto gcd (Number< X >, Number< Y >)
 
Y __host__ constexpr __device__ auto lcm (X x, Y y)
 
template<index_t X>
__host__ constexpr __device__ auto next_power_of_two ()
 
template<index_t X>
__host__ constexpr __device__ auto next_power_of_two (Number< X > x)
 
template<typename T >
__host__ T tanh (T x)
 
template<>
__host__ float tanh< float > (float x)
 
template<>
__host__ double tanh< double > (double x)
 
template<typename T >
__host__ T acos (T x)
 
template<>
__host__ float acos< float > (float x)
 
template<>
__host__ double acos< double > (double x)
 
template<typename T >
__host__ T neg (T x)
 
template<>
__host__ float neg< float > (float x)
 
template<>
__host__ double neg< double > (double x)
 
template<>
__host__ int32_t neg< int32_t > (int32_t x)
 
template<>
__host__ int8_t neg< int8_t > (int8_t x)
 
template<typename T >
__host__ T atan (T x)
 
template<>
__host__ float atan< float > (float x)
 
template<>
__host__ double atan< double > (double x)
 
template<typename T >
__host__ T sin (T x)
 
template<>
__host__ float sin< float > (float x)
 
template<>
__host__ double sin< double > (double x)
 
template<typename T >
__host__ T asin (T x)
 
template<>
__host__ float asin< float > (float x)
 
template<>
__host__ double asin< double > (double x)
 
template<typename T >
__host__ T asinh (T x)
 
template<>
__host__ float asinh< float > (float x)
 
template<>
__host__ double asinh< double > (double x)
 
template<typename T >
__host__ T cos (T x)
 
template<>
__host__ float cos< float > (float x)
 
template<>
__host__ double cos< double > (double x)
 
template<typename T >
__host__ T acosh (T x)
 
template<>
__host__ float acosh< float > (float x)
 
template<>
__host__ double acosh< double > (double x)
 
template<typename T >
__host__ T tan (T x)
 
template<>
__host__ float tan< float > (float x)
 
template<>
__host__ double tan< double > (double x)
 
template<typename T >
__host__ T atanh (T x)
 
template<>
__host__ float atanh< float > (float x)
 
template<>
__host__ double atanh< double > (double x)
 
template<typename T >
__host__ T sinh (T x)
 
template<>
__host__ float sinh< float > (float x)
 
template<>
__host__ double sinh< double > (double x)
 
template<typename T >
__host__ T ceil (T x)
 
template<>
__host__ float ceil< float > (float x)
 
template<>
__host__ double ceil< double > (double x)
 
template<typename T >
__host__ T cosh (T x)
 
template<>
__host__ float cosh< float > (float x)
 
template<>
__host__ double cosh< double > (double x)
 
template<typename T >
__host__ T floor (T x)
 
template<>
__host__ float floor< float > (float x)
 
template<>
__host__ double floor< double > (double x)
 
template<typename T >
__host__ T rcp (T x)
 
template<typename T >
__host__ T exp (T x)
 
template<>
__host__ float exp< float > (float x)
 
template<>
__host__ double exp< double > (double x)
 
template<typename T >
__host__ T log (T x)
 
template<>
__host__ float log< float > (float x)
 
template<>
__host__ double log< double > (double x)
 
template<typename T >
__host__ T pow (T x, T gamma)
 
template<>
__host__ float pow< float > (float x, float gamma)
 
template<>
__host__ double pow< double > (double x, double gamma)
 
template<typename T >
__host__ T expm1 (T x)
 
template<>
__host__ float expm1< float > (float x)
 
template<>
__host__ double expm1< double > (double x)
 
template<typename T >
__device__ T tanh (T x)
 
template<typename T >
__device__ T acos (T x)
 
template<typename T >
__device__ T neg (T x)
 
template<>
__device__ half_t neg< half_t > (half_t x)
 
template<typename T >
__device__ T atan (T x)
 
template<typename T >
__device__ T sin (T x)
 
template<>
__device__ half_t sin< half_t > (half_t x)
 
template<typename T >
__device__ T asin (T x)
 
template<typename T >
__device__ T asinh (T x)
 
template<typename T >
__device__ T acosh (T x)
 
template<typename T >
__device__ T tan (T x)
 
template<typename T >
__device__ T atanh (T x)
 
template<typename T >
__device__ T sinh (T x)
 
template<typename T >
__device__ T ceil (T x)
 
template<>
__device__ half_t ceil< half_t > (half_t x)
 
template<typename T >
__device__ T cosh (T x)
 
template<typename T >
__device__ T floor (T x)
 
template<>
__device__ half_t floor< half_t > (half_t x)
 
template<typename T >
__device__ T rcp (T x)
 
template<typename T >
__device__ T exp (T x)
 
template<>
__device__ half_t exp< half_t > (half_t x)
 
template<typename T >
__device__ T log (T x)
 
template<>
__device__ half_t log< half_t > (half_t x)
 
template<typename T >
__device__ T pow (T x, T gamma)
 
template<typename T >
__device__ T expm1 (T x)
 

Function Documentation

◆ acos() [1/2]

template<typename T >
__host__ T ck::math::acos ( x)
inline

◆ acos() [2/2]

template<typename T >
__device__ T ck::math::acos ( x)
inline

◆ acos< double >()

template<>
__device__ double ck::math::acos< double > ( double  x)
inline

◆ acos< float >()

template<>
__device__ float ck::math::acos< float > ( float  x)
inline

◆ acosh() [1/2]

template<typename T >
__host__ T ck::math::acosh ( x)
inline

◆ acosh() [2/2]

template<typename T >
__device__ T ck::math::acosh ( x)
inline

◆ acosh< double >()

template<>
__device__ double ck::math::acosh< double > ( double  x)
inline

◆ acosh< float >()

template<>
__device__ float ck::math::acosh< float > ( float  x)
inline

◆ asin() [1/2]

template<typename T >
__host__ T ck::math::asin ( x)
inline

◆ asin() [2/2]

template<typename T >
__device__ T ck::math::asin ( x)
inline

◆ asin< double >()

template<>
__device__ double ck::math::asin< double > ( double  x)
inline

◆ asin< float >()

template<>
__device__ float ck::math::asin< float > ( float  x)
inline

◆ asinh() [1/2]

template<typename T >
__host__ T ck::math::asinh ( x)
inline

◆ asinh() [2/2]

template<typename T >
__device__ T ck::math::asinh ( x)
inline

◆ asinh< double >()

template<>
__device__ double ck::math::asinh< double > ( double  x)
inline

◆ asinh< float >()

template<>
__device__ float ck::math::asinh< float > ( float  x)
inline

◆ atan() [1/2]

template<typename T >
__host__ T ck::math::atan ( x)
inline

◆ atan() [2/2]

template<typename T >
__device__ T ck::math::atan ( x)
inline

◆ atan< double >()

template<>
__device__ double ck::math::atan< double > ( double  x)
inline

◆ atan< float >()

template<>
__device__ float ck::math::atan< float > ( float  x)
inline

◆ atanh() [1/2]

template<typename T >
__host__ T ck::math::atanh ( x)
inline

◆ atanh() [2/2]

template<typename T >
__device__ T ck::math::atanh ( x)
inline

◆ atanh< double >()

template<>
__device__ double ck::math::atanh< double > ( double  x)
inline

◆ atanh< float >()

template<>
__device__ float ck::math::atanh< float > ( float  x)
inline

◆ ceil() [1/2]

template<typename T >
__host__ T ck::math::ceil ( x)
inline

◆ ceil() [2/2]

template<typename T >
__device__ T ck::math::ceil ( x)
inline

◆ ceil< double >()

template<>
__device__ double ck::math::ceil< double > ( double  x)
inline

◆ ceil< float >()

template<>
__device__ float ck::math::ceil< float > ( float  x)
inline

◆ ceil< half_t >()

template<>
__device__ half_t ck::math::ceil< half_t > ( half_t  x)
inline

◆ clamp()

template<typename T >
__host__ constexpr __device__ T ck::math::clamp ( const T &  x,
const T &  lowerbound,
const T &  upperbound 
)
constexpr

◆ cos()

template<typename T >
__host__ T ck::math::cos ( x)
inline

◆ cos< double >()

template<>
__host__ double ck::math::cos< double > ( double  x)
inline

◆ cos< float >()

template<>
__host__ float ck::math::cos< float > ( float  x)
inline

◆ cosh() [1/2]

template<typename T >
__host__ T ck::math::cosh ( x)
inline

◆ cosh() [2/2]

template<typename T >
__device__ T ck::math::cosh ( x)
inline

◆ cosh< double >()

template<>
__device__ double ck::math::cosh< double > ( double  x)
inline

◆ cosh< float >()

template<>
__device__ float ck::math::cosh< float > ( float  x)
inline

◆ exp() [1/2]

template<typename T >
__host__ T ck::math::exp ( x)
inline

◆ exp() [2/2]

template<typename T >
__device__ T ck::math::exp ( x)
inline

◆ exp< double >()

template<>
__device__ double ck::math::exp< double > ( double  x)
inline

◆ exp< float >()

template<>
__device__ float ck::math::exp< float > ( float  x)
inline

◆ exp< half_t >()

template<>
__device__ half_t ck::math::exp< half_t > ( half_t  x)
inline

◆ expm1() [1/2]

template<typename T >
__host__ T ck::math::expm1 ( x)
inline

◆ expm1() [2/2]

template<typename T >
__device__ T ck::math::expm1 ( x)
inline

◆ expm1< double >()

template<>
__device__ double ck::math::expm1< double > ( double  x)
inline

◆ expm1< float >()

template<>
__device__ float ck::math::expm1< float > ( float  x)
inline

◆ floor() [1/2]

template<typename T >
__host__ T ck::math::floor ( x)
inline

◆ floor() [2/2]

template<typename T >
__device__ T ck::math::floor ( x)
inline

◆ floor< double >()

template<>
__device__ double ck::math::floor< double > ( double  x)
inline

◆ floor< float >()

template<>
__device__ float ck::math::floor< float > ( float  x)
inline

◆ floor< half_t >()

template<>
__device__ half_t ck::math::floor< half_t > ( half_t  x)
inline

◆ gcd() [1/2]

__host__ constexpr __device__ index_t ck::math::gcd ( index_t  x,
index_t  y 
)
constexpr

◆ gcd() [2/2]

template<index_t X, index_t Y>
__host__ constexpr __device__ auto ck::math::gcd ( Number< X >  ,
Number< Y >   
)
constexpr

◆ integer_divide_ceil()

template<typename X , typename Y >
__host__ constexpr __device__ auto ck::math::integer_divide_ceil ( x,
y 
)
constexpr

◆ integer_divide_floor()

template<typename X , typename Y >
__host__ constexpr __device__ auto ck::math::integer_divide_floor ( x,
y 
)
constexpr

◆ integer_least_multiple()

template<typename X , typename Y >
__host__ constexpr __device__ auto ck::math::integer_least_multiple ( x,
y 
)
constexpr

◆ lcm()

Y __host__ constexpr __device__ auto ck::math::lcm ( x,
y 
)
constexpr

◆ log() [1/2]

template<typename T >
__host__ T ck::math::log ( x)
inline

◆ log() [2/2]

template<typename T >
__device__ T ck::math::log ( x)
inline

◆ log< double >()

template<>
__device__ double ck::math::log< double > ( double  x)
inline

◆ log< float >()

template<>
__device__ float ck::math::log< float > ( float  x)
inline

◆ log< half_t >()

template<>
__device__ half_t ck::math::log< half_t > ( half_t  x)
inline

◆ max() [1/5]

template<index_t Y>
__host__ constexpr __device__ index_t ck::math::max ( index_t  x,
Number< Y >   
)
constexpr

◆ max() [2/5]

template<index_t X>
__host__ constexpr __device__ index_t ck::math::max ( Number< X >  ,
index_t  y 
)
constexpr

◆ max() [3/5]

template<typename T >
__host__ constexpr __device__ T ck::math::max ( x)
constexpr

◆ max() [4/5]

template<typename T >
__host__ constexpr __device__ T ck::math::max ( x,
y 
)
constexpr

◆ max() [5/5]

template<typename X , typename... Ys>
__host__ constexpr __device__ auto ck::math::max ( x,
Ys...  ys 
)
constexpr

◆ min() [1/5]

template<index_t Y>
__host__ constexpr __device__ index_t ck::math::min ( index_t  x,
Number< Y >   
)
constexpr

◆ min() [2/5]

template<index_t X>
__host__ constexpr __device__ index_t ck::math::min ( Number< X >  ,
index_t  y 
)
constexpr

◆ min() [3/5]

template<typename T >
__host__ constexpr __device__ T ck::math::min ( x)
constexpr

◆ min() [4/5]

template<typename T >
__host__ constexpr __device__ T ck::math::min ( x,
y 
)
constexpr

◆ min() [5/5]

template<typename X , typename... Ys>
__host__ constexpr __device__ auto ck::math::min ( x,
Ys...  ys 
)
constexpr

◆ neg() [1/2]

template<typename T >
__host__ T ck::math::neg ( x)
inline

◆ neg() [2/2]

template<typename T >
__device__ T ck::math::neg ( x)
inline

◆ neg< double >()

template<>
__device__ double ck::math::neg< double > ( double  x)
inline

◆ neg< float >()

template<>
__device__ float ck::math::neg< float > ( float  x)
inline

◆ neg< half_t >()

template<>
__device__ half_t ck::math::neg< half_t > ( half_t  x)
inline

◆ neg< int32_t >()

template<>
__device__ int32_t ck::math::neg< int32_t > ( int32_t  x)
inline

◆ neg< int8_t >()

template<>
__device__ int8_t ck::math::neg< int8_t > ( int8_t  x)
inline

◆ next_power_of_two() [1/2]

template<index_t X>
__host__ constexpr __device__ auto ck::math::next_power_of_two ( )
constexpr

◆ next_power_of_two() [2/2]

template<index_t X>
__host__ constexpr __device__ auto ck::math::next_power_of_two ( Number< X >  x)
constexpr

◆ pow() [1/2]

template<typename T >
__host__ T ck::math::pow ( x,
gamma 
)
inline

◆ pow() [2/2]

template<typename T >
__device__ T ck::math::pow ( x,
gamma 
)
inline

◆ pow< double >()

template<>
__device__ double ck::math::pow< double > ( double  x,
double  gamma 
)
inline

◆ pow< float >()

template<>
__device__ float ck::math::pow< float > ( float  x,
float  gamma 
)
inline

◆ rcp() [1/2]

template<typename T >
__host__ T ck::math::rcp ( x)
inline

◆ rcp() [2/2]

template<typename T >
__device__ T ck::math::rcp ( x)
inline

◆ sin() [1/2]

template<typename T >
__host__ T ck::math::sin ( x)
inline

◆ sin() [2/2]

template<typename T >
__device__ T ck::math::sin ( x)
inline

◆ sin< double >()

template<>
__device__ double ck::math::sin< double > ( double  x)
inline

◆ sin< float >()

template<>
__device__ float ck::math::sin< float > ( float  x)
inline

◆ sin< half_t >()

template<>
__device__ half_t ck::math::sin< half_t > ( half_t  x)
inline

◆ sinh() [1/2]

template<typename T >
__host__ T ck::math::sinh ( x)
inline

◆ sinh() [2/2]

template<typename T >
__device__ T ck::math::sinh ( x)
inline

◆ sinh< double >()

template<>
__device__ double ck::math::sinh< double > ( double  x)
inline

◆ sinh< float >()

template<>
__device__ float ck::math::sinh< float > ( float  x)
inline

◆ tan() [1/2]

template<typename T >
__host__ T ck::math::tan ( x)
inline

◆ tan() [2/2]

template<typename T >
__device__ T ck::math::tan ( x)
inline

◆ tan< double >()

template<>
__device__ double ck::math::tan< double > ( double  x)
inline

◆ tan< float >()

template<>
__device__ float ck::math::tan< float > ( float  x)
inline

◆ tanh() [1/2]

template<typename T >
__host__ T ck::math::tanh ( x)
inline

◆ tanh() [2/2]

template<typename T >
__device__ T ck::math::tanh ( x)
inline

◆ tanh< double >()

template<>
__device__ double ck::math::tanh< double > ( double  x)
inline

◆ tanh< float >()

template<>
__device__ float ck::math::tanh< float > ( float  x)
inline