Public Types | Public Member Functions | Protected Attributes | List of all members
cudf::fixed_point_scalar< T > Class Template Reference

An owning class to represent a fixed_point number in device memory. More...

#include <scalar.hpp>

Inheritance diagram for cudf::fixed_point_scalar< T >:
cudf::scalar

Public Types

using rep_type = typename T::rep
 
using value_type = T
 

Public Member Functions

 fixed_point_scalar (fixed_point_scalar &&other)=default
 
fixed_point_scalaroperator= (fixed_point_scalar const &other)=delete
 
fixed_point_scalaroperator= (fixed_point_scalar &&other)=delete
 
 fixed_point_scalar (fixed_point_scalar const &other, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed_point scalar object by deep copying another. More...
 
 fixed_point_scalar (rep_type value, numeric::scale_type scale, bool is_valid=true, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed_point scalar object from already shifted value and scale. More...
 
 fixed_point_scalar (rep_type value, bool is_valid=true, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed_point scalar object from a value and default 0-scale. More...
 
 fixed_point_scalar (T value, bool is_valid=true, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed_point scalar object from a fixed_point number. More...
 
 fixed_point_scalar (rmm::device_scalar< rep_type > &&data, numeric::scale_type scale, bool is_valid=true, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed_point scalar object from existing device memory. More...
 
rep_type value (rmm::cuda_stream_view stream=rmm::cuda_stream_default) const
 Get the value of the scalar. More...
 
fixed_point_value (rmm::cuda_stream_view stream=rmm::cuda_stream_default) const
 Get the decimal32, decimal64 or decimal128. More...
 
 operator value_type () const
 Explicit conversion operator to get the value of the scalar on the host.
 
rep_type * data ()
 Returns a raw pointer to the value in device memory.
 
rep_type const * data () const
 Returns a const raw pointer to the value in device memory.
 
- Public Member Functions inherited from cudf::scalar
scalaroperator= (scalar const &other)=delete
 
scalaroperator= (scalar &&other)=delete
 
data_type type () const noexcept
 Returns the scalar's logical value type.
 
void set_valid_async (bool is_valid, rmm::cuda_stream_view stream=rmm::cuda_stream_default)
 Updates the validity of the value. More...
 
bool is_valid (rmm::cuda_stream_view stream=rmm::cuda_stream_default) const
 Indicates whether the scalar contains a valid value. More...
 
bool * validity_data ()
 Returns a raw pointer to the validity bool in device memory.
 
bool const * validity_data () const
 Returns a const raw pointer to the validity bool in device memory.
 

Protected Attributes

rmm::device_scalar< rep_type > _data
 device memory containing the value
 
- Protected Attributes inherited from cudf::scalar
data_type _type {type_id::EMPTY}
 Logical type of value in the scalar.
 
rmm::device_scalar< bool > _is_valid
 Device bool signifying validity.
 

Additional Inherited Members

- Protected Member Functions inherited from cudf::scalar
 scalar (scalar &&other)=default
 
 scalar (scalar const &other, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new scalar object by deep copying another. More...
 
 scalar (data_type type, bool is_valid=false, rmm::cuda_stream_view stream=rmm::cuda_stream_default, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new scalar object. More...
 

Detailed Description

template<typename T>
class cudf::fixed_point_scalar< T >

An owning class to represent a fixed_point number in device memory.

Template Parameters
Tthe data type of the fixed_point number.

Definition at line 273 of file scalar.hpp.

Constructor & Destructor Documentation

◆ fixed_point_scalar() [1/5]

template<typename T >
cudf::fixed_point_scalar< T >::fixed_point_scalar ( fixed_point_scalar< T > const &  other,
rmm::cuda_stream_view  stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Construct a new fixed_point scalar object by deep copying another.

Parameters
otherThe scalar to copy.
streamCUDA stream used for device memory operations.
mrDevice memory resource to use for device memory allocation.

◆ fixed_point_scalar() [2/5]

template<typename T >
cudf::fixed_point_scalar< T >::fixed_point_scalar ( rep_type  value,
numeric::scale_type  scale,
bool  is_valid = true,
rmm::cuda_stream_view  stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Construct a new fixed_point scalar object from already shifted value and scale.

Parameters
valueThe initial shifted value of the fixed_point scalar.
scaleThe scale of the fixed_point scalar.
is_validWhether the value held by the scalar is valid.
streamCUDA stream used for device memory operations.
mrDevice memory resource to use for device memory allocation.

◆ fixed_point_scalar() [3/5]

template<typename T >
cudf::fixed_point_scalar< T >::fixed_point_scalar ( rep_type  value,
bool  is_valid = true,
rmm::cuda_stream_view  stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Construct a new fixed_point scalar object from a value and default 0-scale.

Parameters
valueThe initial value of the fixed_point scalar.
is_validWhether the value held by the scalar is valid.
streamCUDA stream used for device memory operations.
mrDevice memory resource to use for device memory allocation.

◆ fixed_point_scalar() [4/5]

template<typename T >
cudf::fixed_point_scalar< T >::fixed_point_scalar ( value,
bool  is_valid = true,
rmm::cuda_stream_view  stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Construct a new fixed_point scalar object from a fixed_point number.

Parameters
valueThe fixed_point number from which the fixed_point scalar will be initialized.
is_validWhether the value held by the scalar is valid.
streamCUDA stream used for device memory operations.
mrDevice memory resource to use for device memory allocation.

◆ fixed_point_scalar() [5/5]

template<typename T >
cudf::fixed_point_scalar< T >::fixed_point_scalar ( rmm::device_scalar< rep_type > &&  data,
numeric::scale_type  scale,
bool  is_valid = true,
rmm::cuda_stream_view  stream = rmm::cuda_stream_default,
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Construct a new fixed_point scalar object from existing device memory.

Parameters
dataThe scalar's data in device memory.
scaleThe scale of the fixed_point scalar.
is_validWhether the value held by the scalar is valid.
streamCUDA stream used for device memory operations.
mrDevice memory resource to use for device memory allocation.

Member Function Documentation

◆ fixed_point_value()

template<typename T >
T cudf::fixed_point_scalar< T >::fixed_point_value ( rmm::cuda_stream_view  stream = rmm::cuda_stream_default) const

Get the decimal32, decimal64 or decimal128.

Parameters
streamCUDA stream used for device memory operations.

◆ value()

template<typename T >
rep_type cudf::fixed_point_scalar< T >::value ( rmm::cuda_stream_view  stream = rmm::cuda_stream_default) const

Get the value of the scalar.

Parameters
streamCUDA stream used for device memory operations.

The documentation for this class was generated from the following file: