triton.language.extra.cann.libdevice

Contents

triton.language.extra.cann.libdevice#

Libdevice Ops#

abs

Computes the element-wise absolute value of x.

acos

Computes the element-wise arccosine (inverse cosine) of the input tensor.

acosh

Computes the element-wise inverse hyperbolic cosine of the input tensor.

add_rd

Computes x + y rounded down.

add_rn

Computes x + y rounded to nearest even.

add_ru

Computes x + y rounded up.

add_rz

Computes x + y rounded toward zero.

asin

Computes the element-wise arcsine (inverse sine) of the input tensor.

asinh

Computes the element-wise inverse hyperbolic sine of the input tensor.

atan

Computes the element-wise arctangent (inverse tangent) of the input tensor.

atan2

Computes the arctangent of arg0/arg1, using signs to determine the quadrant.

atanh

Computes the element-wise inverse hyperbolic tangent of the input tensor.

brev

Reverses the bit order of a 32-bit integer.

byte_perm

Selects bytes from two 32-bit integers x and y according to the selector s and returns the combined integer.

cbrt

Computes the cube root of x.

ceil

Rounds x up to the nearest integer.

clz

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

copysign

Creates a value with the magnitude of arg0 and the sign of arg1.

cos

Computes the element-wise cosine of x.

cosh

Computes the element-wise hyperbolic cosine of the input tensor.

cospi

Computes cos(pi * x).

cyl_bessel_i0

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

cyl_bessel_i1

Computes the modified Bessel function of the first kind of order 1.

div_rd

Computes x / y rounded down.

div_rn

Computes x / y rounded to nearest even.

div_ru

Computes x / y rounded up.

div_rz

Computes the division with round-toward-zero mode.

erf

Computes the error function of x.

erfc

Computes the complementary error function of x.

erfcinv

Computes the inverse complementary error function of x.

erfcx

Computes the scaled complementary error function of x.

erfinv

Computes the inverse error function.

exp

Computes e raised to the power x.

exp10

Computes 10 raised to the power x.

exp2

Computes 2 raised to the power x.

expm1

Computes e^x - 1 with better precision for small x.

fast_cosf

Fast approximation of the cosine of x.

fast_dividef

Computes a fast floating-point division.

fast_exp10f

Fast approximation of 10 raised to the power x.

fast_expf

Computes a fast exponential (e^x) of the input tensor.

fast_log10f

Fast approximation of the base-10 logarithm of x.

fast_log2f

Fast approximation of the base-2 logarithm of x.

fast_logf

Fast approximation of the natural logarithm of x.

fast_powf

Fast approximation of x raised to the power y.

fast_sinf

Fast approximation of the sine of x.

fast_tanf

Fast approximation of the tangent of x.

fdim

Computes the positive difference max(x - y, 0).

ffs

Finds the index of the first (least significant) bit set to 1, in the range [0, 32].

finitef

Determines whether x is a finite value.

float2int_rd

Converts x to int32, rounding down.

float2int_rn

Converts x to int32, rounding to nearest even.

float2int_ru

Converts x to int32, rounding up.

float2int_rz

Converts x to int32, rounding toward zero.

float2ll_rd

Converts x to int64, rounding down.

float2ll_rn

Converts x to int64, rounding to nearest even.

float2ll_ru

Converts x to int64, rounding up.

float2ll_rz

Converts x to int64, rounding toward zero.

float2uint_rd

Converts x to uint32, rounding down.

float2uint_rn

Converts x to uint32, rounding to nearest even.

float2uint_ru

Converts x to uint32, rounding up.

float2uint_rz

Converts x to uint32, rounding toward zero.

float2ull_rd

Converts x to uint64, rounding down.

float2ull_rn

Converts x to uint64, rounding to nearest even.

float2ull_ru

Converts x to uint64, rounding up.

float2ull_rz

Converts x to uint64, rounding toward zero.

float_as_int

Reinterprets the bits of a float32 value as an int32.

float_as_uint

Reinterprets the bits of a float32 value as uint32.

floor

Rounds x down to the nearest integer.

fma

Computes x * y + z with a single rounding.

fma_rd

Computes x * y + z with a single rounding, rounded down.

fma_rn

Computes x * y + z with a single rounding, rounded to nearest even.

fma_ru

Computes x * y + z with a single rounding, rounded up.

fma_rz

Computes x * y + z with a single rounding, rounded toward zero.

fmod

Computes the floating-point remainder of arg0 / arg1.

gamma

Computes the Gamma function using the Lanczos approximation.

hadd

Computes the average of x and y.

hypot

Computes the Euclidean distance: sqrt(arg0^2 + arg1^2).

ilogb

Returns the integer binary exponent of the input tensor.

int2float_rd

Converts an int32 value to float32.

