XeTLA v0.3.6
IntelĀ® Xe Templates for Linear Algebra - API Definition Document
 
Loading...
Searching...
No Matches
Math operation APIs

Defines math operations on XeTLA vector data types. More...

Collaboration diagram for Math operation APIs:

Functions

template<typename T0 , typename T1 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_abs (xetla_vector< T1, SZ > src0)
 Get absolute value (vector version)
 
template<typename T0 , typename T1 >
std::enable_if_t<!std::is_same< remove_const_t< T0 >, remove_const_t< T1 > >::value, remove_const_t< T0 > > __XETLA_API gpu::xetla::xetla_abs (T1 src0)
 Get absolute value (scalar version)
 
template<typename T1 , int SZ>
__XETLA_API xetla_vector< T1, SZ > gpu::xetla::xetla_abs (xetla_vector< T1, SZ > src0)
 Get absolute value (vector version).
 
template<typename T1 >
__XETLA_API std::remove_const< T1 >::type gpu::xetla::xetla_abs (T1 src0)
 Get absolute value (scalar version).
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_max (xetla_vector< T, SZ > src0, xetla_vector< T, SZ > src1, Sat sat={})
 Selects component-wise the maximum of the two vectors.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_max (xetla_vector< T, SZ > src0, T src1, Sat sat={})
 Selects maximums for each element of the input vector and a scalar.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_max (T src0, xetla_vector< T, SZ > src1, Sat sat={})
 Selects maximums for each element of the input scalar and a vector.
 
template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_max (T src0, T src1, Sat sat={})
 Selects maximum between two scalar values.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_min (xetla_vector< T, SZ > src0, xetla_vector< T, SZ > src1, Sat sat={})
 Selects component-wise the minimum of the two vectors.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_min (xetla_vector< T, SZ > src0, T src1, Sat sat={})
 Selects minimums for each element of the input vector and a scalar.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_min (T src0, xetla_vector< T, SZ > src1, Sat sat={})
 Selects minimums for each element of the input scalar and a vector.
 
template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_min (T src0, T src1, Sat sat={})
 Selects minimum between two scalar values.
 
template<class T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_exp (xetla_vector< T, SZ > src, Sat sat={})
 Calculate exponent value for each element of the input vector, the base is e.
 
template<class T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_exp (T src, Sat sat={})
 Calculate exponent value of a scalar, the base is e.
 
template<class T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_exp2 (xetla_vector< T, SZ > src, Sat sat={})
 Calculate exponent value for each element of the input vector, the base is 2.
 
template<class T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_exp2 (T src, Sat sat={})
 Calculate exponent value of a scalar, the base is 2.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_inv (xetla_vector< T, SZ > src, Sat sat={})
 Calculate the inversion, i.e.
 
template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_inv (T src, Sat sat={})
 Calculate the inversion, i.e.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_sqrt (xetla_vector< T, SZ > src, Sat sat={})
 Calculate the square root, i.e.
 
template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_sqrt (T src, Sat sat={})
 Calculate the square root, i.e.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_sqrt_ieee (xetla_vector< T, SZ > src, Sat sat={})
 Calculate the square root, i.e.
 
template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_sqrt_ieee (T src, Sat sat={})
 Calculate the square root, i.e.
 
template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_rsqrt (xetla_vector< T, SZ > src, Sat sat={})
 Calculate the inversion of square root, i.e.
 
template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_APIgpu::xetla::xetla_rsqrt (T src, Sat sat={})
 Calculate the inversion of square root, i.e.
 
template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_tanh (xetla_vector< T, SZ > src)
 Calculate the tanh (vector version).
 
template<typename T >
__XETLA_APIgpu::xetla::xetla_tanh (T src)
 Calculate the tanh (scalar version).
 
template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_add_c (xetla_vector< T, SZ > src0, xetla_vector< T, SZ > src1, xetla_vector_ref< T, SZ > __REF__ carry)
 Add two unsigned integer vectors, return the result and in-place update the carry.
 
template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_add_c (xetla_vector< T, SZ > src0, T src1, xetla_vector_ref< T, SZ > __REF__ carry)
 Add one unsigned integer vectors with a scalar, return the result and in-place update the carry.
 
template<typename T0 , typename T1 , typename T2 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_imul (xetla_vector_ref< T0, SZ > __REF__ lo, xetla_vector< T1, SZ > src0, T2 src1)
 Multiply src0 with src1, return the hi part and in-place update the lo part.
 
