An owning class to represent a string in device memory. More...
#include <scalar.hpp>
Public Types | |
using | value_type = cudf::string_view |
Public Member Functions | |
string_scalar (string_scalar &&other)=default | |
string_scalar (string_scalar const &other)=default | |
string_scalar & | operator= (string_scalar const &other)=delete |
string_scalar & | operator= (string_scalar &&other)=delete |
string_scalar (std::string const &string, 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 string scalar object. More... | |
string_scalar (value_type const &source, 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 string scalar object from string_view Note that this function copies the data pointed by string_view. More... | |
string_scalar (rmm::device_scalar< value_type > &data, 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 string scalar object from string_view in device memory Note that this function copies the data pointed by string_view. More... | |
operator std::string () const | |
Implicit conversion operator to get the value of the scalar in a host std::string. | |
std::string | to_string (rmm::cuda_stream_view stream=rmm::cuda_stream_default) const |
Get the value of the scalar in a host std::string. More... | |
value_type | value (rmm::cuda_stream_view stream=rmm::cuda_stream_default) const |
Get the value of the scalar as a string_view. More... | |
size_type | size () const |
Returns the size of the string in bytes. | |
const char * | data () const |
Returns a raw pointer to the string in device memory. | |
![]() | |
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 Attributes | |
rmm::device_buffer | _data {} |
device memory containing the string | |
![]() | |
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 | |
![]() | |
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... | |
An owning class to represent a string in device memory.
Definition at line 394 of file scalar.hpp.
|
inline |
Construct a new string scalar object.
[in] | value | The value of the string |
[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 413 of file scalar.hpp.
cudf::string_scalar::string_scalar | ( | value_type const & | source, |
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 string scalar object from string_view Note that this function copies the data pointed by string_view.
[in] | source | string_view pointing string value to copy |
[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 |
cudf::string_scalar::string_scalar | ( | rmm::device_scalar< value_type > & | data, |
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 string scalar object from string_view in device memory Note that this function copies the data pointed by string_view.
[in] | data | device_scalar string_view pointing string value to copy |
[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 |
std::string cudf::string_scalar::to_string | ( | rmm::cuda_stream_view | stream = rmm::cuda_stream_default | ) | const |
Get the value of the scalar in a host std::string.
stream | CUDA stream used for device memory operations. |
value_type cudf::string_scalar::value | ( | rmm::cuda_stream_view | stream = rmm::cuda_stream_default | ) | const |
Get the value of the scalar as a string_view.
stream | CUDA stream used for device memory operations. |