命名空间 | 类型别名 | 函数
type_lists.hpp 文件参考

提供用于 Google Test 类型参数化测试的集中式类型列表。更多...

#include <cudf_test/type_list_utilities.hpp>
#include <cudf/fixed_point/fixed_point.hpp>
#include <cudf/strings/string_view.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/export.hpp>
#include <cudf/utilities/traits.hpp>
#include <cudf/utilities/type_dispatcher.hpp>
#include <cudf/wrappers/durations.hpp>
#include <cudf/wrappers/timestamps.hpp>
#include <thrust/host_vector.h>
#include <array>
#include <tuple>
#include <type_traits>

前往此文件源代码。

命名空间

 cudf
 cuDF 接口
 

类型别名

using cudf::test::IntegralTypesNotBool = cudf::test::Types< int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t >
 所有非 bool 整型类型的类型列表。
 
using cudf::test::IntegralTypes = Concat< IntegralTypesNotBool, cudf::test::Types< bool > >
 所有整型类型的类型列表。
 
using cudf::test::FloatingPointTypes = cudf::test::Types< float, double >
 提供 libcudf 中支持的所有浮点类型列表,用于 GTest 类型化测试。更多...
 
using cudf::test::NumericTypes = Concat< IntegralTypes, FloatingPointTypes >
 提供 libcudf 中支持的所有数值类型列表,用于 GTest 类型化测试。更多...
 
using cudf::test::TimestampTypes = cudf::test::Types< timestamp_D, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns >
 提供 libcudf 中支持的所有时间戳类型列表,用于 GTest 类型化测试。更多...
 
using cudf::test::DurationTypes = cudf::test::Types< duration_D, duration_s, duration_ms, duration_us, duration_ns >
 提供 libcudf 中支持的所有持续时间类型列表,用于 GTest 类型化测试。更多...
 
using cudf::test::ChronoTypes = Concat< TimestampTypes, DurationTypes >
 提供 libcudf 中支持的所有 chrono 类型列表,用于 GTest 类型化测试。更多...
 
using cudf::test::StringTypes = cudf::test::Types< string_view >
 提供 libcudf 中支持的所有字符串类型列表,用于 GTest 类型化测试。更多...
 
using cudf::test::ListTypes = cudf::test::Types< list_view >
 提供 libcudf 中支持的所有列表类型列表,用于 GTest 类型化测试。更多...
 
using cudf::test::FixedPointTypes = cudf::test::Types< numeric::decimal32, numeric::decimal64, numeric::decimal128 >
 提供用于 GTest 类型化测试的所有定点元素类型列表。更多...
 
using cudf::test::FixedWidthTypes = Concat< NumericTypes, ChronoTypes, FixedPointTypes >
 提供用于 GTest 类型化测试的所有固定宽度元素类型列表。更多...
 
using cudf::test::FixedWidthTypesWithoutFixedPoint = Concat< NumericTypes, ChronoTypes >
 提供用于 GTest 类型化测试的所有固定宽度元素类型列表(定点类型除外)。更多...
 
using cudf::test::FixedWidthTypesWithoutChrono = Concat< NumericTypes, FixedPointTypes >
 提供用于 GTest 类型化测试的所有固定宽度元素类型列表(chrono 类型除外)。更多...
 
using cudf::test::ComparableTypes = Concat< NumericTypes, ChronoTypes, StringTypes >
 提供用于 GTest 类型化测试的所有可排序类型列表。更多...
 
using cudf::test::CompoundTypes = cudf::test::Types< cudf::string_view, cudf::dictionary32, cudf::list_view, cudf::struct_view >
 提供用于 GTest 类型化测试的所有复合类型列表。更多...
 
using cudf::test::AllTypes = Concat< NumericTypes, ChronoTypes, FixedPointTypes >
 提供 libcudf 中支持的所有类型列表,用于 GTest 类型化测试。更多...
 

函数

template<typename TYPES >
constexpr auto cudf::test::detail::types_to_ids ()
 Types 类型列表转换为对应的每种类型的 cudf::type_idstd::array更多...
 
