Developer Guide and Reference

ID 767253
Date 10/31/2024
Public
Document Table of Contents

Simple Half-Precision Arithmetic Math Functions

hadd

Description: A half precision value addition.

Calling Interface:

sycl::half hadd(sycl::half x, sycl::half y)

hadd_sat

Description: A half precision value addition with saturation to [0.0, 1.0].

Calling Interface:

sycl::half hadd_sat(sycl::half x, sycl::half y)

hfma

Description: Performs a fused multiply-add operation for half precision.

Calling Interface:

sycl::half hfma(sycl::half x, sycl::half y, sycl::half z)

hfma_sat

Description: Performs a fused multiply-add operation for half precision with saturation to [0.0, 1.0].

Calling Interface:

sycl::half hfma_sat(sycl::half x, sycl::half y, sycl::half z)

hfma_relu

Description: Performs a fused multiply-add operation for half precision; a negative result is clamped to 0.

Calling Interface:

sycl::half hfma_relu(sycl::half x, sycl::half y, sycl::half z)

hmul

Description: A half precision value multiplication.

Calling Interface:

sycl::half hmul(sycl::half x, sycl::half y)

hmul_sat

Description: A half precision value multiplication with saturation to [0.0, 1.0].

Calling Interface:

sycl::half hmul_sat(sycl::half x, sycl::half y)

hdiv

Description: A half precision value division.

Calling Interface:

sycl::half hdiv(sycl::half x, sycl::half y)

hsub

Description: A half precision value subtraction.

Calling Interface:

sycl::half hsub(sycl::half x, sycl::half y)

hsub_sat

Description: A half precision value subtraction with saturation to [0.0, 1.0].

Calling Interface:

sycl::half hsub_sat(sycl::half x, sycl::half y)

hneg

Description: Negates the input half precision value and returns the result.

Calling Interface:

sycl::half hneg(sycl::half x)

hadd2

Description: Performs an element-wise half precision addition for sycl::half2.

Calling Interface:

sycl::half2 hadd2(sycl::half2 x, sycl::half2 y)

hadd2_sat

Description: Performs an element-wise half precision addition with saturation to [0.0, 1.0] sycl::half2.

Calling Interface:

sycl::half2 hadd2_sat(sycl::half2 x, sycl::half2 y)

hfma2

Description: Performs an element-wise fused multiply-add operation for sycl::half2.

Calling Interface:

sycl::half2 hfma2(sycl::half2 x, sycl::half2 y, sycl::half2 z)

hfma2_sat

Description: Performs an element-wise fused multiply-add operation with saturation to [0.0, 1.0] for sycl::half2.

Calling Interface:

sycl::half2 hfma2_sat(sycl::half2 x, sycl::half2 y, sycl::half2 z)

hfma2_relu

Description: Performs an element-wise fused multiply-add operation for sycl::half2, negative results are clamped to 0.

Calling Interface:

sycl::half2 hfma2_relu(sycl::half2 x, sycl::half2 y, sycl::half2 z)

hmul2

Description: Performs an element-wise half precision multiplication for sycl::half2.

Calling Interface:

sycl::half2 hmul2(sycl::half2 x, sycl::half2 y)

hmul2_sat

Description: Performs an element-wise half precision multiplication with saturation to [0.0, 1.0] for sycl::half2.

Calling Interface:

sycl::half2 hmul2_sat(sycl::half2 x, sycl::half2 y)

h2div

Description: Performs an element-wise half precision division for sycl::half2.

Calling Interface:

sycl::half2 h2div(sycl::half2 x, sycl::half2 y)

hneg2

Description: Negates each element of the input for sycl::half2 and returns the result.

Calling Interface:

sycl::half2 hneg2(sycl::half2 x)

hsub2

Description: Performs an element-wise half precision subtraction for sycl::half2.

Calling Interface:

sycl::half2 hsub2(sycl::half2 x, sycl::half2 y)

hsub2_sat

Description: Performs an element-wise half precision subtractions with saturation to [0.0, 1.0] for sycl::half2.

Calling Interface:

sycl::half2 hsub2_sat(sycl::half2 x, sycl::half2 y)

hcmadd

Description: For sycl::half2 with inputs x, y, z, that each includes two half precision element x0, x1, y0, y1, z0, and z1. Example:

sycl::half c0 = x0 * y0 - x1 * y1 + z0;
sycl::half c1 = x0 * y1 + x1 * y0 + z1;
return sycl::half2{c0, c1};

Calling Interface:

sycl::half2 hcmadd(sycl::half2 x, sycl::half2 y, sycl::half2 z)