triton.language.extra.cann.libdevice

目录

triton.language.extra.cann.libdevice#

Libdevice Ops#

abs

Computes the absolute value of the input parameter.

acos

Computes the inverse cosine (arccos) of the input parameter.

acosh

Computes the inverse hyperbolic cosine of the input parameter.

add_rd

Floating-point addition with round-down (toward negative infinity) rounding mode.

add_rn

Floating-point addition with round-to-nearest-even rounding mode.

add_ru

Floating-point addition with round-up (toward positive infinity) rounding mode.

add_rz

Floating-point addition with round-toward-zero rounding mode.

asin

Computes the inverse sine (arcsin) of the input parameter.

asinh

Computes the inverse hyperbolic sine of the input parameter.

atan

Computes the inverse tangent (arctan) of the input parameter.

atan2

Two-argument inverse tangent function, computes the arctangent of x / y.

atanh

Inverse hyperbolic tangent function, computes the inverse hyperbolic tangent of the input parameter.

brev

Bit reversal function, reverses the bit order of a 32-bit integer.

byte_perm

Selects bytes from two 32-bit integers x and y according to selector s and combines them into a new integer.

cbrt

Computes the cube root of the input parameter.

ceil

Ceiling operation, returns the smallest integer greater than or equal to x.

clz

Counts the number of leading zeros in a 32-bit integer.

copysign

Generates a floating-point number with magnitude equal to the magnitude of x and sign equal to the sign of y.

cos

Computes the cosine of the input parameter (in radians).

cosh

Computes the hyperbolic cosine of the input parameter.

cospi

Computes the value of cos(π × x).

cyl_bessel_i0

Computes the modified Bessel function of the first kind, order 0, of the input parameter.

cyl_bessel_i1

Computes the modified Bessel function of the first kind, order 1, of the input parameter.

div_rd

Floating-point division with round-down (toward negative infinity) rounding mode.

div_rn

Floating-point division with round-to-nearest-even rounding mode.

div_ru

Floating-point division with round-up (toward positive infinity) rounding mode.

div_rz

Floating-point division with round-toward-zero rounding mode.

erf

Computes the error function of the input parameter.

erfc

Computes the complementary error function of the input parameter, i.e., 1 - erf(x).

erfcinv

Inverse complementary error function, finds the value y such that x = erfc(y).

erfcx

Computes the scaled complementary error function of the input parameter, i.e., exp(x²) × erfc(x).

erfinv

Inverse error function, finds the value y such that x = erf(y).

exp

Exponential function, computes e raised to the power of x.

exp10

Base-10 exponential function, computes 10 raised to the power of x.

exp2

Base-2 exponential function, computes 2 raised to the power of x.

expm1

Computes e raised to the power of x, minus 1.

fast_cosf

Fast approximate cosine function.

fast_dividef

Fast approximate division.

fast_exp10f

Fast approximate base-10 exponential function.

fast_expf

Fast approximate exponential function.

fast_log10f

Fast approximate base-10 logarithm function.

fast_log2f

Fast approximate base-2 logarithm function.

fast_logf

Fast approximate natural logarithm function.

fast_powf

Fast approximate power function.

fast_sinf

Fast approximate sine function.

fast_tanf

Fast approximate tangent function.

fast_tanhf

Computes the hyperbolic tangent of x using a fast approximation.

fdim

Computes the positive difference between x and y.

ffs

Finds the first bit set to 1 and returns the index of the lowest bit set to 1.

finitef

Determines whether the input is a finite floating-point number.

float2half_rn

Converts x from a 32-bit floating-point value to a 16-bit floating-point value using round-to-nearest-even.

float2int_rd

Converts a floating-point number to a 32-bit integer with round-down mode.

float2int_rn

Converts a floating-point number to a 32-bit integer with round-to-nearest-even mode.

float2int_ru

Converts a floating-point number to a 32-bit integer with round-up mode.

float2int_rz

Converts a floating-point number to a 32-bit integer with round-toward-zero mode.

float2ll_rd

Converts a floating-point number to a 64-bit integer with round-down mode.

float2ll_rn

Converts a floating-point number to a 64-bit integer with round-to-nearest-even mode.

float2ll_ru

