/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipcub/checkouts/docs-5.7.0/hipcub/include/hipcub/backend/rocprim/util_math.hpp File Reference

/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipcub/checkouts/docs-5.7.0/hipcub/include/hipcub/backend/rocprim/util_math.hpp File Reference#

hipCUB: /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-hipcub/checkouts/docs-5.7.0/hipcub/include/hipcub/backend/rocprim/util_math.hpp File Reference
util_math.hpp File Reference

Go to the source code of this file.

Functions

template<typename T >
constexpr BEGIN_HIPCUB_NAMESPACE __device__ __host__ T MidPoint (T begin, T end)
 Computes the midpoint of the integers. More...
 

Detailed Description

Define helper math functions.

Function Documentation

◆ MidPoint()

template<typename T >
constexpr BEGIN_HIPCUB_NAMESPACE __device__ __host__ T MidPoint ( begin,
end 
)
constexpr

Computes the midpoint of the integers.

Extra operation is performed in order to prevent overflow.

Returns
Half the sum of begin and end