Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 6/24/2024
Public

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

Document Table of Contents

v?Round

Computes a value rounded to the nearest integer for each vector element.

Syntax

vhRound( n, a, y );

vhRoundI(n, a, inca, y, incy);

vmhRound( n, a, y, mode );

vmhRoundI(n, a, inca, y, incy, mode);

vsRound( n, a, y );

vsRoundI(n, a, inca, y, incy);

vmsRound( n, a, y, mode );

vmsRoundI(n, a, inca, y, incy, mode);

vdRound( n, a, y );

vdRoundI(n, a, inca, y, incy);

vmdRound( n, a, y, mode );

vmdRoundI(n, a, inca, y, incy, mode);

Include Files

  • mkl.h

Input Parameters

Name

Type

Description

n

const MKL_INT

Specifies the number of elements to be calculated.

a

const _Float16* for vhRound, vmhRound

const float* for vsRound, vmsRound

const double* for vdRound, vmdRound

Pointer to an array that contains the input vector a.

inca, incy

const MKL_INT

Specifies increments for the elements of a and y.

mode

const MKL_INT64

Overrides global VM mode setting for this function call. See vmlSetMode for possible values and their description.

Output Parameters

Name

Type

Description

y

_Float16* for vhRound, vmhRound

float* for vsRound, vmsRound

double* for vdRound, vmdRound

Pointer to an array that contains the output vector y.

Description

The function computes a value rounded to the nearest integer for each vector element. Input elements that are halfway between two consecutive integers are always rounded away from zero regardless of the rounding mode.

Special Values for Real Function v?Round(x)
Argument Result Exception
+0 +0  
-0 -0  
+ +  
- -  
SNAN QNAN INVALID
QNAN QNAN