设备数据的可变、非拥有的视图,表示为元素列,易于复制且可在 CUDA 设备代码中使用。更多...
公共类型 | |
using | count_it = thrust::counting_iterator< size_type > |
计数迭代器。 | |
template<typename T > | |
using | iterator = thrust::transform_iterator< detail::mutable_value_accessor< T >, count_it > |
用于遍历此列的迭代器。 | |
公共成员函数 | |
mutable_column_device_view (mutable_column_device_view const &)=default | |
拷贝构造函数。 | |
mutable_column_device_view (mutable_column_device_view &&)=default | |
移动构造函数。 | |
mutable_column_device_view & | operator= (mutable_column_device_view const &)=default |
拷贝赋值运算符。更多... | |
mutable_column_device_view & | operator= (mutable_column_device_view &&)=default |
移动赋值运算符。更多... | |
mutable_column_device_view (mutable_column_view column, void *h_ptr, void *d_ptr) | |
使用指定的主机内存指针 (h_ptr) 创建此类的实例,用于存储子对象,并将设备内存指针 (d_ptr) 作为任何子对象指针的基准。更多... | |
template<typename T = void, CUDF_ENABLE_IF(std::is_same_v< T, void > or is_rep_layout_compatible< T >()) > | |
CUDF_HOST_DEVICE T * | head () const noexcept |
返回指向指定类型转换后的基本设备内存分配的指针。更多... | |
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) > | |
CUDF_HOST_DEVICE T * | data () const noexcept |
返回转换为指定类型并加上偏移量的底层数据。更多... | |
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) > | |
T & | element (size_type element_index) const noexcept |
返回指定索引处元素的引用。更多... | |
CUDF_HOST_DEVICE bitmask_type * | null_mask () const noexcept |
返回指向底层位掩码分配的原始指针。更多... | |
template<typename T , CUDF_ENABLE_IF(mutable_column_device_view::has_element_accessor< T >()) > | |
iterator< T > | begin () |
返回(考虑偏移量后)底层数据转换为指定类型后的第一个元素。更多... | |
template<typename T , CUDF_ENABLE_IF(mutable_column_device_view::has_element_accessor< T >()) > | |
iterator< T > | end () |
返回(考虑偏移量后)底层数据转换为指定类型后的最后一个元素之后的位置。更多... | |
mutable_column_device_view | child (size_type child_index) const noexcept |
返回指定的子列。更多... | |
void | set_mask_word (size_type word_index, bitmask_type new_word) const noexcept |
使用新词更新 null_mask() 中指定的位掩码词。更多... | |
void | destroy () |
销毁 mutable_column_device_view 对象。更多... | |
![]() | |
column_device_view_base (column_device_view_base const &)=default | |
拷贝构造函数。 | |
column_device_view_base (column_device_view_base &&)=default | |
移动构造函数。 | |
column_device_view_base & | operator= (column_device_view_base const &)=default |
拷贝赋值运算符。更多... | |
column_device_view_base & | operator= (column_device_view_base &&)=default |
移动赋值运算符。更多... | |
template<typename T = void, CUDF_ENABLE_IF(std::is_same_v< T, void > or is_rep_layout_compatible< T >()) > | |
CUDF_HOST_DEVICE T const * | head () const noexcept |
返回指向指定类型转换后的基本设备内存分配的指针。更多... | |
template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) > | |
CUDF_HOST_DEVICE T const * | data () const noexcept |
返回转换为指定类型并加上偏移量的底层数据。更多... | |
CUDF_HOST_DEVICE size_type | size () const noexcept |
返回列中的元素数量。更多... | |
CUDF_HOST_DEVICE data_type | type () const noexcept |
返回元素类型。更多... | |
CUDF_HOST_DEVICE bool | nullable () const noexcept |
指示列是否可以包含空元素,即它是否具有分配的位掩码。更多... | |
CUDF_HOST_DEVICE bitmask_type const * | null_mask () const noexcept |
返回指向底层位掩码分配的原始指针。更多... | |
CUDF_HOST_DEVICE size_type | offset () const noexcept |
返回相对于基本内存分配的第一个元素的索引,即 head<T>() 返回的值。更多... | |
bool | is_valid (size_type element_index) const noexcept |
返回指定元素是否持有有效值(即不为空)。更多... | |
bool | is_valid_nocheck (size_type element_index) const noexcept |
返回指定元素是否持有有效值(即不为空)更多... | |
bool | is_null (size_type element_index) const noexcept |
返回指定元素是否为空。更多... | |
bool | is_null_nocheck (size_type element_index) const noexcept |
返回指定元素是否为空。更多... | |
bitmask_type | get_mask_word (size_type word_index) const noexcept |
返回 null_mask() 中指定的位掩码词。更多... | |
静态公共成员函数 | |
static std::unique_ptr< mutable_column_device_view, std::function< void(mutable_column_device_view *)> > | create (mutable_column_view source_view, rmm::cuda_stream_view stream=cudf::get_default_stream()) |
用于构建可在设备内存中使用的列视图的工厂。更多... | |
template<typename T > | |
static constexpr CUDF_HOST_DEVICE bool | has_element_accessor () |
对于给定的 T ,指示 mutable_column_device_view::element<T>() 是否具有有效的重载。更多... | |
static std::size_t | extent (mutable_column_view source_view) |
返回保存指定列及其子列的设备视图所需的内存大小(字节数)。更多... | |
附加继承成员 | |
![]() | |
CUDF_HOST_DEVICE | column_device_view_base (data_type type, size_type size, void const *data, bitmask_type const *null_mask, size_type offset) |
使用指定的类型、大小、数据、nullmask 和偏移量构造列。更多... | |
![]() | |
data_type | _type {type_id::EMPTY} |
元素类型。 | |
cudf::size_type | _size {} |
元素数量。 | |
void const * | _data {} |
指向包含元素的设备内存的指针。 | |
bitmask_type const * | _null_mask {} |
size_type | _offset {} |
设备数据的可变、非拥有的视图,表示为元素列,易于复制且可在 CUDA 设备代码中使用。
定义在文件 column_device_view.cuh 的 929 行。
cudf::mutable_column_device_view::mutable_column_device_view | ( | mutable_column_view | column, |
void * | h_ptr, | ||
void * | d_ptr | ||
) |
使用指定的主机内存指针 (h_ptr) 创建此类的实例,用于存储子对象,并将设备内存指针 (d_ptr) 作为任何子对象指针的基准。
column | 用于创建此实例的列视图。 |
h_ptr | 用于存放任何子列数据的主机内存指针。 |
d_ptr | 用于作为任何子列指针基准的设备内存指针。 |
|
inline |
返回(考虑偏移量后)底层数据转换为指定类型后的第一个元素。
如果 mutable_column_device_view::has_element_accessor<T>()
为 false,则此函数不参与重载决议。
T | 所需类型 |
定义在文件 column_device_view.cuh 的 1087 行。
|
inlinenoexcept |
|
static |
用于构建可在设备内存中使用的列视图的工厂。
分配并复制 source_view
的子列视图到设备内存,使其可在设备代码中访问。
如果 source_view.num_children() == 0
,则不分配设备内存。
返回一个带有自定义删除器的 std::unique_ptr<mutable_column_device_view>
,用于释放为子列分配的设备内存。
mutable_column_device_view
应按值传递到 GPU 内核中。
source_view | 要在设备代码中使用的 column_view |
stream | 用于子列设备内存操作的 CUDA 流。 |
mutable_column_device_view
的 unique_ptr
,它使得 source_view
中的数据在设备内存中可用。
|
inlinenoexcept |
返回转换为指定类型并加上偏移量的底层数据。
如果 is_rep_layout_compatible<T>
为 false,则此函数不参与重载决议。
offset() == 0
,则 head<T>() == data<T>()
T | 要转换的类型 |
定义在文件 column_device_view.cuh 的 1018 行。
void cudf::mutable_column_device_view::destroy | ( | ) |
销毁 mutable_column_device_view
对象。
|
inlinenoexcept |
返回指定索引处元素的引用。
此函数会考虑偏移量。
如果 is_rep_layout_compatible<T>
为 false,则此函数不参与重载决议。对于 is_rep_layout_compatible<T>
为 false 的类型 T
,可能存在此函数的特化。
T | 元素类型 |
element_index | 所需元素的位置 |
定义在文件 column_device_view.cuh 的 1038 行。
|
inline |
返回(考虑偏移量后)底层数据转换为指定类型后的最后一个元素之后的位置。
如果 mutable_column_device_view::has_element_accessor<T>()
为 false,则此函数不参与重载决议。
T | 所需类型 |
定义在文件 column_device_view.cuh 的 1103 行。
|
static |
|
inlinestaticconstexpr |
对于给定的 T
,指示 mutable_column_device_view::element<T>()
是否具有有效的重载。
mutable_column_device_view::element<T>()
具有有效重载,则为 true
,否则为 false
。定义在文件 column_device_view.cuh 的 1050 行。
|
inlinenoexcept |
返回指向指定类型转换后的基本设备内存分配的指针。
此函数仅在 is_rep_layout_compatible<T>()
或 std::is_same_v<T,void>
为 true 时参与重载决议。
offset() == 0
,则 head<T>() == data<T>()
head<T>()
分配,而应通过 data<T>()
访问元素。要转换的 | 类型 |
定义在文件 column_device_view.cuh 的 1000 行。
|
inlinenoexcept |
返回指向底层位掩码分配的原始指针。
offset()
。null_count() == 0
,此函数可能返回 nullptr
。定义在文件 column_device_view.cuh 的 1063 行。
|
default |
移动赋值运算符。
|
default |
拷贝赋值运算符。
|
inlinenoexcept |
使用新词更新 null_mask()
中指定的位掩码词。
nullable() == false
,调用此函数是未定义行为。word_index | 要更新的词的索引 |
new_word | 新的位掩码词 |
定义在文件 column_device_view.cuh 的 1169 行。