公共类型 | 公共成员函数 | 静态公共成员函数 | 所有成员列表
cudf::mutable_column_device_view 类参考

设备数据的可变、非拥有的视图,表示为元素列,易于复制且可在 CUDA 设备代码中使用。更多...

cudf::mutable_column_device_view 的继承图
cudf::detail::column_device_view_base

公共类型

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_viewoperator= (mutable_column_device_view const &)=default
 拷贝赋值运算符。更多...
 
mutable_column_device_viewoperator= (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_typenull_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 对象。更多...
 
- 从 cudf::detail::column_device_view_base 继承的公共成员函数
 column_device_view_base (column_device_view_base const &)=default
 拷贝构造函数。
 
 column_device_view_base (column_device_view_base &&)=default
 移动构造函数。
 
column_device_view_baseoperator= (column_device_view_base const &)=default
 拷贝赋值运算符。更多...
 
column_device_view_baseoperator= (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::detail::column_device_view_base 继承的保护成员函数
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 和偏移量构造列。更多...
 
- 从 cudf::detail::column_device_view_base 继承的保护属性
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.cuh929 行。

构造函数与析构函数文档

◆ mutable_column_device_view()

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用于作为任何子列指针基准的设备内存指针。

成员函数文档

◆ begin()

template<typename T , CUDF_ENABLE_IF(mutable_column_device_view::has_element_accessor< T >()) >
iterator<T> cudf::mutable_column_device_view::begin ( )
inline

返回(考虑偏移量后)底层数据转换为指定类型后的第一个元素。

如果 mutable_column_device_view::has_element_accessor<T>() 为 false,则此函数不参与重载决议。

模板参数
T所需类型
返回
转换后的第一个元素的指针

定义在文件 column_device_view.cuh1087 行。

◆ child()

mutable_column_device_view cudf::mutable_column_device_view::child ( size_type  child_index) const
inlinenoexcept

返回指定的子列。

参数
child_index所需子列的索引
返回
请求的子列 column_view

定义在文件 column_device_view.cuh1114 行。

◆ create()

static std::unique_ptr<mutable_column_device_view, std::function<void(mutable_column_device_view*)> > cudf::mutable_column_device_view::create ( mutable_column_view  source_view,
rmm::cuda_stream_view  stream = cudf::get_default_stream() 
)
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_viewunique_ptr,它使得 source_view 中的数据在设备内存中可用。

◆ data()

template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
CUDF_HOST_DEVICE T* cudf::mutable_column_device_view::data ( ) const
inlinenoexcept

返回转换为指定类型并加上偏移量的底层数据。

如果 is_rep_layout_compatible<T> 为 false,则此函数不参与重载决议。

注意
如果 offset() == 0,则 head<T>() == data<T>()
模板参数
T要转换的类型
返回
指向底层数据的类型化指针,包含偏移量

定义在文件 column_device_view.cuh1018 行。

◆ destroy()

void cudf::mutable_column_device_view::destroy ( )

销毁 mutable_column_device_view 对象。

注意
不释放列数据,仅释放为保存子列视图而分配的设备内存。

◆ element()

template<typename T , CUDF_ENABLE_IF(is_rep_layout_compatible< T >()) >
T& cudf::mutable_column_device_view::element ( size_type  element_index) const
inlinenoexcept

返回指定索引处元素的引用。

此函数会考虑偏移量。

如果 is_rep_layout_compatible<T> 为 false,则此函数不参与重载决议。对于 is_rep_layout_compatible<T> 为 false 的类型 T,可能存在此函数的特化。

模板参数
T元素类型
参数
element_index所需元素的位置
返回
指定索引处元素的引用

定义在文件 column_device_view.cuh1038 行。

◆ end()

template<typename T , CUDF_ENABLE_IF(mutable_column_device_view::has_element_accessor< T >()) >
iterator<T> cudf::mutable_column_device_view::end ( )
inline

返回(考虑偏移量后)底层数据转换为指定类型后的最后一个元素之后的位置。

如果 mutable_column_device_view::has_element_accessor<T>() 为 false,则此函数不参与重载决议。

模板参数
T所需类型
返回
转换后的最后一个元素之后的位置的指针

定义在文件 column_device_view.cuh1103 行。

◆ extent()

static std::size_t cudf::mutable_column_device_view::extent ( mutable_column_view  source_view)
static

返回保存指定列及其子列的设备视图所需的内存大小(字节数)。

参数
source_view用于此计算的 column_view
返回
保存指定列及其子列的设备视图所需的内存大小(字节数)

◆ has_element_accessor()

template<typename T >
static constexpr CUDF_HOST_DEVICE bool cudf::mutable_column_device_view::has_element_accessor ( )
inlinestaticconstexpr

对于给定的 T,指示 mutable_column_device_view::element<T>() 是否具有有效的重载。

返回
如果 mutable_column_device_view::element<T>() 具有有效重载,则为 true,否则为 false

定义在文件 column_device_view.cuh1050 行。

◆ head()

template<typename T = void, CUDF_ENABLE_IF(std::is_same_v< T, void > or is_rep_layout_compatible< T >()) >
CUDF_HOST_DEVICE T* cudf::mutable_column_device_view::head ( ) const
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.cuh1000 行。

◆ null_mask()

CUDF_HOST_DEVICE bitmask_type* cudf::mutable_column_device_view::null_mask ( ) const
inlinenoexcept

返回指向底层位掩码分配的原始指针。

注意
此函数 考虑 offset()
如果 null_count() == 0,此函数可能返回 nullptr
返回
指向底层位掩码分配的原始指针

定义在文件 column_device_view.cuh1063 行。

◆ operator=() [1/2]

mutable_column_device_view& cudf::mutable_column_device_view::operator= ( mutable_column_device_view &&  )
default

移动赋值运算符。

返回
此对象的引用(转移所有权后)

◆ operator=() [2/2]

mutable_column_device_view& cudf::mutable_column_device_view::operator= ( mutable_column_device_view const &  )
default

拷贝赋值运算符。

返回
此对象的引用

◆ set_mask_word()

void cudf::mutable_column_device_view::set_mask_word ( size_type  word_index,
bitmask_type  new_word 
) const
inlinenoexcept

使用新词更新 null_mask() 中指定的位掩码词。

注意
如果 nullable() == false,调用此函数是未定义行为。
参数
word_index要更新的词的索引
new_word新的位掩码词

定义在文件 column_device_view.cuh1169 行。


此类的文档生成自以下文件