template<typename TypeParam , typename T >
std::enable_if_t< cudf::is_fixed_width< TypeParam >) &&!cudf::is_timestamp_t< TypeParam >::value, thrust::host_vector< TypeParam > > cudf::test::make_type_param_vector (std::initializer_list< T > const &init_list)
 将类型 T 的数值转换为 TypeParam 类型的数值向量。更多...
 
template<typename TypeParam , typename T >
std::enable_if_t< cudf::is_timestamp_t< TypeParam >::value, thrust::host_vector< TypeParam > > cudf::test::make_type_param_vector (std::initializer_list< T > const &init_list)
 将类型 T 的数值转换为时间戳向量。更多...
 
template<typename TypeParam , typename T >
std::enable_if_t< std::is_same_v< TypeParam, std::string >, thrust::host_vector< std::string > > cudf::test::make_type_param_vector (std::initializer_list< T > const &init_list)
 将类型 T 的数值转换为 std::string 向量。更多...
 
template<typename TypeParam , typename T >
std::enable_if_t< cudf::is_fixed_width< TypeParam >) &&!cudf::is_timestamp_t< TypeParam >::value, TypeParam > cudf::test::make_type_param_scalar (T const init_value)
 将类型 T 的数值转换为 TypeParam 类型的固定宽度类型。更多...
 
template<typename TypeParam , typename T >
std::enable_if_t< cudf::is_timestamp_t< TypeParam >::value, TypeParam > cudf::test::make_type_param_scalar (T const init_value)
 将类型 T 的时间戳值转换为 TypeParam 类型的固定宽度类型。更多...
 
template<typename TypeParam , typename T >
std::enable_if_t< std::is_same_v< TypeParam, std::string >, TypeParam > cudf::test::make_type_param_scalar (T const init_value)
 将类型 T 的数值转换为字符串类型。更多...
 

详细描述

提供用于 Google Test 类型参数化测试的集中式类型列表。

这些列表应在所有测试中保持一致性,并为将来添加新类型提供前瞻性。

定义于文件 type_lists.hpp 中。

类型别名文档

◆ AllTypes

using cudf::test::AllTypes = typedef Concat<NumericTypes, ChronoTypes, FixedPointTypes>

提供 libcudf 中支持的所有类型列表,用于 GTest 类型化测试。

注意
目前不提供任何“包装”类型,例如 category 等。

示例

// 调用 libcudf 支持的所有类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::AllTypes);
Concat< NumericTypes, ChronoTypes, FixedPointTypes > AllTypes
提供 libcudf 中支持的所有类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp371 行。

◆ ChronoTypes

using cudf::test::ChronoTypes = typedef Concat<TimestampTypes, DurationTypes>

提供 libcudf 中支持的所有 chrono 类型列表,用于 GTest 类型化测试。

示例

// 调用 libcudf 中所有 chrono 类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::ChronoTypes);
Concat< TimestampTypes, DurationTypes > ChronoTypes
提供 libcudf 中支持的所有 chrono 类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp256 行。

◆ ComparableTypes

using cudf::test::ComparableTypes = typedef Concat<NumericTypes, ChronoTypes, StringTypes>

提供用于 GTest 类型化测试的所有可排序类型列表。

示例

// 调用 libcudf 中所有可排序类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::ComparableTypes);
Concat< NumericTypes, ChronoTypes, StringTypes > ComparableTypes
提供用于 GTest 类型化测试的所有可排序类型列表。

定义于文件 type_lists.hpp344 行。

◆ CompoundTypes

提供用于 GTest 类型化测试的所有复合类型列表。

示例

// 调用 libcudf 中所有复合类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::CompoundTypes);
cudf::test::Types< cudf::string_view, cudf::dictionary32, cudf::list_view, cudf::struct_view > CompoundTypes
提供用于 GTest 类型化测试的所有复合类型列表。

定义于文件 type_lists.hpp355 行。

◆ DurationTypes

using cudf::test::DurationTypes = typedef cudf::test::Types<duration_D, duration_s, duration_ms, duration_us, duration_ns>

提供 libcudf 中支持的所有持续时间类型列表,用于 GTest 类型化测试。

示例

// 调用 libcudf 中所有持续时间类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::DurationTypes);
cudf::test::Types< duration_D, duration_s, duration_ms, duration_us, duration_ns > DurationTypes
提供 libcudf 中支持的所有持续时间类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp244 行。

