AI Engine API User Guide (AIE) 2021.2
Elementary Functions

Overview

Modules

Floating-point Scalar Operations

Functions

template<RealVectorVec>
auto aie::cos(const Vec &v) ->aie_dm_resource_remove_t< Vec >
More...
template
auto aie::cos(E a)
More...
template
accum< accfloat, Elems > aie::inv(constaccum< accfloat, Elems > &v)
template<VectorVec>
auto aie::inv(const Vec &v) ->aie_dm_resource_remove_t< Vec >
template<ElemE>
auto aie::inv(E a)
template
accum< accfloat, Elems > aie::invsqrt(constaccum< accfloat, Elems > &v)
template<VectorVec>
auto aie::invsqrt(const Vec &v) ->aie_dm_resource_remove_t< Vec >
template<ElemE>
auto aie::invsqrt(E a)
template<RealVectorVec>
auto aie::sin(const Vec &v) ->aie_dm_resource_remove_t< Vec >
More...
template
auto aie::sin(E a)
More...
template<RealVectorVec>
auto aie::sincos(const Vec &v) -> std::pair<aie_dm_resource_remove_t< Vec >,aie_dm_resource_remove_t< Vec >>
More...
template
auto aie::sincos(E a)
More...
template<RealVectorVec>
auto aie::sincos_complex(const Vec &v) ->vector< std::conditional_t< Vec::is_floating_point(), cfloat, cint16 >, Vec::size()>
More...
template
auto aie::sincos_complex(E a) -> std::conditional_t< detail::is_floating_point_v<operand_base_type_t< E >>, cfloat, cint16 >
More...
template
accum< accfloat, Elems > aie::sqrt(constaccum< accfloat, Elems > &v)
template<VectorVec>
auto aie::sqrt(const Vec &v) ->aie_dm_resource_remove_t< Vec >
template<ElemE>
auto aie::sqrt(E a)

Function Documentation

cos()[1/2]

template< RealVectorVec>
auto aie::cos ( const Vec & v ) ->aie_dm_resource_remove_t

Performs a cosine operation on all elements in the input vector. The input vector can either be of float values in radians or integers. The floating-point range is [-Pi, Pi]. Integer values are handled as a fixed-point input value in Q1.31 format scaled with 1/Pi (input value 2^31 corresponds to Pi). In this case only the upper 20-bit of the input value are used.

According to input type, returns a vector of float or of signed Q.15 fixed-point format.

Parameters
v Input vector. The type must meetRealVector.

cos()[2/2]

template
auto aie::cos ( E a )

Performs a cosine operation on a single value. The input can either be a float value in radians or an integer. The floating-point range is [-Pi, Pi]. Integer values are handled as a fixed-point input value in Q1.31 format scaled with 1/Pi (input value 2^31 corresponds to Pi). In this case only the upper 20-bit of the input value are used.

According to input type, the returned value is either a float or a signed Q.15 fixed-point format.

Parameters
a Value. The type must meetRealElem.

sin()[1/2]

template< RealVectorVec>
auto aie::sin ( const Vec & v ) ->aie_dm_resource_remove_t

Performs a sine operation on all elements in the input vector. The input vector can either be of float values in radians or integers. The floating-point range is [-Pi, Pi]. Integer values are handled as a fixed-point input value in Q1.31 format scaled with 1/Pi (input value 2^31 corresponds to Pi). In this case only the upper 20-bit of the input value are used.

According to input type, returns a vector of float or of signed Q.15 fixed-point format.

Parameters
v Input vector. The type must meetRealVector.

sin()[2/2]

template
auto aie::sin ( E a )

Performs a sine operation on a single value. The input can either be a float value in radians or an integer. The floating-point range is [-Pi, Pi]. Integer values are handled as a fixed-point input value in Q1.31 format scaled with 1/Pi (input value 2^31 corresponds to Pi). In this case only the upper 20-bit of the input value are used.

Parameters
a Value. The type must meetRealElem.

sincos()[1/2]

template< RealVectorVec>
auto aie::sincos ( const Vec & v ) -> std::pair<aie_dm_resource_remove_t,aie_dm_resource_remove_t>

Same as sin and cos, but performs both operations and returns a std::pair of vectors of result values. The first vector contains the sine values, the second contains the cosine values

According to input type, returns a pair of vectors of float or of signed Q.15 fixed-point format.

Parameters
v Input vector. The type must meetRealVector.

sincos()[2/2]

template
auto aie::sincos ( E a )

Performs both sin and cos, and returns both values as an std::pair (sin first, then cos). The input can either be a float value in radians or an integer. The floating-point range is [-Pi, Pi]. Integer values are handled as a fixed-point input value in Q1.31 format scaled with 1/Pi (input value 2^31 corresponds to Pi). In this case only the upper 20-bit of the input value are used.

According to input type, the returned values are either float or signed Q.15 fixed-point format.

Parameters
a Value. The type must meetRealElem.

sincos_complex()[1/2]

template< RealVectorVec>
auto aie::sincos_complex ( const Vec & v ) ->vector, Vec::size()>

Same as sincos, but returns both values as the real and imaginary parts in a vector of complex values (cos in the real part, sin in the imaginary).

According to input type, returns a vector of float or of signed Q.15 fixed-point format.

Parameters
v Input vector. The type must meetRealVector.

sincos_complex()[2/2]

template
auto aie::sincos_complex ( E a ) -> std::conditional_toperand_base_type_t>, cfloat, cint16>

Same as sincos, but returns both values as the real and imaginary parts of a complex number (cos in the real part, sin in the imaginary part).

Each part of the returned complex number is either a float or a signed Q.15 fixed-point format.

Parameters
a Value. The type must meetRealElem.