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

An owning class to represent a timestamp value in device memory. More...

#include <scalar.hpp>

Inheritance diagram for cudf::timestamp_scalar< T >:
cudf::chrono_scalar< T > cudf::detail::fixed_width_scalar< T > cudf::scalar

Public Types

using rep_type = typename T::rep
 The underlying representation type of the timestamp.
 
- Public Types inherited from cudf::detail::fixed_width_scalar< T >
using value_type = T
 Type of the value held by the scalar.
 

Public Member Functions

 timestamp_scalar (timestamp_scalar &&other)=default
 Move constructor for timestamp_scalar. More...
 
 timestamp_scalar (timestamp_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new timestamp scalar object by deep copying another. More...
 
template<typename Duration2 >
 timestamp_scalar (Duration2 const &value, bool is_valid, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new timestamp scalar object from a duration that is convertible to T::duration. More...
 
rep_type ticks_since_epoch (rmm::cuda_stream_view stream)
 Returns the duration in number of ticks since the UNIX epoch. More...
 
- Public Member Functions inherited from cudf::chrono_scalar< T >
 chrono_scalar (chrono_scalar &&other)=default
 Move constructor for chrono_scalar. More...
 
chrono_scalaroperator= (chrono_scalar const &other)=delete
 
chrono_scalaroperator= (chrono_scalar &&other)=delete
 
 chrono_scalar (chrono_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new chrono scalar object by deep copying another. More...
 
 chrono_scalar (T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new chrono scalar object. More...
 
 chrono_scalar (rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new chrono scalar object from existing device memory. More...
 
- Public Member Functions inherited from cudf::detail::fixed_width_scalar< T >
 fixed_width_scalar (fixed_width_scalar &&other)=default
 Move constructor for fixed_width_scalar. More...
 
fixed_width_scalaroperator= (fixed_width_scalar const &other)=delete
 
fixed_width_scalaroperator= (fixed_width_scalar &&other)=delete
 
 fixed_width_scalar (fixed_width_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed-width scalar object by deep copying another. More...
 
void set_value (T value, rmm::cuda_stream_view stream=cudf::get_default_stream())
 Set the value of the scalar. More...
 
 operator value_type () const
 Explicit conversion operator to get the value of the scalar on the host.
 
value (rmm::cuda_stream_view stream=cudf::get_default_stream()) const
 Get the value of the scalar. More...
 
T * data ()
 Returns a raw pointer to the value in device memory. More...
 
T const * data () const
 Returns a const raw pointer to the value in device memory. More...
 
- 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. More...
 
void set_valid_async (bool is_valid, rmm::cuda_stream_view stream=cudf::get_default_stream())
 Updates the validity of the value. More...
 
bool is_valid (rmm::cuda_stream_view stream=cudf::get_default_stream()) const
 Indicates whether the scalar contains a valid value. More...
 
bool * validity_data ()
 Returns a raw pointer to the validity bool in device memory. More...
 
bool const * validity_data () const
 Return a const raw pointer to the validity bool in device memory. More...
 

Additional Inherited Members

- Protected Member Functions inherited from cudf::detail::fixed_width_scalar< T >
 fixed_width_scalar (T value, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed width scalar object. More...
 
 fixed_width_scalar (rmm::device_scalar< T > &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new fixed width scalar object from existing device memory. More...
 
- Protected Member Functions inherited from cudf::scalar
 scalar (scalar &&other)=default
 Move constructor for scalar. More...
 
 scalar (scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), 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=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
 Construct a new scalar object. More...
 
- Protected Attributes inherited from cudf::detail::fixed_width_scalar< T >
rmm::device_scalar< T > _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.
 

Detailed Description

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

An owning class to represent a timestamp value in device memory.

Template Parameters
Tthe data type of the timestamp value.
See also
cudf/wrappers/timestamps.hpp for a list of allowed types.

Definition at line 624 of file scalar.hpp.

Constructor & Destructor Documentation

◆ timestamp_scalar() [1/3]

template<typename T >
cudf::timestamp_scalar< T >::timestamp_scalar ( timestamp_scalar< T > &&  other)
default

Move constructor for timestamp_scalar.

Parameters
otherThe other timestamp_scalar to move from.

◆ timestamp_scalar() [2/3]

Construct a new timestamp 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.

◆ timestamp_scalar() [3/3]

template<typename T >
template<typename Duration2 >
cudf::timestamp_scalar< T >::timestamp_scalar ( Duration2 const &  value,
bool  is_valid,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource mr = rmm::mr::get_current_device_resource() 
)

Construct a new timestamp scalar object from a duration that is convertible to T::duration.

Parameters
valueDuration representing number of ticks since the UNIX epoch or another duration that is convertible to timestamps duration.
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

◆ ticks_since_epoch()

template<typename T >
rep_type cudf::timestamp_scalar< T >::ticks_since_epoch ( rmm::cuda_stream_view  stream)

Returns the duration in number of ticks since the UNIX epoch.

Parameters
streamCUDA stream used for device memory operations.
Returns
The duration in number of ticks since the UNIX epoch

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