This page contains the exhaustive API of the SPMD module. Note that most
operators names follow the simple naming k_[NSIMD name]
and have the same
semantics. This page is light, you may use CTRL+F to find the operator you
are looking for.
For genericity on the base type you should use operator names instead of
infix operators, e.g. k_add
instead of +
. Indeed for f16
's NVIDIA CUDA
and NSIMD do not provide overloads and therefore code using +
will fail to
compile.
Note that all operators accept literals and scalars. For example you may
write k_add(a, 1)
or float s; k_add(a, s);
. This also applies when
using infix operators. But note that literals or scalars must have the
same type as the other operands.
#define k_orb(a0, a1)
Infix operator: |
(for certain types only)
Returns the bitwise or of the arguments.
#define k_andb(a0, a1)
Infix operator: &
(for certain types only)
Returns the bitwise and of the arguments.
#define k_andnotb(a0, a1)
Returns the bitwise andnot of its arguments, more precisely "arg1 and (not arg2)"
#define k_notb(a0)
Infix operator: ~
(for certain types only)
Returns the bitwise not of the argument.
#define k_xorb(a0, a1)
Infix operator: ^
(for certain types only)
Returns the bitwise xor of the arguments.
#define k_shr(a0, a1)
Infix operator: >>
(for certain types only)
Returns the right shift in zeros of the arguments.
#define k_shl(a0, a1)
Infix operator: <<
(for certain types only)
Returns the left shift of the arguments.
#define k_shra(a0, a1)
Performs a right shift operation with sign extension.
#define k_orl(a0, a1)
Infix operator: ||
(for certain types only)
Returns the logical or of the arguments.
#define k_andl(a0, a1)
Infix operator: &&
(for certain types only)
Returns the logical and of the arguments.
#define k_andnotl(a0, a1)
Returns the logical andnot of its arguments, more precisely "arg1 and (not arg2)"
#define k_xorl(a0, a1)
Returns the logical xor of the arguments.
#define k_notl(a0)
Infix operator: !
(for certain types only)
Returns the logical not of the argument.
#define k_to_mask(to_type, a0)
Returns a mask consisting of all ones for true elements and all zeros for false elements.
#define k_to_logical(a0)
Returns a vector of logicals. Set true when the corresponding elements are non zero (at least one bit to 1) and false otherwise.
#define k_add(a0, a1)
Infix operator: +
(for certain types only)
Returns the addition of the arguments.
#define k_sub(a0, a1)
Infix operator: -
(for certain types only)
Returns the subtraction of the arguments.
#define k_mul(a0, a1)
Infix operator: *
(for certain types only)
Returns the multiplication of the arguments.
#define k_div(a0, a1)
Infix operator: /
(for certain types only)
Returns the division of the arguments.
#define k_neg(a0)
Infix operator: -
(for certain types only)
Returns the opposite of the argument.
#define k_min(a0, a1)
Returns the minimum of the arguments.
#define k_max(a0, a1)
Returns the maximum of the arguments.
#define k_abs(a0)
Returns the absolute value of the argument.
#define k_fma(a0, a1, a2)
Multiply the first and second inputs and then adds the third input.
#define k_fnma(a0, a1, a2)
Multiply the first and second inputs, negate the intermediate result and then adds the third input.
#define k_fms(a0, a1, a2)
Substracts the third input to multiplication the first and second inputs.
#define k_fnms(a0, a1, a2)
Multiply the first and second inputs, negate the intermediate result and then substracts the third input to the intermediate result.
#define k_rec(a0)
Returns the reciprocal of the argument.
#define k_rec11(a0)
Returns the reciprocal with relative error at most \(2^{-11}\) of the argument.
#define k_rec8(a0)
Returns the reciprocal with relative error at most \(2^{-8}\) of the argument.
#define k_sqrt(a0)
Returns the square root of the argument.
#define k_rsqrt11(a0)
Returns the square root with relative error at most \(2^{-11}\) of the argument.
#define k_rsqrt8(a0)
Returns the square root with relative error at most \(2^{-8}\) of the argument.
#define k_adds(a0, a1)
Returns the saturated sum of the two vectors given as arguments
#define k_subs(a0, a1)
Returns the saturated subtraction of the two vectors given as arguments
#define k_cbrt_u35(a0)
Compute the cube root of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_cbrt_u10(a0)
Compute the cube root of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_hypot_u05(a0, a1)
Compute the Euclidean distance of its argument with a precision of 0.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_hypot_u35(a0, a1)
Compute the Euclidean distance of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_remainder(a0, a1)
Compute the floating-point remainder of its arguments. For more informations visit https://sleef.org/purec.xhtml.
#define k_fmod(a0, a1)
Compute the floating-point remainder of its argument. For more informations visit https://sleef.org/purec.xhtml.
#define k_eq(a0, a1)
Infix operator: ==
(for certain types only)
Returns the compare for equality of the arguments.
#define k_ne(a0, a1)
Infix operator: !=
(for certain types only)
Compare the inputs for inequality.
#define k_gt(a0, a1)
Infix operator: >
(for certain types only)
Compare the inputs for greater-than.
#define k_ge(a0, a1)
Infix operator: >=
(for certain types only)
Compare the inputs for greater-or-equal-than.
#define k_lt(a0, a1)
Infix operator: <
(for certain types only)
Compare the inputs for lesser-than.
#define k_le(a0, a1)
Infix operator: <=
(for certain types only)
Compare the inputs for lesser-or-equal-than.
#define k_ceil(a0)
Returns the rounding up to integer value of the argument.
#define k_floor(a0)
Returns the rounding down to integer value of the argument.
#define k_trunc(a0)
Returns the rounding towards zero to integer value of the argument.
#define k_round_to_even(a0)
Returns the rounding to nearest integer value, tie to even of the argument.
#define k_reinterpret(to_type, a0)
Reinterpret input vector into a different vector type preserving all bits.
#define k_cvt(to_type, a0)
Convert input vector into a different vector type. The output type must have same length as input type.
#define k_sin_u35(a0)
Compute the sine of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_cos_u35(a0)
Compute the cosine of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_tan_u35(a0)
Compute the tangent of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_asin_u35(a0)
Compute the arcsine of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_acos_u35(a0)
Compute the arccosine of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_atan_u35(a0)
Compute the arctangent of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_atan2_u35(a0, a1)
Compute the arctangent of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_sin_u10(a0)
Compute the sine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_cos_u10(a0)
Compute the cosine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_tan_u10(a0)
Compute the tangent of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_asin_u10(a0)
Compute the arcsine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_acos_u10(a0)
Compute the arccosine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_atan_u10(a0)
Compute the arctangent of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_atan2_u10(a0, a1)
Compute the arctangent of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_sinpi_u05(a0)
Compute the sine of pi times argument of its argument with a precision of 0.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_cospi_u05(a0)
Compute the cosine of pi times argument of its argument with a precision of 0.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_log_u35(a0)
Compute the natural logarithm of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_log_u10(a0)
Compute the natural logarithm of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_exp_u10(a0)
Compute the base-e exponential of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_pow_u10(a0, a1)
Compute the power of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_exp2_u10(a0)
Compute the base-2 exponential of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_exp2_u35(a0)
Compute the base-2 exponential of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_exp10_u10(a0)
Compute the base-10 exponential of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_exp10_u35(a0)
Compute the base-10 exponential of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_expm1_u10(a0)
Compute the exponential minus 1 of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_log10_u10(a0)
Compute the base-10 logarithm of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_log2_u10(a0)
Compute the base-2 logarithm of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_log2_u35(a0)
Compute the base-2 logarithm of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_log1p_u10(a0)
Compute the logarithm of 1 plus argument of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_lgamma_u10(a0)
Compute the log gamma of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_tgamma_u10(a0)
Compute the true gamma of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_erf_u10(a0)
Compute the complementary error of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_erfc_u15(a0)
Compute the complementary error of its argument with a precision of 1.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_sinh_u10(a0)
Compute the hyperbolic sine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_cosh_u10(a0)
Compute the hyperbolic cosine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_tanh_u10(a0)
Compute the hyperbolic tangent of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_sinh_u35(a0)
Compute the hyperbolic sine of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_cosh_u35(a0)
Compute the hyperbolic cosine of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_tanh_u35(a0)
Compute the hyperbolic tangent of its argument with a precision of 3.5 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_asinh_u10(a0)
Compute the inverse hyperbolic sine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_acosh_u10(a0)
Compute the inverse hyperbolic cosine of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.
#define k_atanh_u10(a0)
Compute the inverse hyperbolic tangent of its argument with a precision of 1.0 ulps. For more informations visit https://sleef.org/purec.xhtml.