Go to the documentation of this file.
20 #include <cudf/utilities/span.hpp>
25 #include <type_traits>
71 template <
typename T = void,
72 CUDF_ENABLE_IF(std::is_same_v<T, void> or is_rep_layout_compatible<T>())>
73 T
const*
head() const noexcept
75 return static_cast<T const*
>(
_data);
90 template <typename T, CUDF_ENABLE_IF(is_rep_layout_compatible<T>())>
91 T
const*
data()
const noexcept
106 template <typename T, CUDF_ENABLE_IF(is_rep_layout_compatible<T>())>
122 template <typename T, CUDF_ENABLE_IF(is_rep_layout_compatible<T>())>
123 T
const*
end()
const noexcept
125 return begin<T>() +
size();
310 #pragma nv_exec_check_disable
312 #pragma nv_exec_check_disable
355 std::vector<column_view>
const& children = {});
365 return _children[child_index];
381 auto child_end() const noexcept {
return _children.cend(); }
391 template <typename T, CUDF_ENABLE_IF(cudf::is_numeric<T>() or
cudf::
is_chrono<T>())>
397 data.size() <
static_cast<std::size_t
>(std::numeric_limits<cudf::size_type>::max()),
398 "Data exceeds the maximum size of a column view.");
412 template <typename T, CUDF_ENABLE_IF(cudf::is_numeric<T>() or
cudf::
is_chrono<T>())>
416 "Device span type must match column view type.");
424 std::vector<column_view> _children{};
495 std::vector<mutable_column_view>
const& children = {});
512 template <
typename T = void,
513 CUDF_ENABLE_IF(std::is_same_v<T, void> or is_rep_layout_compatible<T>())>
516 return const_cast<T*
>(detail::column_view_base::head<T>());
531 template <typename T, CUDF_ENABLE_IF(is_rep_layout_compatible<T>())>
534 return const_cast<T*
>(detail::column_view_base::data<T>());
547 template <typename T, CUDF_ENABLE_IF(is_rep_layout_compatible<T>())>
550 return const_cast<T*
>(detail::column_view_base::begin<T>());
563 template <typename T, CUDF_ENABLE_IF(is_rep_layout_compatible<T>())>
566 return const_cast<T*
>(detail::column_view_base::end<T>());
598 return mutable_children[child_index];
609 auto child_begin() const noexcept {
return mutable_children.begin(); }
614 auto child_end() const noexcept {
return mutable_children.end(); }
626 std::vector<mutable_column_view> mutable_children;
auto child_begin() const noexcept
Returns iterator to the beginning of the ordered sequence of child column-views.
column_view bit_cast(column_view const &input, data_type type)
Zero-copy cast between types with the same size and compatible underlying representations.
size_type num_children() const noexcept
Returns the number of child columns.
size_type is_empty() const noexcept
Returns true if size() returns zero, or false otherwise.
void const * _data
Pointer to device memory containing elements.
std::size_t shallow_hash(column_view const &input)
Computes a hash value from the shallow state of the specified column.
size_type _size
Number of elements.
auto child_begin() const noexcept
Returns iterator to the beginning of the ordered sequence of child column-views.
int32_t size_type
Row index type for columns and tables.
size_type num_children() const noexcept
Returns the number of child columns.
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
size_type offset() const noexcept
Returns the index of the first element relative to the base memory allocation, i.e....
Type declarations for libcudf.
T * begin() const noexcept
Return first element (accounting for offset) when underlying data is casted to the specified type.
bool is_shallow_equivalent(column_view const &lhs, column_view const &rhs)
Uses only shallow state to determine if two column_views view equivalent columns.
friend column_view bit_cast(column_view const &input, data_type type)
Zero-copy cast between types with the same size and compatible underlying representations.
A non-owning, mutable view of device data as a column of elements, some of which may be null as indic...
auto child_end() const noexcept
Returns iterator to the end of the ordered sequence of child column-views.
T * data() const noexcept
Returns the underlying data casted to the specified type, plus the offset.
uint32_t bitmask_type
Bitmask type stored as 32-bit unsigned integer.
size_type null_count(size_type begin, size_type end) const
Returns the count of null elements in the range [begin, end)
#define CUDF_ENABLE_IF(...)
Convenience macro for SFINAE as an unnamed template parameter.
A non-owning, immutable view of device data as a column of elements, some of which may be null as ind...
column_view(data_type type, size_type size, void const *data, bitmask_type const *null_mask=nullptr, size_type null_count=UNKNOWN_NULL_COUNT, size_type offset=0, std::vector< column_view > const &children={})
Construct a column_view from pointers to device memory for the elements and bitmask of the column.
mutable_column_view(data_type type, size_type size, void *data, bitmask_type *null_mask=nullptr, size_type null_count=cudf::UNKNOWN_NULL_COUNT, size_type offset=0, std::vector< mutable_column_view > const &children={})
Construct a mutable_column_view from pointers to device memory for the elements and bitmask of the co...
auto child_end() const noexcept
Returns iterator to the end of the ordered sequence of child column-views.
size_type count_descendants(column_view parent)
Counts the number of descendants of the specified parent.
size_type null_count() const
Returns the count of null elements.
bitmask_type * null_mask() const noexcept
Returns raw pointer to the underlying bitmask allocation.
column_view_base(data_type type, size_type size, void const *data, bitmask_type const *null_mask=nullptr, size_type null_count=UNKNOWN_NULL_COUNT, size_type offset=0)
Construct a column_view_base from pointers to device memory for the elements and bitmask of the colum...
Indicator for the logical data type of an element in a column.
mutable_column_view child(size_type child_index) const noexcept
Returns a reference to the specified child.
bool has_nulls() const
Indicates if the column contains null elements, i.e., null_count() > 0
T * head() const noexcept
Returns pointer to the base device memory allocation casted to the specified type.
bool nullable() const noexcept
Indicates if the column can contain null elements, i.e., if it has an allocated bitmask.
constexpr bool is_chrono()
Indicates whether the type T is a chrono type.
T const * data() const noexcept
Returns the underlying data casted to the specified type, plus the offset.
void set_null_count(size_type new_null_count)
Set the null count.
data_type type() const noexcept
Returns the element data_type
#define CUDF_EXPECTS(cond, reason)
Macro for checking (pre-)conditions that throws an exception when a condition is violated.
T const * begin() const noexcept
Return first element (accounting for offset) after underlying data is casted to the specified type.
T const * end() const noexcept
Return one past the last element after underlying data is casted to the specified type.
bitmask_type const * _null_mask
bool has_nulls(size_type begin, size_type end) const
Indicates if the column contains null elements in the range [begin, end), i.e., null_count(begin,...
size_type size() const noexcept
Returns the number of elements in the column.
column_view child(size_type child_index) const noexcept
Returns the specified child.
Defines the mapping between cudf::type_id runtime type information and concrete C++ types.
friend mutable_column_view bit_cast(mutable_column_view const &input, data_type type)
Zero-copy cast between types with the same size and compatible underlying representations.
T const * head() const noexcept
Returns pointer to the base device memory allocation casted to the specified type.
T * end() const noexcept
Return one past the last element after underlying data is casted to the specified type.
bitmask_type const * null_mask() const noexcept
Returns raw pointer to the underlying bitmask allocation.
data_type _type
Element type.
size_type _null_count
The number of null elements.