Converts a floating-point number to a 64-bit integer with round-up mode.

float2ll_rz

Converts a floating-point number to a 64-bit integer with round-toward-zero mode.

float2uint_rd

Converts a floating-point number to a 32-bit unsigned integer with round-down mode.

float2uint_rn

Converts a floating-point number to a 32-bit unsigned integer with round-to-nearest-even mode.

float2uint_ru

Converts a floating-point number to a 32-bit unsigned integer with round-up mode.

float2uint_rz

Converts a floating-point number to a 32-bit unsigned integer with round-toward-zero mode.

float2ull_rd

Converts a floating-point number to a 64-bit unsigned integer with round-down mode.

float2ull_rn

Converts a floating-point number to a 64-bit unsigned integer with round-to-nearest-even mode.

float2ull_ru

Converts a floating-point number to a 64-bit unsigned integer with round-up mode.

float2ull_rz

Converts a floating-point number to a 64-bit unsigned integer with round-toward-zero mode.

float_as_int

Reinterprets the bit pattern of a floating-point number as a 32-bit integer.

float_as_uint

Reinterprets the bit pattern of a floating-point number as a 32-bit unsigned integer.

floor

Floor operation, returns the largest integer less than or equal to x.

fma

Fused multiply-add, computes x × y + z.

fma_rd

Fused multiply-add operation with round-down rounding mode.

fma_rn

Fused multiply-add operation with round-to-nearest-even rounding mode.

fma_ru

Fused multiply-add operation with round-up rounding mode.

fma_rz

Fused multiply-add operation with round-toward-zero rounding mode.

fmod

Floating-point modulo, computes the remainder of x / y, with the same sign as x.

gamma

Computes the gamma function of the input parameter.

hadd

Computes the average of x and y.

half2float

Converts x from a 16-bit floating-point value to a 32-bit floating-point value.

hypot

Computes the Euclidean distance between x and y.

ilogb

Extracts the unbiased exponent (base-2 integer logarithm) of a floating-point number.

int2float_rd

Converts a 32-bit integer to a floating-point number with round-down mode.

int2float_rn

Converts a 32-bit integer to a floating-point number with round-to-nearest-even mode.

int2float_ru

Converts a 32-bit integer to a floating-point number with round-up mode.

int2float_rz

Converts a 32-bit integer to a floating-point number with round-toward-zero mode.

int_as_float

Reinterprets the bit pattern of a 32-bit integer as a floating-point number.

isinf

Determines whether the input is infinity.

isnan

Determines whether the input is NaN (not a number).

j0

Computes the Bessel function of the first kind of order 0 of the input parameter.

j1

Computes the Bessel function of the first kind of order 1 of the input parameter.

jn

Computes the Bessel function of the first kind of order n of the input parameter.

ldexp

Computes the value of x × 2^exp.

lgamma

Computes the natural logarithm of the absolute value of the gamma function for input x.

ll2float_rd

Converts a 64-bit integer to a floating-point number with round-down mode.

ll2float_rn

Converts a 64-bit integer to a floating-point number with round-to-nearest-even mode.

ll2float_ru

Converts a 64-bit integer to a floating-point number with round-up mode.

ll2float_rz

Converts a 64-bit integer to a floating-point number with round-toward-zero mode.

llrint

Rounds a floating-point number to the nearest 64-bit integer value.

llround

Rounds a floating-point number to the nearest 64-bit integer value.

log

Computes the natural (base-e) logarithm of input x.

log10

Computes the base-10 logarithm of input x.

log1p

Computes the value of log(1 + x).

log2

Computes the base-2 logarithm of input x.

logb

Extracts the exponent value of a floating-point number.

max

Computes the element-wise maximum of x and y.

min

Computes the element-wise minimum of x and y.

mul24

Computes the lower 24-bit multiplication result of x and y.

mul_rd

Floating-point multiplication with round-down rounding mode.

mul_rn

Floating-point multiplication with round-to-nearest-even rounding mode.

mul_ru

Floating-point multiplication with round-up rounding mode.

mul_rz

Floating-point multiplication with round-toward-zero rounding mode.

mulhi

Computes the high 32 bits of the multiplication result of x and y.

nan

Generates a NaN value from x.

nearbyint

Converts x to the nearest integer.

nextafter

Computes the next representable floating-point number from x toward y.

norm3d

Computes the Euclidean norm of a 3D vector, i.e., sqrt(x² + y² + z²).

norm4d

Computes the Euclidean norm of a 4D vector, i.e., sqrt(x² + y² + z² + w²).

normcdf

Computes the cumulative distribution function of the standard normal distribution.

normcdfinv

Computes the inverse of the cumulative distribution function of the standard normal distribution.

popc

Counts the number of bits set to 1 in x.

pow

Power function, computes x raised to the power of y.

rcbrt

Computes the reciprocal cube root of x.

rcp_rd

Floating-point reciprocal with round-down rounding mode.

rcp_rn

Floating-point reciprocal with round-to-nearest-even rounding mode.

rcp_ru

Floating-point reciprocal with round-up rounding mode.

rcp_rz

Floating-point reciprocal with round-toward-zero rounding mode.

reciprocal

Computes the reciprocal of x (i.e., 1 / x).

relu

Rectified linear unit function, returns x when x > 0, otherwise returns 0.

remainder

Computes the remainder of x divided by y, where r = x - ny, and n is the nearest integer to x / y.

rhadd

Computes the rounded average of x and y.

rhypot

Computes the reciprocal of the Euclidean distance between x and y.

rint

Computes the nearest integer to x using round-to-nearest-even rounding mode.

rnorm3d

Computes the reciprocal of the Euclidean norm of a 3D vector.

rnorm4d

Computes the reciprocal of the Euclidean norm of a 4D vector.

round

Computes the nearest integer to x using round-to-nearest-even rounding mode.

rsqrt

Computes the reciprocal square root of x.

rsqrt_rn

Computes the reciprocal square root of x using round-to-nearest-even rounding mode.

sad

Computes abs(x - y) + z for signed or unsigned 32-bit integers.

saturatef

Clamps x to the range [+0.0, 1.0].

scalbn

Computes the value of x × 2^n.

signbit

Extracts the sign bit of x.

sin

Computes the sine of the input parameter x (in radians).

sinh

Computes the hyperbolic sine of input parameter x.

sinpi

Computes the value of sin(π × x).

sqrt

Computes the square root of x.

sqrt_rd

Computes the square root of x with round-down rounding mode.

sqrt_rn

Computes the square root of x with round-to-nearest-even rounding mode.

sqrt_ru

Computes the square root of x with round-up rounding mode.

sqrt_rz

Computes the square root of x with round-toward-zero rounding mode.

sub_rd

Floating-point subtraction with round-down rounding mode.

sub_rn

Floating-point subtraction with round-to-nearest-even rounding mode.

sub_ru

Floating-point subtraction with round-up rounding mode.

sub_rz

Floating-point subtraction with round-toward-zero rounding mode.

tan

Computes the tangent of input parameter x (in radians).

tanh

Computes the hyperbolic tangent of input parameter x.

tgamma

Computes the gamma function of the input parameter.

trunc

Truncation operation, rounds toward zero to the nearest integer.

uint2float_rd

Converts a 32-bit unsigned integer to a floating-point number with round-down mode.

uint2float_rn

Converts a 32-bit unsigned integer to a floating-point number with round-to-nearest-even mode.

uint2float_ru

Converts a 32-bit unsigned integer to a floating-point number with round-up mode.

uint2float_rz

Converts a 32-bit unsigned integer to a floating-point number with round-toward-zero mode.

uint_as_float

Reinterprets the bit pattern of a 32-bit unsigned integer as a floating-point number.

ull2float_rd

Converts a 64-bit unsigned integer to a floating-point number with round-down mode.

ull2float_rn

Converts a 64-bit unsigned integer to a floating-point number with round-to-nearest-even mode.

ull2float_ru

Converts a 64-bit unsigned integer to a floating-point number with round-up mode.

ull2float_rz

Converts a 64-bit unsigned integer to a floating-point number with round-toward-zero mode.

y0

Computes the Bessel function of the second kind of order 0 of the input parameter.

y1

Computes the Bessel function of the second kind of order 1 of the input parameter.

yn

Computes the Bessel function of the second kind of order n of the input parameter.