Developer Guide and Reference

ID 767253
Date 10/31/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Type Casting Functions for Half-Precision Types

double2half

Description: Converts a double value to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half double2half(double x)

float2half_rd

Description: Converts a float value to a half precision using round-down mode.

Calling Interface:

sycl::half float2half_rd(float x)

float2half_rn

Description: Converts a float value to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half float2half_rn(float x)

float2half_ru

Description: Converts a float value to a half precision using round-up mode.

Calling Interface:

sycl::half float2half_ru(float x)

float2half_rz

Description: Converts a float value to a half precision using round-towards-zero mode.

Calling Interface:

sycl::half float2half_rz(float x)

half2float

Description: Converts a half precision to float.

Calling Interface:

float a half2float(sycl::half x)

half2int_rd

Description: Converts a half precision to a signed int using round-down mode.

Calling Interface:

int a half2int_rd(sycl::half x)

half2int_rn

Description: Converts a half precision to a signed int using round-to-nearest-even mode.

Calling Interface:

int a half2int_rn(sycl::half x)

half2int_ru

Description: Converts a half precision to a signed int using round-up mode.

Calling Interface:

int a half2int_ru(sycl::half x)

half2int_rz

Description: Converts a half precision to a signed int using round-towards-zero mode.

Calling Interface:

int a half2int_rz(sycl::half x)

half2ll_rd

Description: Converts a half precision to a signed 64-bit int using round-down mode.

Calling Interface:

long long a half2ll_rd(sycl::half x)

half2ll_rn

Description: Converts a half precision to a signed 64-bit int using round-to-nearest-even mode.

Calling Interface:

long long a half2ll_rn(sycl::half x)

half2ll_ru

Description: Converts a half precision to a signed 64-bit int using round-up mode.

Calling Interface:

long long a half2ll_ru(sycl::half x))

half2ll_rz

Description: Converts a half precision to a signed 64-bit int using round-towards-zero mode.

Calling Interface:

long long a half2ll_rz(sycl::half x)

half2short_rd

Description: Converts a half precision to a signed short integer using round-down mode.

Calling Interface:

short a half2short_rd(sycl::half x)

half2short_rn

Description: Converts a half precision to a signed short integer using round-to-nearest-even mode.

Calling Interface:

short a half2short_rn(sycl::half x)

half2short_ru

Description: Converts a half precision to a signed short integer using round-up mode.

Calling Interface:

short a half2short_ru(sycl::half x)

half2short_rz

Description: Converts a half precision to a signed short integer using round-towards-zero mode.

Calling Interface:

short a half2short_rz(sycl::half x)

half2uint_rd

Description: Converts a half precision to an unsigned int using round-down mode.

Calling Interface:

unsigned int a half2uint_rd(sycl::half x)

half2uint_rn

Description: Converts a half precision to an unsigned int using round-to-nearest-even mode.

Calling Interface:

unsigned int a half2uint_rn(sycl::half x)

half2uint_ru

Description: Converts a half precision to an unsigned int using round-up mode.

Calling Interface:

unsigned int a half2uint_ru(sycl::half x)

half2uint_rz

Description: Converts a half precision to an unsigned int using round-towards-zero mode.

Calling Interface:

unsigned int a half2uint_rz(sycl::half x)

half2ull_rd

Description: Converts a half precision to an unsigned 64-bit int using round-down mode.

Calling Interface:

unsigned long long a half2ull_rd(sycl::half x)

half2ull_rn

Description: Converts a half precision to an unsigned 64-bit int using round-to-nearest-even mode.

Calling Interface:

unsigned long long a half2ull_rn(sycl::half x)

half2ull_ru

Description: Converts a half precision to an unsigned 64-bit int using round-up mode.

Calling Interface:

unsigned long long a half2ull_ru(sycl::half x)

half2ull_rz

Description: Converts a half precision to an unsigned 64-bit int using round-towards-zero mode.

Calling Interface:

unsigned long long a half2ull_rz(sycl::half x)

half2ushort_rd

Description: Converts a half precision to an unsigned short integer using round-down mode.

