syclreference.com
  1. SYCL
  2. | API Reference
  3. | Built-Ins
  4. | fast_normalize

fast_normalize

Returns a vector in the same direction as p but with a length of 1. fast_normalize is computed as: p * rsqrt((half)(pow(p.x, 2) + pow(p.y, 2) + ...)).


template <typename F, typename return_t, detail::enable_if_t<(computecpp::gsl::or_<detail::builtin::is_gengeohalf<F>::value, detail::builtin::is_gengeofloat<F>::value>::value), int> >
return_t fast_normalize(F p)
(1)
  1. Returns a vector in the same direction as p but with a length of 1. fast_normalize is computed as: `p * rsqrt((half)(pow(p.x, 2) + pow(p.y, 2) + ...))`.
    Parameters:
    • F p

syclreference.com — SYCL Reference Pages

Last updated: 2019-01-24 00:24:52 +0000