template<typename T0 , typename T1 , int SZ, reduce_op BinaryOperation>
__XETLA_API T0 gpu::xetla::xetla_reduce (xetla_vector< T1, SZ > v)
 Performs reduction over elements of the input vector.
 
template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_rnde (xetla_vector< T, SZ > src0)
 Get rounded value.
 
template<typename T1 , typename T0 , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T1, SZ > gpu::xetla::xetla_add (xetla_vector< T0, SZ > src0, xetla_vector< T0, SZ > src1, Sat sat={})
 Adds two vectors with saturation The source operands must be both of floating-point type.
 
template<typename T1 , typename T0 , int SZ>
__XETLA_API xetla_vector< T1, SZ > gpu::xetla::xetla_sat (xetla_vector< T0, SZ > src)
 Saturation function.
 
template<argument_type src1_precision, argument_type src2_precision, int systolic_depth, int repeat_count, typename T , typename T1 , typename T2 , int N, int N1, int N2, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, N > gpu::xetla::xetla_mma (xetla_vector< T, N > src0, xetla_vector< T1, N1 > src1, xetla_vector< T2, N2 > src2, Sat sat={})
 description of xetla mma perform matrix multiply add operation
 

Detailed Description

Defines math operations on XeTLA vector data types.

Function Documentation

◆ xetla_abs() [1/4]

template<typename T0 , typename T1 >
std::enable_if_t<!std::is_same< remove_const_t< T0 >, remove_const_t< T1 > >::value, remove_const_t< T0 > > __XETLA_API gpu::xetla::xetla_abs ( T1  src0)

Get absolute value (scalar version)

Template Parameters
T0element type of the returned value.
T1element type of the input value.
Parameters
src0the source operand.
Returns
absolute value.

◆ xetla_abs() [2/4]

template<typename T1 >
__XETLA_API std::remove_const< T1 >::type gpu::xetla::xetla_abs ( T1  src0)

Get absolute value (scalar version).

This is a specialization of a version with two template parameters, where the types of the input and output value are the same.

Template Parameters
T1element type of the input and output value.
Parameters
src0the source operand.
Returns
absolute value.

◆ xetla_abs() [3/4]

template<typename T0 , typename T1 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_abs ( xetla_vector< T1, SZ >  src0)

Get absolute value (vector version)

Template Parameters
T0element type of the returned vector.
T1element type of the input vector.
SZsize of the input and returned vector.
Parameters
src0the input vector.
Returns
vector of absolute values.

◆ xetla_abs() [4/4]

template<typename T1 , int SZ>
__XETLA_API xetla_vector< T1, SZ > gpu::xetla::xetla_abs ( xetla_vector< T1, SZ >  src0)

Get absolute value (vector version).

This is a specialization of a version with three template parameters, where the element types of the input and output vector are the same.

Template Parameters
T1element type of the input and output vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
Returns
vector of absolute values.

◆ xetla_add()

template<typename T1 , typename T0 , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T1, SZ > gpu::xetla::xetla_add ( xetla_vector< T0, SZ >  src0,
xetla_vector< T0, SZ >  src1,
Sat  sat = {} 
)

Adds two vectors with saturation The source operands must be both of floating-point type.

Template Parameters
T0element type of the input vectors.
T1element type of the return vector.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise additive elements.

for esimd, current we don't have add with saturation, this is the emulation

◆ xetla_add_c() [1/2]

template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_add_c ( xetla_vector< T, SZ >  src0,
src1,
xetla_vector_ref< T, SZ > __REF__  carry 
)

Add one unsigned integer vectors with a scalar, return the result and in-place update the carry.

Template Parameters
Telement type of the src, should be uint32_t.
SZelement num of the vector.
Parameters
src0is the src0 of the add operation.
src1is the src1 of the add operation.
carryis the carry of the add operation.
Returns
result of the src0 + src1.

◆ xetla_add_c() [2/2]

template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_add_c ( xetla_vector< T, SZ >  src0,
xetla_vector< T, SZ >  src1,
xetla_vector_ref< T, SZ > __REF__  carry 
)

Add two unsigned integer vectors, return the result and in-place update the carry.

Template Parameters
Telement type of the src, should be uint32_t.
SZelement num of the vector.
Parameters
src0is the src0 of the add operation.
src1is the src1 of the add operation.
carryis the carry of the add operation.
Returns
result of the src0 + src1.

◆ xetla_exp() [1/2]

template<class T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_exp ( src,
Sat  sat = {} 
)

Calculate exponent value of a scalar, the base is e.

