19 #include <cudf/fixed_point/detail/floating_conversion.hpp>
23 #include <cudf/utilities/export.hpp>
29 namespace CUDF_EXPORT
cudf {
51 template <
typename Fixed,
53 CUDF_ENABLE_IF(cuda::std::is_floating_point_v<Floating>&& is_fixed_point<Fixed>())>
56 using Rep =
typename Fixed::rep;
57 auto const value = [&]() {
58 if constexpr (Fixed::rad == numeric::Radix::BASE_10) {
59 return numeric::detail::convert_floating_to_integral<Rep>(floating, scale);
61 return static_cast<Rep
>(numeric::detail::shift<Rep, Fixed::rad>(floating, scale));
81 template <
typename Floating,
83 CUDF_ENABLE_IF(cuda::std::is_floating_point_v<Floating>&& is_fixed_point<Fixed>())>
86 using Rep =
typename Fixed::rep;
87 if constexpr (Fixed::rad == numeric::Radix::BASE_10) {
88 return numeric::detail::convert_integral_to_floating<Floating>(fixed.value(), fixed.scale());
90 auto const casted =
static_cast<Floating
>(fixed.value());
92 return numeric::detail::shift<Rep, Fixed::rad>(casted, scale);
104 template <
typename Floating,
109 if constexpr (is_fixed_point<Input>()) {
110 return convert_fixed_to_floating<Floating>(input);
112 return static_cast<Floating
>(input);
一个非拥有、不可变的设备数据视图,作为元素列,其中一些可能为空...
rmm::cuda_stream_view const get_default_stream()
获取当前的默认流。
scale_type
fixed_point 的比例类型。
rmm::device_async_resource_ref get_current_device_resource_ref()
获取当前设备内存资源引用。
cuda::mr::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
#define CUDF_ENABLE_IF(...)
用于 SFINAE 作为无名模板参数的便利宏。
构造 fixed_point 的辅助结构,当值已移位时使用。
#define CUDF_HOST_DEVICE
指示函数或方法可在主机和设备上使用。