1- .. _libcudacxx-extended-api-numeric-saturating_overflow_cast :
1+ .. _libcudacxx-extended-api-numeric-saturate_overflow_cast :
22
33``cuda::overflow_cast ``
44==========================
1010
1111 template <class To, class From>
1212 [[nodiscard]] __host__ __device__ inline constexpr
13- overflow_result<To> saturating_overflow_cast (From from) noexcept;
13+ overflow_result<To> saturate_overflow_cast (From from) noexcept;
1414
15- The function ``cuda::saturating_overflow_cast `` does saturating cast of a value of type ``From `` to type ``To `` with overflow checking.
15+ The function ``cuda::saturate_overflow_cast `` does saturating cast of a value of type ``From `` to type ``To `` with overflow checking.
1616
1717**Parameters **
1818
@@ -40,7 +40,7 @@ Example
4040 constexpr auto int_max = cuda::std::numeric_limits<int>::max();
4141 constexpr auto int_min = cuda::std::numeric_limits<int>::min();
4242
43- if (auto result = cuda::saturating_overflow_cast <unsigned>(int_max))
43+ if (auto result = cuda::saturate_overflow_cast <unsigned>(int_max))
4444 {
4545 assert(false); // Should not be reached
4646 }
@@ -49,7 +49,7 @@ Example
4949 assert(result.value == static_cast<unsigned>(int_max));
5050 }
5151
52- if (auto result = cuda::saturating_overflow_cast <unsigned>(int_min)) // saturated
52+ if (auto result = cuda::saturate_overflow_cast <unsigned>(int_min)) // saturated
5353 {
5454 assert(result.value == 0);
5555 }
@@ -65,4 +65,4 @@ Example
6565 cudaDeviceSynchronize();
6666 }
6767
68- `See it on Godbolt 🔗 <https://godbolt.org/z/qfojv7bYb >`_
68+ `See it on Godbolt 🔗 <https://godbolt.org/z/oKW81Eajx >`_
0 commit comments