◆ FixedPointTypes

提供用于 GTest 类型化测试的所有定点元素类型列表。

示例

// 调用 libcudf 中所有定点类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::FixedPointTypes);
cudf::test::Types< numeric::decimal32, numeric::decimal64, numeric::decimal128 > FixedPointTypes
提供用于 GTest 类型化测试的所有定点元素类型列表。

定义于文件 type_lists.hpp292 行。

◆ FixedWidthTypes

using cudf::test::FixedWidthTypes = typedef Concat<NumericTypes, ChronoTypes, FixedPointTypes>

提供用于 GTest 类型化测试的所有固定宽度元素类型列表。

示例

// 调用 libcudf 中所有定点类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::FixedWidthTypes);
Concat< NumericTypes, ChronoTypes, FixedPointTypes > FixedWidthTypes
提供用于 GTest 类型化测试的所有固定宽度元素类型列表。

定义于文件 type_lists.hpp305 行。

◆ FixedWidthTypesWithoutChrono

using cudf::test::FixedWidthTypesWithoutChrono = typedef Concat<NumericTypes, FixedPointTypes>

提供用于 GTest 类型化测试的所有固定宽度元素类型列表(chrono 类型除外)。

示例

// 调用 libcudf 中所有定点类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::FixedWidthTypesWithoutChrono);
Concat< NumericTypes, FixedPointTypes > FixedWidthTypesWithoutChrono
提供用于 GTest 类型化测试的所有固定宽度元素类型列表(chrono 类型除外)...

定义于文件 type_lists.hpp333 行。

◆ FixedWidthTypesWithoutFixedPoint

using cudf::test::FixedWidthTypesWithoutFixedPoint = typedef Concat<NumericTypes, ChronoTypes>

提供用于 GTest 类型化测试的所有固定宽度元素类型列表(定点类型除外)。

为固定宽度类型编写的某些测试不适用于定点类型,因为定点类型无法直接由其他固定宽度类型构造,需要指定刻度。

示例

// 调用 libcudf 中所有定点类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::FixedWidthTypesWithoutFixedPoint);
Concat< NumericTypes, ChronoTypes > FixedWidthTypesWithoutFixedPoint
提供用于 GTest 类型化测试的所有固定宽度元素类型列表(定点类型除外)...

定义于文件 type_lists.hpp321 行。

◆ FloatingPointTypes

using cudf::test::FloatingPointTypes = typedef cudf::test::Types<float, double>

提供 libcudf 中支持的所有浮点类型列表,用于 GTest 类型化测试。

示例

// 调用 libcudf 中所有浮点类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::FloatingPointTypes);
cudf::test::Types< float, double > FloatingPointTypes
提供 libcudf 中支持的所有浮点类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp207 行。

◆ ListTypes

using cudf::test::ListTypes = typedef cudf::test::Types<list_view>

提供 libcudf 中支持的所有列表类型列表,用于 GTest 类型化测试。

示例

// 调用 libcudf 中所有列表类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::ListTypes);
cudf::test::Types< list_view > ListTypes
提供 libcudf 中支持的所有列表类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp280 行。

◆ NumericTypes

using cudf::test::NumericTypes = typedef Concat<IntegralTypes, FloatingPointTypes>

提供 libcudf 中支持的所有数值类型列表,用于 GTest 类型化测试。

示例

// 调用 libcudf 中所有数值类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::NumericTypes);
Concat< IntegralTypes, FloatingPointTypes > NumericTypes
提供 libcudf 中支持的所有数值类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp219 行。

◆ StringTypes

using cudf::test::StringTypes = typedef cudf::test::Types<string_view>

提供 libcudf 中支持的所有字符串类型列表,用于 GTest 类型化测试。

示例

// 调用 libcudf 中所有字符串类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::StringTypes);
cudf::test::Types< string_view > StringTypes
提供 libcudf 中支持的所有字符串类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp268 行。

◆ TimestampTypes

using cudf::test::TimestampTypes = typedef cudf::test::Types<timestamp_D, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns>

提供 libcudf 中支持的所有时间戳类型列表,用于 GTest 类型化测试。

示例