Calling Interface:

unsigned short a half2ushort_rd(sycl::half x)

half2ushort_rn

Description: Converts a half precision to an unsigned short integer using round-to-nearest-even mode.

Calling Interface:

unsigned short a half2ushort_rn(sycl::half x)

half2ushort_ru

Description: Converts a half precision to an unsigned short integer using round-up mode.

Calling Interface:

unsigned short a half2ushort_ru(sycl::half x)

half2ushort_rz

Description: Converts a half precision to an unsigned short integer using round-towards-zero mode.

Calling Interface:

unsigned short a half2ushort_rz(sycl::half x)

int2half_rd

Description: Converts a signed int to a half precision using round-down mode.

Calling Interface:

sycl::half int2half_rd(int x)

int2half_rn

Description: Converts a signed int to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half int2half_rn(int x)

int2half_ru

Description: Converts a signed int to a half precision using round-up mode.

Calling Interface:

sycl::half int2half_ru(int x)

int2half_rz

Description: Converts a signed int to a half precision using round-towards-zero mode.

Calling Interface:

sycl::half int2half_rz(int x)

ll2half_rd

Description: Converts a signed 64-bit int to a half precision using round-down mode.

Calling Interface:

sycl::half ll2half_rd(long long x)

ll2half_rn

Description: Converts a signed 64-bit int to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half ll2half_rn(long long x)

ll2half_ru

Description: Converts a signed 64-bit int to a half precision using round-up mode.

Calling Interface:

sycl::half ll2half_ru(long long x)

ll2half_rz

Description: Converts a signed 64-bit int to a half precision using round-towards-zero mode.

Calling Interface:

sycl::half ll2half_rz(long long x)

short2half_rd

Description: Converts a short integer to a half precision using round-down mode.

Calling Interface:

sycl::half short2half_rd(short x)

short2half_rn

Description: Converts a short integer to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half short2half_rn(short x)

short2half_ru

Description: Converts a short integer to a half precision using round-up mode.

Calling Interface:

sycl::half short2half_ru(short x)

short2half_rz

Description: Converts a short integer to a half precision using round-towards-zero mode.

Calling Interface:

sycl::half short2half_rz(short x)

uint2half_rd

Description: Converts an unsigned int to a half precision using round-down mode.

Calling Interface:

sycl::half uint2half_rd(unsigned int x)

uint2half_rn

Description: Converts an unsigned int to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half uint2half_rn(unsigned int x)

uint2half_ru

Description: Converts an unsigned int to a half precision using round-up mode.

Calling Interface:

sycl::half uint2half_ru(unsigned int x)

uint2half_rz

Description: Converts an unsigned int to a half precision using round-towards-zero mode.

Calling Interface:

sycl::half uint2half_rz(unsigned int x)

ull2half_rd

Description: Converts an unsigned 64-bit integer to a half precision using round-down mode.

Calling Interface:

sycl::half ull2half_rd(unsigned long long x)

ull2half_rn

Description: Converts an unsigned 64-bit integer to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half ull2half_rn(unsigned long long x)

ull2half_ru

Description: Converts an unsigned 64-bit integer to a half precision using round-up mode.

Calling Interface:

sycl::half ull2half_ru(unsigned long long x)

ull2half_rz

Description: Converts an unsigned 64-bit integer to a half precision using round-towards-zero mode.

Calling Interface:

sycl::half ull2half_rz(unsigned long long x)

ushort2half_rd

Description: Converts an unsigned short to a half precision using round-down mode.

Calling Interface:

sycl::half ushort2half_rd(unsigned short)

ushort2half_rn

Description: Converts an unsigned short to a half precision using round-to-nearest-even mode.

Calling Interface:

sycl::half ushort2half_rn(unsigned short)

ushort2half_ru

Description: Converts an unsigned short to a half precision using round-up mode.

Calling Interface:

sycl::half ushort2half_ru(unsigned short)

ushort2half_rz

Description: Converts an unsigned short to a half precision using round-towards-zero mode.

Calling Interface:

sycl::half ushort2half_rz(unsigned short)