type_checks.hpp
1 /*
2  * 版权所有 (c) 2021-2024, NVIDIA CORPORATION.
3  *
4  * 根据 Apache 许可证 2.0 版(“许可证”)授权;
5  * 除非符合许可证的规定,否则您不得使用此文件。
6  * 您可以在以下地址获取许可证的副本:
7  *
8  * https://apache.ac.cn/licenses/LICENSE-2.0
9  *
10  * 除非适用法律要求或书面同意,根据许可证分发的软件
11  * 是基于“现状”分发的,不附带任何明示或暗示的担保或条件。
12  * 请参阅许可证,了解有关许可证下特定语言的管理权限和
13  * 限制。
14  */
15 
16 #pragma once
17 
19 #include <cudf/scalar/scalar.hpp>
20 
21 #include <algorithm>
22 
23 namespace CUDF_EXPORT cudf {
24 
35 bool column_types_equivalent(column_view const& lhs, column_view const& rhs);
36 
52 bool have_same_types(column_view const& lhs, column_view const& rhs);
53 
69 bool have_same_types(column_view const& lhs, scalar const& rhs);
70 
86 bool have_same_types(scalar const& lhs, column_view const& rhs);
87 
101 bool have_same_types(scalar const& lhs, scalar const& rhs);
102 
110 bool have_same_types(table_view const& lhs, table_view const& rhs);
111 
123 template <typename ForwardIt>
124 inline bool all_have_same_types(ForwardIt first, ForwardIt last)
125 {
126  return first == last || std::all_of(std::next(first), last, [want = *first](auto const& c) {
127  return cudf::have_same_types(want, c);
128  });
129 }
130 
131 } // namespace CUDF_EXPORT cudf
一个非拥有、不可变的设备数据视图,作为一列元素,其中一些元素可能为空...
一个表示单一值的拥有类。
一组相同大小的 cudf::column_view 对象。
列视图类定义
cuDF 接口
bool column_types_equivalent(column_view const &lhs, column_view const &rhs)
比较两个 column_view 的类型 ID。
bool all_have_same_types(ForwardIt first, ForwardIt last)
比较一系列 column_view 或 scalar 对象的类型。
bool have_same_types(column_view const &lhs, column_view const &rhs)
比较两个 column_view 的类型。
cudf::scalar 的类定义。