[FEA] Construct scalar by moving a free buffer #8427
Labels
feature request
New feature or request
improvement
Improvement / enhancement to an existing function
libcudf
Affects libcudf (C++/CUDA) code.
non-breaking
Non-breaking change
Currently, scalar objects are constructed by some ways such as copying from another scalar object, or constructed by copying data from a representative object (for example, a string scalar can be constructed from a string_view). However, they (scalars) cannot be constructed from an orphaned buffer. Sometimes, we may want to create a scalar from some computation, which results in a large buffer (especially
string_scalar
), but we can only construct a scalar by copying that buffer into the scalar internal buffer. This is a waste of resources.Solution: Add constructors for some scalar classes (such as
string_scalar
) that accept a free buffer and move it into the internal buffer.The text was updated successfully, but these errors were encountered: