An owning class to represent a string in device memory. More...
#include <scalar.hpp>
Public Types | |
using | value_type = cudf::string_view |
The value type of the string scalar. | |
Public Member Functions | |
string_scalar (string_scalar &&other)=default | |
Move constructor for string_scalar. More... | |
string_scalar & | operator= (string_scalar const &other)=delete |
string_scalar & | operator= (string_scalar &&other)=delete |
string_scalar (string_scalar const &other, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new string scalar object by deep copying another string_scalar. More... | |
string_scalar (std::string const &string, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new string scalar object. More... | |
string_scalar (value_type const &source, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new string scalar object from string_view. More... | |
string_scalar (rmm::device_scalar< value_type > &data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new string scalar object from string_view in device memory. More... | |
string_scalar (rmm::device_buffer &&data, bool is_valid=true, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new string scalar object by moving an existing string data buffer. More... | |
operator std::string () const | |
Explicit conversion operator to get the value of the scalar in a host std::string. | |
std::string | to_string (rmm::cuda_stream_view stream=cudf::get_default_stream()) const |
Get the value of the scalar in a host std::string. More... | |
value_type | value (rmm::cuda_stream_view stream=cudf::get_default_stream()) const |
Get the value of the scalar as a string_view. More... | |
size_type | size () const |
Returns the size of the string in bytes. More... | |
char const * | data () const |
Returns a raw pointer to the string in device memory. More... | |
Public Member Functions inherited from cudf::scalar | |
scalar & | operator= (scalar const &other)=delete |
scalar & | operator= (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... | |
Protected Attributes | |
rmm::device_buffer | _data {} |
device memory containing the string | |
Protected Attributes inherited from cudf::scalar | |
data_type | _type {type_id::EMPTY} |
Logical type of value in the scalar. | |
cudf::detail::device_scalar< bool > | _is_valid |
Device bool signifying validity. | |
Additional Inherited Members | |
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::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
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::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) | |
Construct a new scalar object. More... | |
An owning class to represent a string in device memory.
Definition at line 429 of file scalar.hpp.
|
default |
Move constructor for string_scalar.
other | The other string_scalar to move from. |
cudf::string_scalar::string_scalar | ( | string_scalar const & | other, |
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Construct a new string scalar object by deep copying another string_scalar.
other | The other string_scalar to copy. |
stream | CUDA stream used for device memory operations. |
mr | Device memory resource to use for device memory allocation. |
cudf::string_scalar::string_scalar | ( | std::string const & | string, |
bool | is_valid = true , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Construct a new string scalar object.
std::overflow_error | If the size of the input string exceeds cudf::size_type |
string | The value of the string. |
is_valid | Whether the value held by the scalar is valid. |
stream | CUDA stream used for device memory operations. |
mr | Device memory resource to use for device memory allocation. |
cudf::string_scalar::string_scalar | ( | value_type const & | source, |
bool | is_valid = true , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Construct a new string scalar object from string_view.
Note that this function copies the data pointed by string_view.
source | The string_view pointing the string value to copy. |
is_valid | Whether the value held by the scalar is valid. |
stream | CUDA stream used for device memory operations. |
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 = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Construct a new string scalar object from string_view in device memory.
Note that this function copies the data pointed by string_view.
data | The device_scalar of string_view pointing to the string value to copy. |
is_valid | Whether the value held by the scalar is valid. |
stream | CUDA stream used for device memory operations. |
mr | Device memory resource to use for device memory allocation. |
cudf::string_scalar::string_scalar | ( | rmm::device_buffer && | data, |
bool | is_valid = true , |
||
rmm::cuda_stream_view | stream = cudf::get_default_stream() , |
||
rmm::device_async_resource_ref | mr = cudf::get_current_device_resource_ref() |
||
) |
Construct a new string scalar object by moving an existing string data buffer.
Note that this constructor moves the existing buffer into the internal data buffer; no copy is performed.
data | The existing buffer to take over. |
is_valid | Whether the value held by the scalar is valid. |
stream | CUDA stream used for device memory operations. |
mr | Device memory resource to use for device memory allocation. |
char const* cudf::string_scalar::data | ( | ) | const |
Returns a raw pointer to the string in device memory.
size_type cudf::string_scalar::size | ( | ) | const |
Returns the size of the string in bytes.
std::string cudf::string_scalar::to_string | ( | rmm::cuda_stream_view | stream = cudf::get_default_stream() | ) | 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 = cudf::get_default_stream() | ) | const |
Get the value of the scalar as a string_view.
stream | CUDA stream used for device memory operations. |