29 #include <thrust/host_vector.h>
33 #include <type_traits>
46 template <
typename TYPES, std::size_t... Indices>
47 constexpr std::array<
cudf::type_id,
sizeof...(Indices)> types_to_ids_impl(
48 std::index_sequence<Indices...>)
50 return {{cudf::type_to_id<GetType<TYPES, Indices>>()...}};
66 template <
typename TYPES>
69 constexpr
auto N = GetSize<TYPES>;
70 return types_to_ids_impl<TYPES>(std::make_index_sequence<N>());
83 template <
typename TypeParam,
typename T>
85 thrust::host_vector<TypeParam>>
88 std::vector<T> input{init_list};
89 std::vector<TypeParam> vec(init_list.size());
91 std::cbegin(input), std::cend(input), std::begin(vec), [](
auto const& e) -> TypeParam {
92 if constexpr (std::is_unsigned_v<TypeParam>) {
return static_cast<TypeParam
>(std::abs(e)); }
93 return static_cast<TypeParam
>(e);
104 template <
typename TypeParam,
typename T>
105 std::enable_if_t<cudf::is_timestamp_t<TypeParam>::value, thrust::host_vector<TypeParam>>
108 thrust::host_vector<TypeParam> vec(init_list.size());
109 std::transform(std::cbegin(init_list), std::cend(init_list), std::begin(vec), [](
auto const& e) {
110 return TypeParam{
typename TypeParam::duration{e}};
122 template <
typename TypeParam,
typename T>
123 std::enable_if_t<std::is_same_v<TypeParam, std::string>, thrust::host_vector<std::string>>
126 thrust::host_vector<std::string> vec(init_list.size());
127 std::transform(std::cbegin(init_list), std::cend(init_list), std::begin(vec), [](
auto const& e) {
128 return std::to_string(e);
144 template <
typename TypeParam,
typename T>
149 return static_cast<TypeParam
>(init_value);
163 template <
typename TypeParam,
typename T>
167 return TypeParam{
typename TypeParam::duration(init_value)};
178 template <
typename TypeParam,
typename T>
182 return std::to_string(init_value);
189 cudf::test::Types<int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t>;
231 cudf::test::Types<timestamp_D, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns>;
244 cudf::test::Types<duration_D, duration_s, duration_ms, duration_us, duration_ns>;
292 cudf::test::Types<numeric::decimal32, numeric::decimal64, numeric::decimal128>;
355 cudf::test::Types<cudf::string_view, cudf::dictionary32, cudf::list_view, cudf::struct_view>;
378 static constexpr
auto all_type_ids{detail::types_to_ids<AllTypes>()};
386 static constexpr
auto numeric_type_ids{detail::types_to_ids<NumericTypes>()};
394 static constexpr std::array<cudf::type_id, 5> timestamp_type_ids{
395 detail::types_to_ids<TimestampTypes>()};
403 static constexpr std::array<cudf::type_id, 5> duration_type_ids{
404 detail::types_to_ids<DurationTypes>()};
412 static constexpr std::array<cudf::type_id, 12> non_numeric_type_ids{
Concrete type definitions for int32_t and int64_t durations in varying resolutions.
Class definition for fixed point data type.
type_id
Identifies a column's logical element type.
cuda::std::disjunction< std::is_same< cudf::timestamp_D, T >, std::is_same< cudf::timestamp_s, T >, std::is_same< cudf::timestamp_ms, T >, std::is_same< cudf::timestamp_us, T >, std::is_same< cudf::timestamp_ns, T > > is_timestamp_t
Checks if a type is a timestamp type.
@ DURATION_MILLISECONDS
time interval of milliseconds in int64
@ TIMESTAMP_MILLISECONDS
point in time in milliseconds since Unix Epoch in int64
@ DURATION_NANOSECONDS
time interval of nanoseconds in int64
@ DURATION_DAYS
time interval of days in int32
@ TIMESTAMP_MICROSECONDS
point in time in microseconds since Unix Epoch in int64
@ DURATION_SECONDS
time interval of seconds in int64
@ DURATION_MICROSECONDS
time interval of microseconds in int64
@ EMPTY
Always null with no underlying data.
@ TIMESTAMP_SECONDS
point in time in seconds since Unix Epoch in int64
@ TIMESTAMP_NANOSECONDS
point in time in nanoseconds since Unix Epoch in int64
@ TIMESTAMP_DAYS
point in time in days since Unix Epoch in int32
Class definition for cudf::string_view.
Concrete type definitions for int32_t and int64_t timestamps in varying resolutions as durations sinc...
Defines the mapping between cudf::type_id runtime type information and concrete C++ types.
Utilities for creating type lists for typed tests in Google Test.
typename ConcatImpl< T... >::type Concat
Concatenates compile-time lists of types into a single type list.
Concat< NumericTypes, FixedPointTypes > FixedWidthTypesWithoutChrono
Provides a list of all fixed-width element types except for the chrono types for use in GTest typed t...
std::enable_if_t< cudf::is_fixed_width< TypeParam >) &&!cudf::is_timestamp_t< TypeParam >::value, thrust::host_vector< TypeParam > > make_type_param_vector(std::initializer_list< T > const &init_list)
Convert numeric values of type T to numeric vector of type TypeParam.
cudf::test::Types< int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t > IntegralTypesNotBool
Type list for all integral types except type bool.
cudf::test::Types< cudf::string_view, cudf::dictionary32, cudf::list_view, cudf::struct_view > CompoundTypes
Provides a list of all compound types for use in GTest typed tests.
Concat< IntegralTypesNotBool, cudf::test::Types< bool > > IntegralTypes
Type list for all integral types.
cudf::test::Types< float, double > FloatingPointTypes
Provides a list of all floating point types supported in libcudf for use in a GTest typed test.
cudf::test::Types< timestamp_D, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns > TimestampTypes
Provides a list of all timestamp types supported in libcudf for use in a GTest typed test.
Concat< NumericTypes, ChronoTypes, FixedPointTypes > FixedWidthTypes
Provides a list of all fixed-width element types for use in GTest typed tests.
Concat< IntegralTypes, FloatingPointTypes > NumericTypes
Provides a list of all numeric types supported in libcudf for use in a GTest typed test.
Concat< NumericTypes, ChronoTypes, StringTypes > ComparableTypes
Provides a list of sortable types for use in GTest typed tests.
Concat< NumericTypes, ChronoTypes, FixedPointTypes > AllTypes
Provides a list of all types supported in libcudf for use in a GTest typed test.
Concat< TimestampTypes, DurationTypes > ChronoTypes
Provides a list of all chrono types supported in libcudf for use in a GTest typed test.
std::enable_if_t< cudf::is_fixed_width< TypeParam >) &&!cudf::is_timestamp_t< TypeParam >::value, TypeParam > make_type_param_scalar(T const init_value)
Convert the numeric value of type T to a fixed width type of type TypeParam.
cudf::test::Types< string_view > StringTypes
Provides a list of all string types supported in libcudf for use in a GTest typed test.
cudf::test::Types< numeric::decimal32, numeric::decimal64, numeric::decimal128 > FixedPointTypes
Provides a list of all fixed-point element types for use in GTest typed tests.
Concat< NumericTypes, ChronoTypes > FixedWidthTypesWithoutFixedPoint
Provides a list of all fixed-width element types except for the fixed-point types for use in GTest ty...
cudf::test::Types< duration_D, duration_s, duration_ms, duration_us, duration_ns > DurationTypes
Provides a list of all duration types supported in libcudf for use in a GTest typed test.
constexpr auto types_to_ids()
Converts a Types list of types into a std::array of the corresponding cudf::type_ids for each type in...
cudf::test::Types< list_view > ListTypes
Provides a list of all list types supported in libcudf for use in a GTest typed test.
Type declarations for libcudf.