// 调用 libcudf 中所有时间戳类型的类型化 fixture 测试
TYPED_TEST_SUITE(MyTypedFixture, cudf::test::TimestampTypes);
cudf::test::Types< timestamp_D, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns > TimestampTypes
提供 libcudf 中支持的所有时间戳类型列表,用于 GTest 类型化测试。

定义于文件 type_lists.hpp231 行。

函数文档

◆ make_type_param_scalar() [1/3]

template<typename TypeParam , typename T >
std::enable_if_t<cudf::is_fixed_width<TypeParam>) && !cudf::is_timestamp_t<TypeParam>::value, TypeParam> cudf::test::make_type_param_scalar ( T const  init_value)

将类型 T 的数值转换为 TypeParam 类型的固定宽度类型。

此函数是必需的,因为某些类型(例如时间戳类型)无法直接由数值类型构造。此函数作为一种便捷方式,允许从数值隐式构造此类对象。

参数
init_value用于初始化固定宽度类型的值
返回值
具有指定值的 TypeParam 类型的固定宽度类型 - [u]int32/float/duration 等

定义于文件 type_lists.hpp148 行。

◆ make_type_param_scalar() [2/3]

template<typename TypeParam , typename T >
std::enable_if_t<cudf::is_timestamp_t<TypeParam>::value, TypeParam> cudf::test::make_type_param_scalar ( T const  init_value)

将类型 T 的时间戳值转换为 TypeParam 类型的固定宽度类型。

此函数是必需的,因为某些类型(例如时间戳类型)无法直接由时间戳类型构造。此函数作为一种便捷方式,允许从时间戳值隐式构造此类对象。

参数
init_value用于初始化固定宽度类型的值
返回值
具有指定值的 TypeParam 类型的固定宽度类型 - TimeStamp

定义于文件 type_lists.hpp165 行。

◆ make_type_param_scalar() [3/3]

template<typename TypeParam , typename T >
std::enable_if_t<std::is_same_v<TypeParam, std::string>, TypeParam> cudf::test::make_type_param_scalar ( T const  init_value)

将类型 T 的数值转换为字符串类型。

此函数将类型 T 的数值转换为其字符串表示形式。

参数
init_value要转换为字符串的值
返回值
值的字符串表示形式

定义于文件 type_lists.hpp180 行。

◆ make_type_param_vector() [1/3]

template<typename TypeParam , typename T >
std::enable_if_t<cudf::is_fixed_width<TypeParam>) && !cudf::is_timestamp_t<TypeParam>::value, thrust::host_vector<TypeParam> > cudf::test::make_type_param_vector ( std::initializer_list< T > const &  init_list)

将类型 T 的数值转换为 TypeParam 类型的数值向量。

如果输出类型为无符号类型,这也将负值转换为正值。

参数
init_list用于创建输出向量的值
返回值
包含指定值的 TypeParam 向量

定义于文件 type_lists.hpp87 行。

◆ make_type_param_vector() [2/3]

template<typename TypeParam , typename T >
std::enable_if_t<cudf::is_timestamp_t<TypeParam>::value, thrust::host_vector<TypeParam> > cudf::test::make_type_param_vector ( std::initializer_list< T > const &  init_list)

将类型 T 的数值转换为时间戳向量。

参数
init_list用于创建输出向量的值
返回值
包含指定值的 TypeParam 向量

定义于文件 type_lists.hpp107 行。

◆ make_type_param_vector() [3/3]

template<typename TypeParam , typename T >
std::enable_if_t<std::is_same_v<TypeParam, std::string>, thrust::host_vector<std::string> > cudf::test::make_type_param_vector ( std::initializer_list< T > const &  init_list)

将类型 T 的数值转换为 std::string 向量。

参数
init_list用于创建输出向量的值
返回值
包含指定值的 TypeParam 向量

定义于文件 type_lists.hpp125 行。

◆ types_to_ids()

template<typename TYPES >
constexpr auto cudf::test::detail::types_to_ids ( )
constexpr

Types 类型列表转换为对应的每种类型的 cudf::type_idstd::array

示例

auto array = types_to_ids<Types<int32_t, float>>();
array == {type_id::INT32, type_id::FLOAT};
模板参数
TYPES要转换为 type_id 的类型列表
返回值
对应 TYPES 中每种类型的 type_idstd::array

定义于文件 type_lists.hpp68 行。