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

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_API T | gpu::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_API T | gpu::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_API T | gpu::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_API T | gpu::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_API T | gpu::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_API T | gpu::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_API T | gpu::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_API T | gpu::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_API T | gpu::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 | |
Defines math operations on XeTLA vector data types.
| 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)
| T0 | element type of the returned value. |
| T1 | element type of the input value. |
| src0 | the source operand. |
| __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.
| T1 | element type of the input and output value. |
| src0 | the source operand. |
| __XETLA_API xetla_vector< T0, SZ > gpu::xetla::xetla_abs | ( | xetla_vector< T1, SZ > | src0 | ) |
Get absolute value (vector version)
| T0 | element type of the returned vector. |
| T1 | element type of the input vector. |
| SZ | size of the input and returned vector. |
| src0 | the input vector. |
| __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.
| T1 | element type of the input and output vectors. |
| SZ | size of the input and returned vectors. |
| src0 | the input vector. |
| __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.
| T0 | element type of the input vectors. |
| T1 | element type of the return vector. |
| SZ | size of the input and returned vectors. |
| src0 | the input vector. |
| src1 | the input vector. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
for esimd, current we don't have add with saturation, this is the emulation
| __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.
| T | element type of the src, should be uint32_t. |
| SZ | element num of the vector. |
| src0 | is the src0 of the add operation. |
| src1 | is the src1 of the add operation. |
| carry | is the carry of the add operation. |
| __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.
| T | element type of the src, should be uint32_t. |
| SZ | element num of the vector. |
| src0 | is the src0 of the add operation. |
| src1 | is the src1 of the add operation. |
| carry | is the carry of the add operation. |
| __XETLA_API T gpu::xetla::xetla_exp | ( | T | src, |
| Sat | sat = {} |
||
| ) |
Calculate exponent value of a scalar, the base is e.
| T | element type of the input and return a scalar. |
| src | the scalar value. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src | the input vector. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __XETLA_API T gpu::xetla::xetla_exp2 | ( | T | src, |
| Sat | sat = {} |
||
| ) |
Calculate exponent value of a scalar, the base is 2.
| T | element type of the input and return a scalar. |
| src | the scalar value. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src | the input vector. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
| T0 | Return data type, should be 32 bit integer. |
| T1 | Type of src0, should be 32 bit integer. |
| T2 | Type of src1, should be 32 bit integer. |
| SZ | Element num of the vector. |
| lo | is the low 32 bit part of the result. |
| src0 | is the src0 of the mul operation. |
| src1 | is the src1 of the mul operation. |
| __XETLA_API T gpu::xetla::xetla_inv | ( | T | src, |
| Sat | sat = {} |
||
| ) |
Calculate the inversion, i.e.
1/x (scalar version).
| T | Is the element data type |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input scalar. |
| __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).
| T | Is the element data type |
| SZ | Is the element num in the vector |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input vector. |
| __XETLA_API T gpu::xetla::xetla_max | ( | T | src0, |
| T | src1, | ||
| Sat | sat = {} |
||
| ) |
Selects maximum between two scalar values.
The source operands must be both of integer or both of floating-point type.
| T | element type of the input and return vectors. |
| src0 | the scalar value. |
| src1 | the scalar value. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
The source operands must be both of integer or both of floating-point type.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src0 | the scalar value. |
| src1 | the input vector. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
The source operands must be both of integer or both of floating-point type.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src0 | the input vector. |
| src1 | the scalar value. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src0 | the input vector. |
| src1 | the input vector. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __XETLA_API T gpu::xetla::xetla_min | ( | T | src0, |
| T | src1, | ||
| Sat | sat = {} |
||
| ) |
Selects minimum between two scalar values.
The source operands must be both of integer or both of floating-point type.
| T | element type of the input and return vectors. |
| src0 | the scalar value. |
| src1 | the scalar value. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
The source operands must be both of integer or both of floating-point type.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src0 | the scalar value. |
| src1 | the input vector. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
The source operands must be both of integer or both of floating-point type.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src0 | the input vector. |
| src1 | the scalar value. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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.
| T | element type of the input and return vectors. |
| SZ | size of the input and returned vectors. |
| src0 | the input vector. |
| src1 | the input vector. |
| sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
| __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
| src1_precision | is the data precision of src1 |
| src2_precision | is the data precision of src2 |
| systolic_depth | is the depth of mma (i.e k dimension size in dword) |
| repeat_count | is the row (m) of mma (mxkxn) |
| T | is the data type of src0 and dst |
| T1 | is the data type of src1 |
| T2 | is the data type of src2 |
| N | is the total number of elements in src0 and dst |
| N1 | is the total number of elements in src1 |
| N2 | is the total number of elements in src2 |
| Sat | is saturation flag |
| src0 | [in] is src0 |
| src1 | [in] is src1 |
| src2 | [in] is src2 |
| sat | [in] is saturation flag |
| __XETLA_API T0 gpu::xetla::xetla_reduce | ( | xetla_vector< T1, SZ > | v | ) |
Performs reduction over elements of the input vector.
| T0 | type of the return value. |
| T1 | element type of the input vector. |
| SZ | size of the input vector. |
| BinaryOperation | type representing the operation. Can be an instantion of one of the following types:
|
| v | the vector to perform reduction on |
| __XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_rnde | ( | xetla_vector< T, SZ > | src0 | ) |
Get rounded value.
| T | element type of the input vector. |
| SZ | size of the input and returned vector. |
| src0 | the input vector. |
| __XETLA_API T gpu::xetla::xetla_rsqrt | ( | T | src, |
| Sat | sat = {} |
||
| ) |
Calculate the inversion of square root, i.e.
1/sqrt(x) (scalar version).
| T | Is the element data type |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input vector. |
| __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).
| T | Is the element data type |
| SZ | Is the element num in the vector |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input vector. |
| __XETLA_API xetla_vector< T1, SZ > gpu::xetla::xetla_sat | ( | xetla_vector< T0, SZ > | src | ) |
Saturation function.
| T0 | element type of the input vectors. |
| T1 | element type of the return vector. |
| SZ | size of the input and returned vectors. |
| __XETLA_API T gpu::xetla::xetla_sqrt | ( | T | src, |
| Sat | sat = {} |
||
| ) |
Calculate the square root, i.e.
x^(1/2), this is not IEEE754-compatible (scalar version).
| T | Is the element data type |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input vector. |
| __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).
| T | Is the element data type |
| SZ | Is the element num in the vector |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input vector. |
| __XETLA_API T gpu::xetla::xetla_sqrt_ieee | ( | T | src, |
| Sat | sat = {} |
||
| ) |
Calculate the square root, i.e.
x^(1/2), IEEE754-compatible (scalar version).
| T | Is the element data type |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input vector. |
| __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).
| T | Is the element data type |
| SZ | Is the element num in the vector |
| Sat | Is the saturation flag(off by default). Possible values: saturation_on/saturation_off. |
| src | Is the input vector. |
| __XETLA_API T gpu::xetla::xetla_tanh | ( | T | src | ) |
Calculate the tanh (scalar version).
| T | Is the element data type |
| SZ | Is the element num in the vector |
| src | Is the input vector. |
| __XETLA_API xetla_vector< T, SZ > gpu::xetla::xetla_tanh | ( | xetla_vector< T, SZ > | src | ) |
Calculate the tanh (vector version).
| T | Is the element data type |
| SZ | Is the element num in the vector |
| src | Is the input vector. |