Template Parameters
Telement type of the input and return a scalar.
Parameters
srcthe scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
exponent value.

◆ xetla_exp() [2/2]

template<class T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_exp ( xetla_vector< T, SZ >  src,
Sat  sat = {} 
)

Calculate exponent value for each element of the input vector, the base is e.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
srcthe input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise exponent elements.

◆ xetla_exp2() [1/2]

template<class T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_exp2 ( src,
Sat  sat = {} 
)

Calculate exponent value of a scalar, the base is 2.

Template Parameters
Telement type of the input and return a scalar.
Parameters
srcthe scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
exponent value.

◆ xetla_exp2() [2/2]

template<class T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_exp2 ( xetla_vector< T, SZ >  src,
Sat  sat = {} 
)

Calculate exponent value for each element of the input vector, the base is 2.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
srcthe input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise exponent elements.

◆ xetla_imul()

template<typename T0 , typename T1 , typename T2 , int SZ>
__XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_imul ( xetla_vector_ref< T0, SZ > __REF__  lo,
xetla_vector< T1, SZ >  src0,
T2  src1 
)

Multiply src0 with src1, return the hi part and in-place update the lo part.

Template Parameters
T0Return data type, should be 32 bit integer.
T1Type of src0, should be 32 bit integer.
T2Type of src1, should be 32 bit integer.
SZElement num of the vector.
Parameters
lois the low 32 bit part of the result.
src0is the src0 of the mul operation.
src1is the src1 of the mul operation.
Returns
return the high 32 bit part of the result.

◆ xetla_inv() [1/2]

template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_inv ( src,
Sat  sat = {} 
)

Calculate the inversion, i.e.

1/x (scalar version).

Template Parameters
TIs the element data type
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input scalar.
Returns
Returns the result of 1/x

◆ xetla_inv() [2/2]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_inv ( xetla_vector< T, SZ >  src,
Sat  sat = {} 
)

Calculate the inversion, i.e.

1/x (vector version).

Template Parameters
TIs the element data type
SZIs the element num in the vector
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input vector.
Returns
Returns the result of 1/x

◆ xetla_max() [1/4]

template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_max ( src0,
src1,
Sat  sat = {} 
)

Selects maximum between two scalar values.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
Parameters
src0the scalar value.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
maximum value between the two inputs.

◆ xetla_max() [2/4]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_max ( src0,
xetla_vector< T, SZ >  src1,
Sat  sat = {} 
)

Selects maximums for each element of the input scalar and a vector.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the scalar value.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise maximum elements.

◆ xetla_max() [3/4]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_max ( xetla_vector< T, SZ >  src0,
src1,
Sat  sat = {} 
)

Selects maximums for each element of the input vector and a scalar.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise maximum elements.

◆ xetla_max() [4/4]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_max ( xetla_vector< T, SZ >  src0,
xetla_vector< T, SZ >  src1,
Sat  sat = {} 
)

Selects component-wise the maximum of the two vectors.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise maximum elements.

◆ xetla_min() [1/4]

template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_min ( src0,
src1,
Sat  sat = {} 
)

Selects minimum between two scalar values.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
Parameters
src0the scalar value.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
minimum value between the two inputs.

◆ xetla_min() [2/4]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_min ( src0,
xetla_vector< T, SZ >  src1,
Sat  sat = {} 
)

Selects minimums for each element of the input scalar and a vector.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the scalar value.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise minimum elements.

◆ xetla_min() [3/4]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_min ( xetla_vector< T, SZ >  src0,
src1,
Sat  sat = {} 
)

Selects minimums for each element of the input vector and a scalar.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise minimum elements.

◆ xetla_min() [4/4]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_min ( xetla_vector< T, SZ >  src0,
xetla_vector< T, SZ >  src1,
Sat  sat = {} 
)

Selects component-wise the minimum of the two vectors.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise minimum elements.

◆ xetla_mma()

template<argument_type src1_precision, argument_type src2_precision, int systolic_depth, int repeat_count, typename T , typename T1 , typename T2 , int N, int N1, int N2, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, N > gpu::xetla::xetla_mma ( xetla_vector< T, N >  src0,
xetla_vector< T1, N1 >  src1,
xetla_vector< T2, N2 >  src2,
Sat  sat = {} 
)

description of xetla mma perform matrix multiply add operation