int2float_rn

Converts an int32 value to float32.

int2float_ru

Converts an int32 value to float32.

int2float_rz

Converts an int32 value to float32.

int_as_float

Reinterprets the bits of an int32 value as float32.

isinf

Tests whether each element of the input tensor is infinity.

isnan

Tests whether each element of the input tensor is NaN.

j0

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

j1

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

jn

Computes the Bessel function of the first kind of integer order n.

ldexp

Computes x * 2^exp from a mantissa and an exponent.

lgamma

Computes the natural logarithm of the absolute value of the Gamma function.

ll2float_rd

Converts an int64 value to float32.

ll2float_rn

Converts an int64 value to float32.

ll2float_ru

Converts an int64 value to float32.

ll2float_rz

Converts an int64 value to float32.

llrint

Rounds x to the nearest int64 value.

llround

Rounds x to the nearest int64 value.

log

Computes the natural logarithm of x.

log10

Computes the element-wise base-10 logarithm of the input tensor.

log1p

Computes the element-wise natural logarithm of (1 + x).

log2

Computes the base-2 logarithm of x.

logb

Computes the unbiased exponent of x, i.e. floor(log2(|x|)).

mul24

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

mul_rd

Computes x * y rounded down.

mul_rn

Computes x * y rounded to nearest even.

mul_ru

Computes x * y rounded up.

mul_rz

Computes x * y rounded toward zero.

mulhi

Computes the high 32 bits of the product x * y.

nearbyint

Rounds the input tensor to the nearest integer using round-to-nearest-even.

nextafter

Returns the next representable floating-point value after arg0 toward arg1.

norm3d

Computes the Euclidean norm of (x, y, z).

norm4d

Computes the Euclidean norm of (x, y, z, w).

normcdf

Computes the standard normal cumulative distribution function.

normcdfinv

Computes the inverse of the standard normal cumulative distribution function.

popc

Counts the number of bits set to 1 in x, in the range [0, 32].

pow

Computes arg0 raised to the power of arg1.

rcbrt

Computes the reciprocal cube root of x.

rcp_rd

Computes 1 / x rounded down.

rcp_rn

Computes 1 / x rounded to nearest even.

rcp_ru

Computes 1 / x rounded up.

rcp_rz

Computes 1 / x rounded toward zero.

reciprocal

Computes the element-wise reciprocal (1/x) of the input tensor.

relu

Computes the element-wise ReLU activation: max(0, x).

remainder

Computes the IEEE remainder of x / y.

rhadd

Computes the rounded average of x and y.

rhypot

Computes 1 / sqrt(x^2 + y^2).

rint

Rounds the input tensor to the nearest integer using round-to-nearest-even.

rnorm3d

Computes 1 / sqrt(x^2 + y^2 + z^2).

rnorm4d

Computes 1 / sqrt(x^2 + y^2 + z^2 + w^2).

round

Rounds the input tensor to the nearest integer.

rsqrt

Computes the reciprocal square root of x.

rsqrt_rn

Computes the reciprocal square root of x, rounded to nearest even.

sad

Computes |x - y| + z, where x and y are signed integers and z is an unsigned integer.

saturatef

Clamps x to the range [0, 1].

scalbn

Computes x * 2^n.

signbit

Returns the sign bit of the input tensor.

sin

Computes the element-wise sine of x.

sinh

Computes the element-wise hyperbolic sine of the input tensor.

sinpi

Computes sin(pi * x).

sqrt

Computes the square root of x.

sqrt_rd

Computes the square root of x, rounded down.

sqrt_rn

Computes the square root of x, rounded to nearest even.

sqrt_ru

Computes the square root of x, rounded up.

sqrt_rz

Computes the square root of x, rounded toward zero.

sub_rd

Computes x - y rounded down.

sub_rn

Computes x - y rounded to nearest even.

sub_ru

Computes x - y rounded up.

sub_rz

Computes x - y rounded toward zero.

tan

Computes the element-wise tangent of the input tensor.

tanh

Computes the element-wise hyperbolic tangent of the input tensor.

tgamma

Computes the gamma function of x.

trunc

Truncates the input tensor to the nearest integer toward zero.

uint2float_rd

Converts a uint32 value to float32.

uint2float_rn

Converts a uint32 value to float32.

uint2float_ru

Converts a uint32 value to float32.

uint2float_rz

Converts a uint32 value to float32.

uint_as_float

Reinterprets the bits of a uint32 value as float32.

ull2float_rd

Converts a uint64 value to float32.

ull2float_rn

Converts a uint64 value to float32.

ull2float_ru

Converts a uint64 value to float32.

ull2float_rz

Converts a uint64 value to float32.

y0

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

y1

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

yn

Computes the Bessel function of the second kind of integer order n.