Provides centralized type lists for use in Google Test type-parameterized tests. More...
#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>
Go to the source code of this file.
Namespaces | |
cudf | |
cuDF interfaces | |
Typedefs | |
using | cudf::test::IntegralTypesNotBool = cudf::test::Types< int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t > |
Type list for all integral types except type bool. | |
using | cudf::test::IntegralTypes = Concat< IntegralTypesNotBool, cudf::test::Types< bool > > |
Type list for all integral types. | |
using | cudf::test::FloatingPointTypes = cudf::test::Types< float, double > |
Provides a list of all floating point types supported in libcudf for use in a GTest typed test. More... | |
using | cudf::test::NumericTypes = Concat< IntegralTypes, FloatingPointTypes > |
Provides a list of all numeric types supported in libcudf for use in a GTest typed test. More... | |
using | cudf::test::TimestampTypes = cudf::test::Types< timestamp_D, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns > |
Provides a list of all timestamp types supported in libcudf for use in a GTest typed test. More... | |
using | cudf::test::DurationTypes = cudf::test::Types< duration_D, duration_s, duration_ms, duration_us, duration_ns > |
Provides a list of all duration types supported in libcudf for use in a GTest typed test. More... | |
using | cudf::test::ChronoTypes = Concat< TimestampTypes, DurationTypes > |
Provides a list of all chrono types supported in libcudf for use in a GTest typed test. More... | |
using | cudf::test::StringTypes = cudf::test::Types< string_view > |
Provides a list of all string types supported in libcudf for use in a GTest typed test. More... | |
using | cudf::test::ListTypes = cudf::test::Types< list_view > |
Provides a list of all list types supported in libcudf for use in a GTest typed test. More... | |
using | cudf::test::FixedPointTypes = cudf::test::Types< numeric::decimal32, numeric::decimal64, numeric::decimal128 > |
Provides a list of all fixed-point element types for use in GTest typed tests. More... | |
using | cudf::test::FixedWidthTypes = Concat< NumericTypes, ChronoTypes, FixedPointTypes > |
Provides a list of all fixed-width element types for use in GTest typed tests. More... | |
using | cudf::test::FixedWidthTypesWithoutFixedPoint = Concat< NumericTypes, ChronoTypes > |
Provides a list of all fixed-width element types except for the fixed-point types for use in GTest typed tests. More... | |
using | cudf::test::FixedWidthTypesWithoutChrono = Concat< NumericTypes, FixedPointTypes > |
Provides a list of all fixed-width element types except for the chrono types for use in GTest typed tests. More... | |
using | cudf::test::ComparableTypes = Concat< NumericTypes, ChronoTypes, StringTypes > |
Provides a list of sortable types for use in GTest typed tests. More... | |
using | cudf::test::CompoundTypes = cudf::test::Types< cudf::string_view, cudf::dictionary32, cudf::list_view, cudf::struct_view > |
Provides a list of all compound types for use in GTest typed tests. More... | |
using | cudf::test::AllTypes = Concat< NumericTypes, ChronoTypes, FixedPointTypes > |
Provides a list of all types supported in libcudf for use in a GTest typed test. More... | |
Functions | |
template<typename TYPES > | |
constexpr auto | cudf::test::detail::types_to_ids () |
Converts a Types list of types into a std::array of the corresponding cudf::type_id s for each type in the list. More... | |
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) |
Convert numeric values of type T to numeric vector of type TypeParam. More... | |
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) |
Convert numeric values of type T to timestamp vector. More... | |
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) |
Convert numeric values of type T to vector of std::string. More... | |
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) |
Convert the numeric value of type T to a fixed width type of type TypeParam. More... | |
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) |
Convert the timestamp value of type T to a fixed width type of type TypeParam. More... | |
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) |
Convert the numeric value of type T to a string type. More... | |
Provides centralized type lists for use in Google Test type-parameterized tests.
These lists should be used for consistency across tests as well as future-proofing against the addition of any new types in the future.
Definition in file type_lists.hpp.
using cudf::test::AllTypes = typedef Concat<NumericTypes, ChronoTypes, FixedPointTypes> |
Provides a list of all types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 371 of file type_lists.hpp.
using cudf::test::ChronoTypes = typedef Concat<TimestampTypes, DurationTypes> |
Provides a list of all chrono types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 256 of file type_lists.hpp.
using cudf::test::ComparableTypes = typedef Concat<NumericTypes, ChronoTypes, StringTypes> |
Provides a list of sortable types for use in GTest typed tests.
Example:
Definition at line 344 of file type_lists.hpp.
using cudf::test::CompoundTypes = typedef cudf::test::Types<cudf::string_view, cudf::dictionary32, cudf::list_view, cudf::struct_view> |
Provides a list of all compound types for use in GTest typed tests.
Example:
Definition at line 355 of file type_lists.hpp.
using cudf::test::DurationTypes = typedef cudf::test::Types<duration_D, duration_s, duration_ms, duration_us, duration_ns> |
Provides a list of all duration types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 244 of file type_lists.hpp.
using cudf::test::FixedPointTypes = typedef cudf::test::Types<numeric::decimal32, numeric::decimal64, numeric::decimal128> |
Provides a list of all fixed-point element types for use in GTest typed tests.
Example:
Definition at line 292 of file type_lists.hpp.
using cudf::test::FixedWidthTypes = typedef Concat<NumericTypes, ChronoTypes, FixedPointTypes> |
Provides a list of all fixed-width element types for use in GTest typed tests.
Example:
Definition at line 305 of file type_lists.hpp.
using cudf::test::FixedWidthTypesWithoutChrono = typedef Concat<NumericTypes, FixedPointTypes> |
Provides a list of all fixed-width element types except for the chrono types for use in GTest typed tests.
Example:
Definition at line 333 of file type_lists.hpp.
using cudf::test::FixedWidthTypesWithoutFixedPoint = typedef Concat<NumericTypes, ChronoTypes> |
Provides a list of all fixed-width element types except for the fixed-point types for use in GTest typed tests.
Certain tests written for fixed-width types don't work for fixed-point as fixed-point types aren't constructible from other fixed-width types because a scale needs to be specified.
Example:
Definition at line 321 of file type_lists.hpp.
using cudf::test::FloatingPointTypes = typedef cudf::test::Types<float, double> |
Provides a list of all floating point types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 207 of file type_lists.hpp.
using cudf::test::ListTypes = typedef cudf::test::Types<list_view> |
Provides a list of all list types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 280 of file type_lists.hpp.
using cudf::test::NumericTypes = typedef Concat<IntegralTypes, FloatingPointTypes> |
Provides a list of all numeric types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 219 of file type_lists.hpp.
using cudf::test::StringTypes = typedef cudf::test::Types<string_view> |
Provides a list of all string types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 268 of file type_lists.hpp.
using cudf::test::TimestampTypes = typedef cudf::test::Types<timestamp_D, timestamp_s, timestamp_ms, timestamp_us, timestamp_ns> |
Provides a list of all timestamp types supported in libcudf for use in a GTest typed test.
Example:
Definition at line 231 of file type_lists.hpp.
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 | ) |
Convert the numeric value of type T to a fixed width type of type TypeParam.
This function is necessary because some types (such as timestamp types) are not directly constructible from numeric types. This function is offered as a convenience to allow implicitly constructing such objects from numeric values.
init_value | Value used to initialize the fixed width type |
Definition at line 148 of file type_lists.hpp.
std::enable_if_t<cudf::is_timestamp_t<TypeParam>::value, TypeParam> cudf::test::make_type_param_scalar | ( | T const | init_value | ) |
Convert the timestamp value of type T to a fixed width type of type TypeParam.
This function is necessary because some types (such as timestamp types) are not directly constructible from timestamp types. This function is offered as a convenience to allow implicitly constructing such objects from timestamp values.
init_value | Value used to initialize the fixed width type |
Definition at line 165 of file type_lists.hpp.
std::enable_if_t<std::is_same_v<TypeParam, std::string>, TypeParam> cudf::test::make_type_param_scalar | ( | T const | init_value | ) |
Convert the numeric value of type T to a string type.
This function converts the numeric value of type T to its string representation.
init_value | Value to convert to a string |
Definition at line 180 of file type_lists.hpp.
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 | ) |
Convert numeric values of type T to numeric vector of type TypeParam.
This will also convert negative values to positive values if the output type is unsigned.
init_list | Values used to create the output vector |
Definition at line 87 of file type_lists.hpp.
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 | ) |
Convert numeric values of type T to timestamp vector.
init_list | Values used to create the output vector |
Definition at line 107 of file type_lists.hpp.
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 | ) |
Convert numeric values of type T to vector of std::string.
init_list | Values used to create the output vector |
Definition at line 125 of file type_lists.hpp.
|
constexpr |
Converts a Types
list of types into a std::array
of the corresponding cudf::type_id
s for each type in the list.
Example:
TYPES | List of types to convert to type_id s |
std::array
of type_id
s corresponding to each type in TYPES
Definition at line 68 of file type_lists.hpp.