Template Parameters
src1_precisionis the data precision of src1
src2_precisionis the data precision of src2
systolic_depthis the depth of mma (i.e k dimension size in dword)
repeat_countis the row (m) of mma (mxkxn)
Tis the data type of src0 and dst
T1is the data type of src1
T2is the data type of src2
Nis the total number of elements in src0 and dst
N1is the total number of elements in src1
N2is the total number of elements in src2
Satis saturation flag
Parameters
src0[in] is src0
src1[in] is src1
src2[in] is src2
sat[in] is saturation flag
Returns
is dst, a xetla_vector of type T and element size of N todo: we need to remove argument_type and get the currect precision based on data type

◆ xetla_reduce()

template<typename T0 , typename T1 , int SZ, reduce_op BinaryOperation>
__XETLA_API T0 gpu::xetla::xetla_reduce ( xetla_vector< T1, SZ >  v)

Performs reduction over elements of the input vector.

Template Parameters
T0type of the return value.
T1element type of the input vector.
SZsize of the input vector.
BinaryOperationtype representing the operation. Can be an instantion of one of the following types:
Parameters
vthe vector to perform reduction on
Returns
result of the reduction

◆ xetla_rnde()

template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_rnde ( xetla_vector< T, SZ >  src0)

Get rounded value.

Template Parameters
Telement type of the input vector.
SZsize of the input and returned vector.
Parameters
src0the input vector.
Returns
vector of rounded values.

◆ xetla_rsqrt() [1/2]

template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_rsqrt ( src,
Sat  sat = {} 
)

Calculate the inversion of square root, i.e.

1/sqrt(x) (scalar version).

Template Parameters
TIs the element data type
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input vector.
Returns
Returns the result of 1/sqrt(x)

◆ xetla_rsqrt() [2/2]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_rsqrt ( xetla_vector< T, SZ >  src,
Sat  sat = {} 
)

Calculate the inversion of square root, i.e.

1/sqrt(x) (vector version).

Template Parameters
TIs the element data type
SZIs the element num in the vector
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input vector.
Returns
Returns the result of 1/sqrt(x)

◆ xetla_sat()

template<typename T1 , typename T0 , int SZ>
__XETLA_API xetla_vector< T1, SZ > gpu::xetla::xetla_sat ( xetla_vector< T0, SZ >  src)

Saturation function.

Template Parameters
T0element type of the input vectors.
T1element type of the return vector.
SZsize of the input and returned vectors.

◆ xetla_sqrt() [1/2]

template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_sqrt ( src,
Sat  sat = {} 
)

Calculate the square root, i.e.

x^(1/2), this is not IEEE754-compatible (scalar version).

Template Parameters
TIs the element data type
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input vector.
Returns
Returns the result of x^(1/2)

◆ xetla_sqrt() [2/2]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_sqrt ( xetla_vector< T, SZ >  src,
Sat  sat = {} 
)

Calculate the square root, i.e.

x^(1/2), this is not IEEE754-compatible (vector version).

Template Parameters
TIs the element data type
SZIs the element num in the vector
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input vector.
Returns
Returns the result of x^(1/2)

◆ xetla_sqrt_ieee() [1/2]

template<typename T , typename Sat = xetla_saturation_off_tag>
__XETLA_API T gpu::xetla::xetla_sqrt_ieee ( src,
Sat  sat = {} 
)

Calculate the square root, i.e.

x^(1/2), IEEE754-compatible (scalar version).

Template Parameters
TIs the element data type
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input vector.
Returns
Returns the result of x^(1/2)

◆ xetla_sqrt_ieee() [2/2]

template<typename T , int SZ, typename Sat = xetla_saturation_off_tag>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_sqrt_ieee ( xetla_vector< T, SZ >  src,
Sat  sat = {} 
)

Calculate the square root, i.e.

x^(1/2), IEEE754-compatible (vector version).

Template Parameters
TIs the element data type
SZIs the element num in the vector
SatIs the saturation flag(off by default). Possible values: saturation_on/saturation_off.
Parameters
srcIs the input vector.
Returns
Returns the result of x^(1/2)

◆ xetla_tanh() [1/2]

template<typename T >
__XETLA_API T gpu::xetla::xetla_tanh ( src)

Calculate the tanh (scalar version).

Template Parameters
TIs the element data type
SZIs the element num in the vector
Parameters
srcIs the input vector.
Returns
Returns the result of tanh(x)

◆ xetla_tanh() [2/2]

template<typename T , int SZ>
__XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_tanh ( xetla_vector< T, SZ >  src)

Calculate the tanh (vector version).

Template Parameters
TIs the element data type
SZIs the element num in the vector
Parameters
srcIs the input vector.
Returns
Returns the result of tanh(x)