文件 | 函数
搜索

文件

文件  dictionary/search.hpp
 

函数

std::unique_ptr< scalarcudf::dictionary::get_index (dictionary_column_view const &dictionary, scalar const &key, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
 返回给定键的索引值。 更多...
 

详细描述

函数文档

◆ get_index()

std::unique_ptr<scalar> cudf::dictionary::get_index ( dictionary_column_view const &  dictionary,
scalar const &  key,
rmm::cuda_stream_view  stream = cudf::get_default_stream(),
rmm::device_async_resource_ref  mr = cudf::get_current_device_resource_ref() 
)

返回给定键的索引值。

如果键不在字典中,则返回的 scalar 将具有 is_valid()==false

异常
cudf::logic_error如果 key.type() != dictionary.keys().type()
参数
dictionary要搜索键的字典。
key要在字典键集中搜索的值。
stream用于设备内存操作和内核启动的 CUDA stream。
mr用于分配返回的 scalar 的设备内存的设备内存资源。
返回值
键在字典中的数字 scalar 索引值。