An owning class to represent a singular value. More...
#include <scalar.hpp>
Public Member Functions | |
scalar (scalar &&other)=default | |
scalar (scalar const &other)=default | |
scalar & | operator= (scalar const &other)=delete |
scalar & | operator= (scalar &&other)=delete |
data_type | type () const noexcept |
Returns the scalar's logical value type. | |
void | set_valid (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 Member Functions | |
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... | |
Protected Attributes | |
data_type | _type {type_id::EMPTY} |
Logical type of value in the scalar. | |
rmm::device_scalar< bool > | _is_valid {} |
Device bool signifying validity. | |
An owning class to represent a singular value.
A scalar is a singular value of any of the supported datatypes in cudf. Classes derived from this class are used to represent a scalar. Objects of derived classes should be upcasted to this class while passing to an external libcudf API.
Definition at line 51 of file scalar.hpp.
|
inlineprotected |
Construct a new scalar object.
[in] | type | Data type of the scalar |
[in] | is_valid | Whether the value held by the scalar is valid |
[in] | stream | CUDA stream used for device memory operations. |
[in] | mr | Device memory resource to use for device memory allocation |
Definition at line 116 of file scalar.hpp.
|
inline |
Indicates whether the scalar contains a valid value.
is_valid() == false
is undefined behaviourstream | CUDA stream used for device memory operations. |
Definition at line 84 of file scalar.hpp.
|
inline |
Updates the validity of the value.
is_valid | true: set the value to valid. false: set it to null |
stream | CUDA stream used for device memory operations. |
Definition at line 70 of file scalar.hpp.