libdevice User's Guide (PDF) - v10.1.168 (older) - Last updated April 24, 2019 - Send Feedback

## 3.312. __nv_urhadd

Prototype:

    i32 @__nv_urhadd(i32 %x, i32 %y)

Description:

Compute average of unsigned input arguments `x` and `y` as ( `x` + `y` + 1 ) >> 1, avoiding overflow in the intermediate sum.

Returns:

Returns an unsigned integer value representing the unsigned rounded average value of the two inputs.

Library Availability:

Compute 2.0: Yes

Compute 3.0: Yes

Compute 3.5: Yes