diff --git a/cpp/benchmarks/common/generate_input.hpp b/cpp/benchmarks/common/generate_input.hpp index 8261341ccfb..1999ccb8ec3 100644 --- a/cpp/benchmarks/common/generate_input.hpp +++ b/cpp/benchmarks/common/generate_input.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,15 +69,14 @@ distribution_id default_distribution_id() return distribution_id::GEOMETRIC; } -template ::value && cudf::is_numeric()>* = nullptr> +template && cudf::is_numeric()>* = nullptr> distribution_id default_distribution_id() { return distribution_id::NORMAL; } template && std::is_unsigned::value && + std::enable_if_t && std::is_unsigned_v && cudf::is_numeric()>* = nullptr> distribution_id default_distribution_id() { @@ -226,7 +225,7 @@ class data_profile { public: template < typename T, - typename std::enable_if_t && std::is_integral::value, T>* = nullptr> + typename std::enable_if_t && std::is_integral_v, T>* = nullptr> distribution_params get_distribution_params() const { auto it = int_params.find(cudf::type_to_id()); @@ -239,7 +238,7 @@ class data_profile { } } - template ::value, T>* = nullptr> + template , T>* = nullptr> distribution_params get_distribution_params() const { auto it = float_params.find(cudf::type_to_id()); @@ -307,7 +306,7 @@ class data_profile { // discrete distributions (integers, strings, lists). Otherwise the call with have no effect. template ::value, T>* = nullptr> + typename std::enable_if_t, T>* = nullptr> void set_distribution_params(Type_enum type_or_group, distribution_id dist, T lower_bound, @@ -331,7 +330,7 @@ class data_profile { // have continuous distributions (floating point types). Otherwise the call with have no effect. template ::value, T>* = nullptr> + typename std::enable_if_t, T>* = nullptr> void set_distribution_params(Type_enum type_or_group, distribution_id dist, T lower_bound, diff --git a/cpp/benchmarks/common/random_distribution_factory.hpp b/cpp/benchmarks/common/random_distribution_factory.hpp index 48e6855c39a..3289c6f40ab 100644 --- a/cpp/benchmarks/common/random_distribution_factory.hpp +++ b/cpp/benchmarks/common/random_distribution_factory.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ /** * @brief Generates a normal(binomial) distribution between zero and upper_bound. */ -template ::value, T>* = nullptr> +template , T>* = nullptr> auto make_normal_dist(T upper_bound) { using uT = typename std::make_unsigned::type; @@ -42,7 +42,7 @@ auto make_normal_dist(T upper_bound) return std::normal_distribution(mean, stddev); } -template ::value, T>* = nullptr> +template , T>* = nullptr> auto make_uniform_dist(T range_start, T range_end) { return std::uniform_int_distribution(range_start, range_end); @@ -62,7 +62,7 @@ double geometric_dist_p(T range_size) return p ? p : std::numeric_limits::epsilon(); } -template ::value, T>* = nullptr> +template , T>* = nullptr> auto make_geometric_dist(T range_start, T range_end) { using uT = typename std::make_unsigned::type; @@ -82,7 +82,7 @@ auto make_geometric_dist(T range_start, T range_end) template using distribution_fn = std::function; -template ::value, T>* = nullptr> +template , T>* = nullptr> distribution_fn make_distribution(distribution_id did, T lower_bound, T upper_bound) { switch (did) { diff --git a/cpp/benchmarks/type_dispatcher/type_dispatcher.cu b/cpp/benchmarks/type_dispatcher/type_dispatcher.cu index ca19e3046ad..48b31e5dae7 100644 --- a/cpp/benchmarks/type_dispatcher/type_dispatcher.cu +++ b/cpp/benchmarks/type_dispatcher/type_dispatcher.cu @@ -42,7 +42,7 @@ struct Functor { }; template -struct Functor::value>> { +struct Functor>> { static __device__ Float f(Float x) { if (ft == BANDWIDTH_BOUND) { diff --git a/cpp/include/cudf/ast/detail/operators.hpp b/cpp/include/cudf/ast/detail/operators.hpp index d7fd109f12a..63048a993c7 100644 --- a/cpp/include/cudf/ast/detail/operators.hpp +++ b/cpp/include/cudf/ast/detail/operators.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,10 +35,10 @@ namespace detail { // Traits for valid operator / type combinations template -constexpr bool is_valid_binary_op = cuda::std::is_invocable::value; +constexpr bool is_valid_binary_op = cuda::std::is_invocable_v; template -constexpr bool is_valid_unary_op = cuda::std::is_invocable::value; +constexpr bool is_valid_unary_op = cuda::std::is_invocable_v; /** * @brief Operator dispatcher @@ -301,8 +301,8 @@ struct operator_functor { template , - std::enable_if_t::value>* = nullptr> + typename CommonType = std::common_type_t, + std::enable_if_t>* = nullptr> __device__ inline auto operator()(LHS lhs, RHS rhs) -> decltype(static_cast(lhs) % static_cast(rhs)) { @@ -336,8 +336,8 @@ struct operator_functor { template , - std::enable_if_t::value>* = nullptr> + typename CommonType = std::common_type_t, + std::enable_if_t>* = nullptr> __device__ inline auto operator()(LHS lhs, RHS rhs) -> decltype(((static_cast(lhs) % static_cast(rhs)) + static_cast(rhs)) % @@ -542,7 +542,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::sin(input)) { return std::sin(input); @@ -553,7 +553,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::cos(input)) { return std::cos(input); @@ -564,7 +564,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::tan(input)) { return std::tan(input); @@ -575,7 +575,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::asin(input)) { return std::asin(input); @@ -586,7 +586,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::acos(input)) { return std::acos(input); @@ -597,7 +597,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::atan(input)) { return std::atan(input); @@ -608,7 +608,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::sinh(input)) { return std::sinh(input); @@ -619,7 +619,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::cosh(input)) { return std::cosh(input); @@ -630,7 +630,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::tanh(input)) { return std::tanh(input); @@ -641,7 +641,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::asinh(input)) { return std::asinh(input); @@ -652,7 +652,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::acosh(input)) { return std::acosh(input); @@ -663,7 +663,7 @@ template <> struct operator_functor { static constexpr auto arity{1}; - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::atanh(input)) { return std::atanh(input); @@ -741,13 +741,13 @@ struct operator_functor { static constexpr auto arity{1}; // Only accept signed or unsigned types (both require is_arithmetic to be true) - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(std::abs(input)) { return std::abs(input); } - template ::value>* = nullptr> + template >* = nullptr> __device__ inline auto operator()(InputT input) -> decltype(input) { return input; diff --git a/cpp/include/cudf/column/column_device_view.cuh b/cpp/include/cudf/column/column_device_view.cuh index d2332ef9026..ea6552a1d61 100644 --- a/cpp/include/cudf/column/column_device_view.cuh +++ b/cpp/include/cudf/column/column_device_view.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -380,7 +380,7 @@ class alignas(16) column_device_view : public detail::column_device_view_base { */ struct index_element_fn { template () and std::is_unsigned::value)> + CUDF_ENABLE_IF(is_index_type() and std::is_unsigned_v)> __device__ size_type operator()(column_device_view const& indices, size_type index) { return static_cast(indices.element(index)); @@ -388,8 +388,7 @@ class alignas(16) column_device_view : public detail::column_device_view_base { template () and - std::is_unsigned::value))> + CUDF_ENABLE_IF(not(is_index_type() and std::is_unsigned_v))> __device__ size_type operator()(Args&&... args) { cudf_assert(false and "dictionary indices must be an unsigned integral type"); diff --git a/cpp/include/cudf/detail/aggregation/aggregation.cuh b/cpp/include/cudf/detail/aggregation/aggregation.cuh index 47aa7d18489..60ea10cef88 100644 --- a/cpp/include/cudf/detail/aggregation/aggregation.cuh +++ b/cpp/include/cudf/detail/aggregation/aggregation.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,7 +108,7 @@ using corresponding_operator_t = typename corresponding_operator::type; template constexpr bool has_corresponding_operator() { - return !std::is_same::type, void>::value; + return !std::is_same_v::type, void>; } template - std::enable_if_t, void>::value, T> + std::enable_if_t, void>, T> identity_from_operator() { using DeviceType = device_storage_type_t; @@ -610,8 +610,7 @@ struct identity_initializer { } template - std::enable_if_t, void>::value, T> - identity_from_operator() + std::enable_if_t, void>, T> identity_from_operator() { CUDF_FAIL("Unable to get identity/sentinel from device operator"); } diff --git a/cpp/include/cudf/detail/aggregation/aggregation.hpp b/cpp/include/cudf/detail/aggregation/aggregation.hpp index a234f4d3715..08ab9ad6131 100644 --- a/cpp/include/cudf/detail/aggregation/aggregation.hpp +++ b/cpp/include/cudf/detail/aggregation/aggregation.hpp @@ -1158,10 +1158,9 @@ constexpr bool is_sum_product_agg(aggregation::Kind k) // Summing/Multiplying integers of any type, always use int64_t accumulator template -struct target_type_impl< - Source, - k, - std::enable_if_t::value && is_sum_product_agg(k)>> { +struct target_type_impl && is_sum_product_agg(k)>> { using type = int64_t; }; @@ -1179,7 +1178,7 @@ template struct target_type_impl< Source, k, - std::enable_if_t::value && is_sum_product_agg(k)>> { + std::enable_if_t && is_sum_product_agg(k)>> { using type = Source; }; @@ -1539,7 +1538,7 @@ data_type target_type(data_type source_type, aggregation::Kind k); template constexpr inline bool is_valid_aggregation() { - return (not std::is_void>::value); + return (not std::is_void_v>); } /** diff --git a/cpp/include/cudf/detail/nvtx/nvtx3.hpp b/cpp/include/cudf/detail/nvtx/nvtx3.hpp index 0e1a82a0657..fb90ea668f5 100644 --- a/cpp/include/cudf/detail/nvtx/nvtx3.hpp +++ b/cpp/include/cudf/detail/nvtx/nvtx3.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -524,8 +524,8 @@ namespace detail { template constexpr auto has_name_member() noexcept -> decltype(T::name, bool()) { - return (std::is_same::type>::value or - std::is_same::type>::value); + return (std::is_same_v::type> or + std::is_same_v::type>); } } // namespace detail @@ -1728,7 +1728,7 @@ class domain_thread_range { template >::value>> + not std::is_same_v>>> explicit domain_thread_range(First const& first, Args const&... args) noexcept : domain_thread_range{event_attributes{first, args...}} { @@ -1798,7 +1798,7 @@ class domain_process_range { template >::value>> + not std::is_same_v>>> explicit domain_process_range(First const& first, Args const&... args) noexcept : domain_process_range{event_attributes{first, args...}} { diff --git a/cpp/include/cudf/detail/utilities/cuda.cuh b/cpp/include/cudf/detail/utilities/cuda.cuh index 11dbba70c3f..a00bd64caa3 100644 --- a/cpp/include/cudf/detail/utilities/cuda.cuh +++ b/cpp/include/cudf/detail/utilities/cuda.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,7 @@ template __device__ T single_lane_block_sum_reduce(T lane_value) { static_assert(block_size <= 1024, "Invalid block size."); - static_assert(std::is_arithmetic::value, "Invalid non-arithmetic type."); + static_assert(std::is_arithmetic_v, "Invalid non-arithmetic type."); constexpr auto warps_per_block{block_size / warp_size}; auto const lane_id{threadIdx.x % warp_size}; auto const warp_id{threadIdx.x / warp_size}; diff --git a/cpp/include/cudf/detail/utilities/device_atomics.cuh b/cpp/include/cudf/detail/utilities/device_atomics.cuh index b8ea228383d..221e90a9816 100644 --- a/cpp/include/cudf/detail/utilities/device_atomics.cuh +++ b/cpp/include/cudf/detail/utilities/device_atomics.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-20, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -616,7 +616,7 @@ __forceinline__ __device__ T atomicCAS(T* address, T compare, T val) * * @returns The old value at `address` */ -template ::value, T>* = nullptr> +template , T>* = nullptr> __forceinline__ __device__ T atomicAnd(T* address, T val) { return cudf::genericAtomicOperation(address, val, cudf::DeviceAnd{}); @@ -637,7 +637,7 @@ __forceinline__ __device__ T atomicAnd(T* address, T val) * * @returns The old value at `address` */ -template ::value, T>* = nullptr> +template , T>* = nullptr> __forceinline__ __device__ T atomicOr(T* address, T val) { return cudf::genericAtomicOperation(address, val, cudf::DeviceOr{}); @@ -658,7 +658,7 @@ __forceinline__ __device__ T atomicOr(T* address, T val) * * @returns The old value at `address` */ -template ::value, T>* = nullptr> +template , T>* = nullptr> __forceinline__ __device__ T atomicXor(T* address, T val) { return cudf::genericAtomicOperation(address, val, cudf::DeviceXor{}); diff --git a/cpp/include/cudf/detail/utilities/device_operators.cuh b/cpp/include/cudf/detail/utilities/device_operators.cuh index d31f85d6603..9423cb6b998 100644 --- a/cpp/include/cudf/detail/utilities/device_operators.cuh +++ b/cpp/include/cudf/detail/utilities/device_operators.cuh @@ -227,7 +227,7 @@ struct DeviceProduct { * @brief binary `and` operator */ struct DeviceAnd { - template ::value>* = nullptr> + template >* = nullptr> CUDF_HOST_DEVICE inline auto operator()(const T& lhs, const T& rhs) -> decltype(lhs & rhs) { return (lhs & rhs); @@ -238,7 +238,7 @@ struct DeviceAnd { * @brief binary `or` operator */ struct DeviceOr { - template ::value>* = nullptr> + template >* = nullptr> CUDF_HOST_DEVICE inline auto operator()(const T& lhs, const T& rhs) -> decltype(lhs | rhs) { return (lhs | rhs); @@ -249,7 +249,7 @@ struct DeviceOr { * @brief binary `xor` operator */ struct DeviceXor { - template ::value>* = nullptr> + template >* = nullptr> CUDF_HOST_DEVICE inline auto operator()(const T& lhs, const T& rhs) -> decltype(lhs ^ rhs) { return (lhs ^ rhs); diff --git a/cpp/include/cudf/detail/utilities/hash_functions.cuh b/cpp/include/cudf/detail/utilities/hash_functions.cuh index 4ec5f134bb0..6cf1acd2f5a 100644 --- a/cpp/include/cudf/detail/utilities/hash_functions.cuh +++ b/cpp/include/cudf/detail/utilities/hash_functions.cuh @@ -147,7 +147,7 @@ struct MurmurHash3_32 { } // compute wrapper for floating point types - template ::value>* = nullptr> + template >* = nullptr> hash_value_type __device__ inline compute_floating_point(T const& key) const { if (key == T{0.0}) { @@ -304,7 +304,7 @@ struct SparkMurmurHash3_32 { result_type __device__ inline operator()(Key const& key) const { return compute(key); } // compute wrapper for floating point types - template ::value>* = nullptr> + template >* = nullptr> hash_value_type __device__ inline compute_floating_point(T const& key) const { if (std::isnan(key)) { @@ -541,7 +541,7 @@ struct IdentityHash { } template - constexpr std::enable_if_t::value, return_type> operator()( + constexpr std::enable_if_t, return_type> operator()( Key const& key) const { cudf_assert(false && "IdentityHash does not support this data type"); @@ -549,7 +549,7 @@ struct IdentityHash { } template - constexpr std::enable_if_t::value, return_type> operator()( + constexpr std::enable_if_t, return_type> operator()( Key const& key) const { return static_cast(key); diff --git a/cpp/include/cudf/detail/utilities/integer_utils.hpp b/cpp/include/cudf/detail/utilities/integer_utils.hpp index fe501279fd5..40faae7e9f4 100644 --- a/cpp/include/cudf/detail/utilities/integer_utils.hpp +++ b/cpp/include/cudf/detail/utilities/integer_utils.hpp @@ -148,14 +148,14 @@ constexpr I div_rounding_up_safe(std::integral_constant, I dividend, template constexpr I div_rounding_up_safe(I dividend, I divisor) noexcept { - using i_is_a_signed_type = std::integral_constant::value>; + using i_is_a_signed_type = std::integral_constant>; return detail::div_rounding_up_safe(i_is_a_signed_type{}, dividend, divisor); } template constexpr bool is_a_power_of_two(I val) noexcept { - static_assert(std::is_integral::value, "This function only applies to integral types"); + static_assert(std::is_integral_v, "This function only applies to integral types"); return ((val - 1) & val) == 0; } @@ -177,7 +177,7 @@ constexpr bool is_a_power_of_two(I val) noexcept * argument types are: (uint64_t) * @endcode * - * Not all cases could be if-ed out using `std::is_signed::value` and satisfy the compiler. + * Not all cases could be if-ed out using `std::is_signed_v` and satisfy the compiler. * * @param value Numeric value can be either integer or float type. * @return Absolute value if value type is signed. diff --git a/cpp/include/cudf/detail/utilities/vector_factories.hpp b/cpp/include/cudf/detail/utilities/vector_factories.hpp index 1e735719400..2e8b4601062 100644 --- a/cpp/include/cudf/detail/utilities/vector_factories.hpp +++ b/cpp/include/cudf/detail/utilities/vector_factories.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,10 +118,10 @@ rmm::device_uvector make_device_uvector_async( * @param mr The memory resource to use for allocating the returned device_uvector * @return A device_uvector containing the copied data */ -template >::value>* = nullptr> +template < + typename Container, + std::enable_if_t< + std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_async( Container const& c, rmm::cuda_stream_view stream, @@ -173,8 +173,7 @@ rmm::device_uvector make_device_uvector_async( template < typename Container, std::enable_if_t< - std::is_convertible>::value>* = - nullptr> + std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_async( Container const& c, rmm::cuda_stream_view stream, @@ -220,10 +219,10 @@ rmm::device_uvector make_device_uvector_sync( * @param mr The memory resource to use for allocating the returned device_uvector * @return A device_uvector containing the copied data */ -template >::value>* = nullptr> +template < + typename Container, + std::enable_if_t< + std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_sync( Container const& c, rmm::cuda_stream_view stream = rmm::cuda_stream_default, @@ -271,8 +270,7 @@ rmm::device_uvector make_device_uvector_sync( template < typename Container, std::enable_if_t< - std::is_convertible>::value>* = - nullptr> + std::is_convertible_v>>* = nullptr> rmm::device_uvector make_device_uvector_sync( Container const& c, rmm::cuda_stream_view stream = rmm::cuda_stream_default, @@ -323,8 +321,7 @@ std::vector make_std_vector_async(device_span v, rmm::cuda_stream_vi template < typename Container, std::enable_if_t< - std::is_convertible>::value>* = - nullptr> + std::is_convertible_v>>* = nullptr> std::vector make_std_vector_async(Container const& c, rmm::cuda_stream_view stream) { @@ -365,8 +362,7 @@ std::vector make_std_vector_sync(device_span v, rmm::cuda_stream_vie template < typename Container, std::enable_if_t< - std::is_convertible>::value>* = - nullptr> + std::is_convertible_v>>* = nullptr> std::vector make_std_vector_sync( Container const& c, rmm::cuda_stream_view stream = rmm::cuda_stream_default) { @@ -405,8 +401,7 @@ thrust::host_vector make_host_vector_async(device_span v, rmm::cuda_ template < typename Container, std::enable_if_t< - std::is_convertible>::value>* = - nullptr> + std::is_convertible_v>>* = nullptr> thrust::host_vector make_host_vector_async( Container const& c, rmm::cuda_stream_view stream) { @@ -448,8 +443,7 @@ thrust::host_vector make_host_vector_sync( template < typename Container, std::enable_if_t< - std::is_convertible>::value>* = - nullptr> + std::is_convertible_v>>* = nullptr> thrust::host_vector make_host_vector_sync( Container const& c, rmm::cuda_stream_view stream = rmm::cuda_stream_default) { diff --git a/cpp/include/cudf/fixed_point/fixed_point.hpp b/cpp/include/cudf/fixed_point/fixed_point.hpp index f027e2783b1..499d36abe2c 100644 --- a/cpp/include/cudf/fixed_point/fixed_point.hpp +++ b/cpp/include/cudf/fixed_point/fixed_point.hpp @@ -57,7 +57,7 @@ constexpr inline auto is_supported_representation_type() template constexpr inline auto is_supported_construction_value_type() { - return cuda::std::is_integral() || cuda::std::is_floating_point::value; + return cuda::std::is_integral() || cuda::std::is_floating_point_v; } // Helper functions for `fixed_point` type @@ -265,7 +265,7 @@ class fixed_point { * @return The `fixed_point` number in base 10 (aka human readable format) */ template ::value>* = nullptr> + typename cuda::std::enable_if_t>* = nullptr> explicit constexpr operator U() const { return detail::shift(static_cast(_value), scale_type{-_scale}); @@ -277,8 +277,7 @@ class fixed_point { * @tparam U The integral type that is being explicitly converted to * @return The `fixed_point` number in base 10 (aka human readable format) */ - template ::value>* = nullptr> + template >* = nullptr> explicit constexpr operator U() const { // Cast to the larger of the two types (of U and Rep) before converting to Rep because in diff --git a/cpp/include/cudf/table/row_operators.cuh b/cpp/include/cudf/table/row_operators.cuh index 5418d678127..5572c98fa58 100644 --- a/cpp/include/cudf/table/row_operators.cuh +++ b/cpp/include/cudf/table/row_operators.cuh @@ -80,7 +80,7 @@ __device__ weak_ordering compare_elements(Element lhs, Element rhs) * @return Indicates the relationship between the elements in * the `lhs` and `rhs` columns. */ -template ::value>* = nullptr> +template >* = nullptr> __device__ weak_ordering relational_compare(Element lhs, Element rhs) { if (isnan(lhs) and isnan(rhs)) { @@ -123,7 +123,7 @@ inline __device__ auto null_compare(bool lhs_is_null, bool rhs_is_null, null_ord * @return Indicates the relationship between the elements in * the `lhs` and `rhs` columns. */ -template ::value>* = nullptr> +template >* = nullptr> __device__ weak_ordering relational_compare(Element lhs, Element rhs) { return detail::compare_elements(lhs, rhs); @@ -137,7 +137,7 @@ __device__ weak_ordering relational_compare(Element lhs, Element rhs) * @param rhs second element * @return `true` if `lhs` == `rhs` else `false`. */ -template ::value>* = nullptr> +template >* = nullptr> __device__ bool equality_compare(Element lhs, Element rhs) { if (isnan(lhs) and isnan(rhs)) { return true; } @@ -152,7 +152,7 @@ __device__ bool equality_compare(Element lhs, Element rhs) * @param rhs second element * @return `true` if `lhs` == `rhs` else `false`. */ -template ::value>* = nullptr> +template >* = nullptr> __device__ bool equality_compare(Element const lhs, Element const rhs) { return lhs == rhs; diff --git a/cpp/include/cudf/utilities/span.hpp b/cpp/include/cudf/utilities/span.hpp index bfaf4694693..9ccd4d21682 100644 --- a/cpp/include/cudf/utilities/span.hpp +++ b/cpp/include/cudf/utilities/span.hpp @@ -137,9 +137,9 @@ struct host_span : public cudf::detail::span_base::value && - std::is_convertible().data()))> (*)[], - T (*)[]>::value>* = nullptr> + std::is_convertible_v().data()))> (*)[], + T (*)[]>>* = nullptr> constexpr host_span(C& in) : base(in.data(), in.size()) { } @@ -149,9 +149,9 @@ struct host_span : public cudf::detail::span_base::value && - std::is_convertible().data()))> (*)[], - T (*)[]>::value>* = nullptr> + std::is_convertible_v().data()))> (*)[], + T (*)[]>>* = nullptr> constexpr host_span(C const& in) : base(in.data(), in.size()) { } @@ -160,7 +160,7 @@ struct host_span : public cudf::detail::span_base::value, + std::is_convertible_v, void>::type* = nullptr> constexpr host_span(const host_span& other) noexcept : base(other.data(), other.size()) @@ -200,9 +200,9 @@ struct device_span : public cudf::detail::span_base::value && - std::is_convertible().data()))> (*)[], - T (*)[]>::value>* = nullptr> + std::is_convertible_v().data()))> (*)[], + T (*)[]>>* = nullptr> constexpr device_span(C& in) : base(thrust::raw_pointer_cast(in.data()), in.size()) { } @@ -211,9 +211,9 @@ struct device_span : public cudf::detail::span_base::value && - std::is_convertible().data()))> (*)[], - T (*)[]>::value>* = nullptr> + std::is_convertible_v().data()))> (*)[], + T (*)[]>>* = nullptr> constexpr device_span(C const& in) : base(thrust::raw_pointer_cast(in.data()), in.size()) { } @@ -221,7 +221,7 @@ struct device_span : public cudf::detail::span_base::value, + std::is_convertible_v, void>::type* = nullptr> constexpr device_span(const device_span& other) noexcept : base(other.data(), other.size()) @@ -283,8 +283,8 @@ class base_2dspan { template typename OtherRowType, - typename std::enable_if, - RowType>::value, + typename std::enable_if, + RowType>, void>::type* = nullptr> constexpr base_2dspan(base_2dspan const& other) noexcept : _data{other.data()}, _size{other.size()} diff --git a/cpp/include/cudf/utilities/traits.hpp b/cpp/include/cudf/utilities/traits.hpp index 0b3b3a5df76..f1ad11a9030 100644 --- a/cpp/include/cudf/utilities/traits.hpp +++ b/cpp/include/cudf/utilities/traits.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ using void_t = void; * Example: * \code{cpp} * // This function will participate in overload resolution only if T is an integral type - * template ::value)> + * template )> * void foo(); * \endcode * @@ -218,7 +218,7 @@ constexpr inline bool is_numeric(data_type type) template constexpr inline bool is_index_type() { - return std::is_integral::value and not std::is_same_v; + return std::is_integral_v and not std::is_same_v; } struct is_index_type_impl { @@ -255,7 +255,7 @@ constexpr inline bool is_index_type(data_type type) template constexpr inline bool is_unsigned() { - return std::is_unsigned::value; + return std::is_unsigned_v; } struct is_unsigned_impl { @@ -288,7 +288,7 @@ constexpr inline bool is_unsigned(data_type type) template constexpr inline bool is_signed_iterator() { - return std::is_signed::value_type>::value; + return std::is_signed_v::value_type>; } /** @@ -301,7 +301,7 @@ constexpr inline bool is_signed_iterator() template constexpr inline bool is_floating_point() { - return std::is_floating_point::value; + return std::is_floating_point_v; } struct is_floating_point_impl { diff --git a/cpp/include/cudf/utilities/type_dispatcher.hpp b/cpp/include/cudf/utilities/type_dispatcher.hpp index 0c6a6ee244c..7b111b11eb4 100644 --- a/cpp/include/cudf/utilities/type_dispatcher.hpp +++ b/cpp/include/cudf/utilities/type_dispatcher.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -382,17 +382,17 @@ using scalar_device_type_t = typename type_to_scalar_type_impl::ScalarDeviceT * @code * struct integral_or_floating_point { * template ::value and - * not std::is_floating_point::value>* = nullptr> + * std::enable_if_t and + * not std::is_floating_point_v >* = nullptr> * void operator()() { * std::cout << "neither integral nor floating point\n "; } * * template ::value>* = nullptr> + * std::enable_if_t >* = nullptr> * void operator()() { std::cout << "integral\n"; } * * template ::value>* = nullptr> + * std::enable_if_t >* = nullptr> * void operator()() { std::cout << "floating point\n"; } * }; * @endcode diff --git a/cpp/include/cudf_test/base_fixture.hpp b/cpp/include/cudf_test/base_fixture.hpp index e08bf6aa53a..2307f18994b 100644 --- a/cpp/include/cudf_test/base_fixture.hpp +++ b/cpp/include/cudf_test/base_fixture.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,7 +59,7 @@ template struct uniform_distribution_impl { }; template -struct uniform_distribution_impl::value>> { +struct uniform_distribution_impl>> { using type = std::uniform_int_distribution; }; @@ -69,7 +69,7 @@ struct uniform_distribution_impl { }; template -struct uniform_distribution_impl::value>> { +struct uniform_distribution_impl>> { using type = std::uniform_real_distribution; }; diff --git a/cpp/include/cudf_test/column_wrapper.hpp b/cpp/include/cudf_test/column_wrapper.hpp index ccfdde2270c..c190105e292 100644 --- a/cpp/include/cudf_test/column_wrapper.hpp +++ b/cpp/include/cudf_test/column_wrapper.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,7 +106,7 @@ struct fixed_width_type_converter { typename ToT = To, typename std::enable_if && (cudf::is_convertible::value || - std::is_constructible::value), + std::is_constructible_v), void>::type* = nullptr> constexpr ToT operator()(FromT element) const { @@ -114,11 +114,10 @@ struct fixed_width_type_converter { } // Convert integral values to timestamps - template < - typename FromT = From, - typename ToT = To, - typename std::enable_if::value && cudf::is_timestamp_t::value, - void>::type* = nullptr> + template && cudf::is_timestamp(), + void>::type* = nullptr> constexpr ToT operator()(FromT element) const { return ToT{typename ToT::duration{element}}; diff --git a/cpp/include/cudf_test/type_lists.hpp b/cpp/include/cudf_test/type_lists.hpp index 3c46b912639..e84417c91d6 100644 --- a/cpp/include/cudf_test/type_lists.hpp +++ b/cpp/include/cudf_test/type_lists.hpp @@ -87,9 +87,7 @@ make_type_param_vector(std::initializer_list const& init_list) { thrust::host_vector vec(init_list.size()); std::transform(std::cbegin(init_list), std::cend(init_list), std::begin(vec), [](auto const& e) { - if constexpr (std::is_unsigned::value) { - return static_cast(std::abs(e)); - } + if constexpr (std::is_unsigned_v) { return static_cast(std::abs(e)); } return static_cast(e); }); return vec; diff --git a/cpp/src/filling/repeat.cu b/cpp/src/filling/repeat.cu index af9fc300ed2..188316d22cd 100644 --- a/cpp/src/filling/repeat.cu +++ b/cpp/src/filling/repeat.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,8 +47,7 @@ struct count_accessor { cudf::scalar const* p_scalar = nullptr; template - std::enable_if_t::value, cudf::size_type> operator()( - rmm::cuda_stream_view stream) + std::enable_if_t, cudf::size_type> operator()(rmm::cuda_stream_view stream) { using ScalarType = cudf::scalar_type_t; #if 1 @@ -65,8 +64,7 @@ struct count_accessor { } template - std::enable_if_t::value, cudf::size_type> operator()( - rmm::cuda_stream_view) + std::enable_if_t, cudf::size_type> operator()(rmm::cuda_stream_view) { CUDF_FAIL("count value should be a integral type."); } @@ -76,7 +74,7 @@ struct count_checker { cudf::column_view const& count; template - std::enable_if_t::value, void> operator()(rmm::cuda_stream_view stream) + std::enable_if_t, void> operator()(rmm::cuda_stream_view stream) { // static_cast is necessary due to bool if (static_cast(std::numeric_limits::max()) > @@ -89,7 +87,7 @@ struct count_checker { } template - std::enable_if_t::value, void> operator()(rmm::cuda_stream_view) + std::enable_if_t, void> operator()(rmm::cuda_stream_view) { CUDF_FAIL("count value type should be integral."); } diff --git a/cpp/src/groupby/sort/group_m2.cu b/cpp/src/groupby/sort/group_m2.cu index a72f6c6f647..edc8b089120 100644 --- a/cpp/src/groupby/sort/group_m2.cu +++ b/cpp/src/groupby/sort/group_m2.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ void compute_m2_fn(column_device_view const& values, struct m2_functor { template - std::enable_if_t::value, std::unique_ptr> operator()( + std::enable_if_t, std::unique_ptr> operator()( column_view const& values, column_view const& group_means, cudf::device_span group_labels, @@ -115,7 +115,7 @@ struct m2_functor { } template - std::enable_if_t::value, std::unique_ptr> operator()(Args&&...) + std::enable_if_t, std::unique_ptr> operator()(Args&&...) { CUDF_FAIL("Only numeric types are supported in M2 groupby aggregation"); } diff --git a/cpp/src/groupby/sort/group_quantiles.cu b/cpp/src/groupby/sort/group_quantiles.cu index b910c96731c..86f35cb043a 100644 --- a/cpp/src/groupby/sort/group_quantiles.cu +++ b/cpp/src/groupby/sort/group_quantiles.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,7 +76,7 @@ struct calculate_quantile_fn { struct quantiles_functor { template - std::enable_if_t::value, std::unique_ptr> operator()( + std::enable_if_t, std::unique_ptr> operator()( column_view const& values, column_view const& group_sizes, cudf::device_span group_offsets, @@ -135,7 +135,7 @@ struct quantiles_functor { } template - std::enable_if_t::value, std::unique_ptr> operator()(Args&&...) + std::enable_if_t, std::unique_ptr> operator()(Args&&...) { CUDF_FAIL("Only arithmetic types are supported in quantiles"); } diff --git a/cpp/src/groupby/sort/group_std.cu b/cpp/src/groupby/sort/group_std.cu index 50e3b812b62..4437e585d0d 100644 --- a/cpp/src/groupby/sort/group_std.cu +++ b/cpp/src/groupby/sort/group_std.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,7 @@ void reduce_by_key_fn(column_device_view const& values, struct var_functor { template - std::enable_if_t::value, std::unique_ptr> operator()( + std::enable_if_t, std::unique_ptr> operator()( column_view const& values, column_view const& group_means, column_view const& group_sizes, @@ -144,7 +144,7 @@ struct var_functor { } template - std::enable_if_t::value, std::unique_ptr> operator()(Args&&...) + std::enable_if_t, std::unique_ptr> operator()(Args&&...) { CUDF_FAIL("Only numeric types are supported in std/variance"); } diff --git a/cpp/src/hash/concurrent_unordered_map.cuh b/cpp/src/hash/concurrent_unordered_map.cuh index 64ab69cd377..0ae0baa9908 100644 --- a/cpp/src/hash/concurrent_unordered_map.cuh +++ b/cpp/src/hash/concurrent_unordered_map.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,8 +73,8 @@ template constexpr bool is_packable() { - return std::is_integral::value and std::is_integral::value and - not std::is_void>::value and + return std::is_integral_v and std::is_integral_v and + not std::is_void_v> and std::has_unique_object_representations_v; } diff --git a/cpp/src/interop/dlpack.cpp b/cpp/src/interop/dlpack.cpp index f368ae9fab5..01ca32e6a2f 100644 --- a/cpp/src/interop/dlpack.cpp +++ b/cpp/src/interop/dlpack.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,9 +91,9 @@ struct data_type_to_DLDataType_impl { { uint8_t const bits{sizeof(T) * 8}; uint16_t const lanes{1}; - if (std::is_floating_point::value) { + if (std::is_floating_point_v) { return DLDataType{kDLFloat, bits, lanes}; - } else if (std::is_signed::value) { + } else if (std::is_signed_v) { return DLDataType{kDLInt, bits, lanes}; } else { return DLDataType{kDLUInt, bits, lanes}; diff --git a/cpp/src/io/csv/writer_impl.cu b/cpp/src/io/csv/writer_impl.cu index 1517226952a..ac60c086241 100644 --- a/cpp/src/io/csv/writer_impl.cu +++ b/cpp/src/io/csv/writer_impl.cu @@ -131,10 +131,10 @@ struct column_to_strings_fn { // Note: the case (not std::is_same_v) // is already covered by is_integral) // - return not( - (std::is_same_v) || (std::is_integral::value) || - (std::is_floating_point::value) || (cudf::is_fixed_point()) || - (cudf::is_timestamp()) || (cudf::is_duration())); + return not((std::is_same_v) || + (std::is_integral_v) || (std::is_floating_point_v) || + (cudf::is_fixed_point()) || (cudf::is_timestamp()) || + (cudf::is_duration())); } explicit column_to_strings_fn(csv_writer_options const& options, @@ -185,7 +185,7 @@ struct column_to_strings_fn { // ints: // template - std::enable_if_t::value && !std::is_same_v, + std::enable_if_t && !std::is_same_v, std::unique_ptr> operator()(column_view const& column) const { @@ -195,7 +195,7 @@ struct column_to_strings_fn { // floats: // template - std::enable_if_t::value, std::unique_ptr> operator()( + std::enable_if_t, std::unique_ptr> operator()( column_view const& column) const { return cudf::strings::detail::from_floats(column, stream_, mr_); diff --git a/cpp/src/io/json/json_gpu.cu b/cpp/src/io/json/json_gpu.cu index c655d18a4df..5cf0b03a6f1 100644 --- a/cpp/src/io/json/json_gpu.cu +++ b/cpp/src/io/json/json_gpu.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -216,7 +216,7 @@ struct ConvertFunctor { * It is handled here rather than within convertStrToValue() as that function * is used by other types (ex. timestamp) that aren't 'booleable'. */ - template ::value>* = nullptr> + template >* = nullptr> __host__ __device__ __forceinline__ bool operator()(char const* begin, char const* end, void* output_column, @@ -240,7 +240,7 @@ struct ConvertFunctor { * @brief Dispatch for floating points, which are set to NaN if the input * is not valid. In such case, the validity mask is set to zero too. */ - template ::value>* = nullptr> + template >* = nullptr> __host__ __device__ __forceinline__ bool operator()(char const* begin, char const* end, void* out_buffer, @@ -257,9 +257,9 @@ struct ConvertFunctor { * @brief Default template operator() dispatch specialization all data types * (including wrapper types) that is not covered by above. */ - template ::value and - !std::is_integral::value>* = nullptr> + template < + typename T, + typename std::enable_if_t and !std::is_integral_v>* = nullptr> __host__ __device__ __forceinline__ bool operator()(char const* begin, char const* end, void* output_column, diff --git a/cpp/src/io/orc/orc.h b/cpp/src/io/orc/orc.h index 311f18bf72e..386e3d8d73a 100644 --- a/cpp/src/io/orc/orc.h +++ b/cpp/src/io/orc/orc.h @@ -137,17 +137,17 @@ int inline constexpr encode_field_number(int field_number, ProtofType field_type } namespace { -template ::value and - !std::is_enum::value>* = nullptr> +template < + typename base_t, + typename std::enable_if_t and !std::is_enum_v>* = nullptr> int static constexpr encode_field_number_base(int field_number) noexcept { return encode_field_number(field_number, ProtofType::FIXEDLEN); } -template ::value or - std::is_enum::value>* = nullptr> +template < + typename base_t, + typename std::enable_if_t or std::is_enum_v>* = nullptr> int static constexpr encode_field_number_base(int field_number) noexcept { return encode_field_number(field_number, ProtofType::VARINT); @@ -168,7 +168,7 @@ int static constexpr encode_field_number_base(int field_number) noexcept template < typename T, - typename std::enable_if_t::value or std::is_same_v>* = nullptr> + typename std::enable_if_t or std::is_same_v>* = nullptr> int constexpr encode_field_number(int field_number) noexcept { return encode_field_number_base(field_number); @@ -177,16 +177,16 @@ int constexpr encode_field_number(int field_number) noexcept // containters change the field number encoding template < typename T, - typename std::enable_if_t>::value>* = nullptr> + typename std::enable_if_t>>* = nullptr> int constexpr encode_field_number(int field_number) noexcept { return encode_field_number_base(field_number); } // optional fields don't change the field number encoding -template >::value>* = nullptr> +template < + typename T, + typename std::enable_if_t>>* = nullptr> int constexpr encode_field_number(int field_number) noexcept { return encode_field_number_base(field_number); @@ -244,13 +244,13 @@ class ProtobufReader { uint32_t read_field_size(const uint8_t* end); - template ::value>* = nullptr> + template >* = nullptr> void read_field(T& value, const uint8_t* end) { value = get(); } - template ::value>* = nullptr> + template >* = nullptr> void read_field(T& value, const uint8_t* end) { value = static_cast(get()); @@ -265,7 +265,7 @@ class ProtobufReader { } template >::value>* = nullptr> + typename std::enable_if_t>>* = nullptr> void read_field(T& value, const uint8_t* end) { auto const size = read_field_size(end); @@ -275,7 +275,7 @@ class ProtobufReader { template < typename T, - typename std::enable_if_t>::value and + typename std::enable_if_t> and !std::is_same_v>* = nullptr> void read_field(T& value, const uint8_t* end) { @@ -284,9 +284,9 @@ class ProtobufReader { read(value.back(), size); } - template >::value>* = nullptr> + template < + typename T, + typename std::enable_if_t>>* = nullptr> void read_field(T& value, const uint8_t* end) { typename T::value_type contained_value; @@ -301,7 +301,7 @@ class ProtobufReader { read(value, size); } - template ::value>* = nullptr> + template >* = nullptr> void read_field(T& value, const uint8_t* end) { memcpy(&value, m_cur, sizeof(T)); diff --git a/cpp/src/io/parquet/parquet.hpp b/cpp/src/io/parquet/parquet.hpp index b4fa9b4ae82..10ae241d4ce 100644 --- a/cpp/src/io/parquet/parquet.hpp +++ b/cpp/src/io/parquet/parquet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, NVIDIA CORPORATION. + * Copyright (c) 2018-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -696,9 +696,9 @@ struct ParquetFieldUnionFunctor { }; template -ParquetFieldUnionFunctor::value> ParquetFieldUnion(int f, bool& b, T& v) +ParquetFieldUnionFunctor> ParquetFieldUnion(int f, bool& b, T& v) { - return ParquetFieldUnionFunctor::value>(f, b, v); + return ParquetFieldUnionFunctor>(f, b, v); } /** diff --git a/cpp/src/io/utilities/parsing_utils.cuh b/cpp/src/io/utilities/parsing_utils.cuh index 878b36191ac..d1b2e2862c6 100644 --- a/cpp/src/io/utilities/parsing_utils.cuh +++ b/cpp/src/io/utilities/parsing_utils.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,7 +98,7 @@ struct parse_options { * * @return uint8_t Numeric value of the character, or `0` */ -template ::value>* = nullptr> +template >* = nullptr> constexpr uint8_t decode_digit(char c, bool* valid_flag) { if (c >= '0' && c <= '9') return c - '0'; @@ -119,7 +119,7 @@ constexpr uint8_t decode_digit(char c, bool* valid_flag) * * @return uint8_t Numeric value of the character, or `0` */ -template ::value>* = nullptr> +template >* = nullptr> constexpr uint8_t decode_digit(char c, bool* valid_flag) { if (c >= '0' && c <= '9') return c - '0'; @@ -177,7 +177,7 @@ constexpr T parse_numeric(const char* begin, int32_t sign = (*begin == '-') ? -1 : 1; // Handle infinity - if (std::is_floating_point::value && is_infinity(begin, end)) { + if (std::is_floating_point_v && is_infinity(begin, end)) { return sign * std::numeric_limits::infinity(); } if (*begin == '-' || *begin == '+') begin++; @@ -199,7 +199,7 @@ constexpr T parse_numeric(const char* begin, ++begin; } - if (std::is_floating_point::value) { + if (std::is_floating_point_v) { // Handle fractional part of the number if necessary double divisor = 1; while (begin < end) { diff --git a/cpp/src/quantiles/quantile.cu b/cpp/src/quantiles/quantile.cu index dbb66ec295c..ce748cdd6f9 100644 --- a/cpp/src/quantiles/quantile.cu +++ b/cpp/src/quantiles/quantile.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ struct quantile_functor { rmm::mr::device_memory_resource* mr; template - std::enable_if_t::value and not cudf::is_fixed_point(), + std::enable_if_t and not cudf::is_fixed_point(), std::unique_ptr> operator()(column_view const& input) { @@ -59,8 +59,7 @@ struct quantile_functor { } template - std::enable_if_t::value or cudf::is_fixed_point(), - std::unique_ptr> + std::enable_if_t or cudf::is_fixed_point(), std::unique_ptr> operator()(column_view const& input) { using StorageType = cudf::device_storage_type_t; diff --git a/cpp/src/reductions/all.cu b/cpp/src/reductions/all.cu index 81e63278e4e..3a076c3b780 100644 --- a/cpp/src/reductions/all.cu +++ b/cpp/src/reductions/all.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ struct all_fn { bool* d_result; }; - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -63,7 +63,7 @@ struct all_fn { all_true_fn{iter, result->data()}); return result; } - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) diff --git a/cpp/src/reductions/any.cu b/cpp/src/reductions/any.cu index ceeef017768..1eb080cfe20 100644 --- a/cpp/src/reductions/any.cu +++ b/cpp/src/reductions/any.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ struct any_fn { bool* d_result; }; - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -63,7 +63,7 @@ struct any_fn { any_true_fn{iter, result->data()}); return result; } - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) diff --git a/cpp/src/reductions/compound.cuh b/cpp/src/reductions/compound.cuh index 34d8912bc41..c60c819f8e2 100644 --- a/cpp/src/reductions/compound.cuh +++ b/cpp/src/reductions/compound.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ struct result_type_dispatcher { { // the operator `mean`, `var`, `std` only accepts // floating points as output dtype - return std::is_floating_point::value; + return std::is_floating_point_v; } public: @@ -124,7 +124,7 @@ struct element_type_dispatcher { template static constexpr bool is_supported_v() { - return std::is_arithmetic::value; + return std::is_arithmetic_v; } public: diff --git a/cpp/src/reductions/scan/scan_exclusive.cu b/cpp/src/reductions/scan/scan_exclusive.cu index 3cae782d18f..bf9b06a3602 100644 --- a/cpp/src/reductions/scan/scan_exclusive.cu +++ b/cpp/src/reductions/scan/scan_exclusive.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ struct scan_dispatcher { * @param mr Device memory resource used to allocate the returned column's device memory * @return Output column with scan results */ - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const& input, null_policy, rmm::cuda_stream_view stream, @@ -72,8 +72,7 @@ struct scan_dispatcher { } template - std::enable_if_t::value, std::unique_ptr> operator()( - Args&&...) + std::enable_if_t, std::unique_ptr> operator()(Args&&...) { CUDF_FAIL("Non-arithmetic types not supported for exclusive scan"); } diff --git a/cpp/src/reductions/simple.cuh b/cpp/src/reductions/simple.cuh index 8f76a320b7e..7dc8e6cb2c4 100644 --- a/cpp/src/reductions/simple.cuh +++ b/cpp/src/reductions/simple.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -226,8 +226,7 @@ struct cast_numeric_scalar_fn { */ template struct bool_result_element_dispatcher { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const& col, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -236,7 +235,7 @@ struct bool_result_element_dispatcher { } template ::value>* = nullptr> + std::enable_if_t>* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) @@ -354,7 +353,7 @@ struct element_type_dispatcher { * @brief Specialization for reducing floating-point column types to any output type. */ template ::value>* = nullptr> + typename std::enable_if_t>* = nullptr> std::unique_ptr reduce_numeric(column_view const& col, data_type const output_type, rmm::cuda_stream_view stream, @@ -377,7 +376,7 @@ struct element_type_dispatcher { * @brief Specialization for reducing integer column types to any output type. */ template ::value>* = nullptr> + typename std::enable_if_t>* = nullptr> std::unique_ptr reduce_numeric(column_view const& col, data_type const output_type, rmm::cuda_stream_view stream, diff --git a/cpp/src/replace/nans.cu b/cpp/src/replace/nans.cu index 537b2f3d092..020e444cedc 100644 --- a/cpp/src/replace/nans.cu +++ b/cpp/src/replace/nans.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ namespace { struct replace_nans_functor { template - std::enable_if_t::value, std::unique_ptr> operator()( + std::enable_if_t, std::unique_ptr> operator()( column_view const& input, Replacement const& replacement, bool replacement_nullable, @@ -70,7 +70,7 @@ struct replace_nans_functor { } template - std::enable_if_t::value, std::unique_ptr> operator()(Args&&...) + std::enable_if_t, std::unique_ptr> operator()(Args&&...) { CUDF_FAIL("NAN is not supported in a Non-floating point type column"); } @@ -144,7 +144,7 @@ struct normalize_nans_and_zeros_lambda { */ struct normalize_nans_and_zeros_kernel_forwarder { // floats and doubles. what we really care about. - template ::value>* = nullptr> + template >* = nullptr> void operator()(cudf::column_device_view in, cudf::mutable_column_device_view out, rmm::cuda_stream_view stream) @@ -158,7 +158,7 @@ struct normalize_nans_and_zeros_kernel_forwarder { // if we get in here for anything but a float or double, that's a problem. template - std::enable_if_t::value, void> operator()(Args&&...) + std::enable_if_t, void> operator()(Args&&...) { CUDF_FAIL("Unexpected non floating-point type."); } diff --git a/cpp/src/reshape/byte_cast.cu b/cpp/src/reshape/byte_cast.cu index 1ffc1ad5259..6bfd4938a96 100644 --- a/cpp/src/reshape/byte_cast.cu +++ b/cpp/src/reshape/byte_cast.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ struct byte_list_conversion { * @brief Function object for converting primitive types and string columns to lists of bytes. */ template - std::enable_if_t::value and !is_floating_point(), std::unique_ptr> + std::enable_if_t and !is_floating_point(), std::unique_ptr> operator()(column_view const&, flip_endianness, rmm::cuda_stream_view, @@ -43,7 +43,7 @@ struct byte_list_conversion { } template - std::enable_if_t() or std::is_integral::value, std::unique_ptr> + std::enable_if_t() or std::is_integral_v, std::unique_ptr> operator()(column_view const& input_column, flip_endianness configuration, rmm::cuda_stream_view stream, diff --git a/cpp/src/rolling/range_window_bounds.cpp b/cpp/src/rolling/range_window_bounds.cpp index dd147c99614..fd41939e9a4 100644 --- a/cpp/src/rolling/range_window_bounds.cpp +++ b/cpp/src/rolling/range_window_bounds.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ struct range_scalar_constructor { } template ::value && !cudf::is_boolean(), void>* = nullptr> + std::enable_if_t && !cudf::is_boolean(), void>* = nullptr> std::unique_ptr operator()(scalar const& range_scalar_) const { return std::make_unique>( diff --git a/cpp/src/rolling/range_window_bounds_detail.hpp b/cpp/src/rolling/range_window_bounds_detail.hpp index e09e474d9de..a2bc13084ae 100644 --- a/cpp/src/rolling/range_window_bounds_detail.hpp +++ b/cpp/src/rolling/range_window_bounds_detail.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ template constexpr bool is_supported_range_type() { return cudf::is_duration() || - (std::is_integral::value && !cudf::is_boolean()); + (std::is_integral_v && !cudf::is_boolean()); } /// Checks if the specified type is a supported target type, @@ -37,7 +37,7 @@ template constexpr bool is_supported_order_by_column_type() { return cudf::is_timestamp() || - (std::is_integral::value && !cudf::is_boolean()); + (std::is_integral_v && !cudf::is_boolean()); } /// Range-comparable representation type for an orderby column type. @@ -57,7 +57,7 @@ struct range_type_impl { template struct range_type_impl< ColumnType, - std::enable_if_t::value && !cudf::is_boolean(), void>> { + std::enable_if_t && !cudf::is_boolean(), void>> { using type = ColumnType; using rep_type = ColumnType; }; @@ -88,7 +88,7 @@ void assert_non_negative(T const& value) template < typename RangeT, typename RepT, - std::enable_if_t::value && !cudf::is_boolean(), void>* = nullptr> + std::enable_if_t && !cudf::is_boolean(), void>* = nullptr> RepT range_comparable_value_impl(scalar const& range_scalar, rmm::cuda_stream_view stream) { auto val = static_cast const&>(range_scalar).value(stream); diff --git a/cpp/src/round/round.cu b/cpp/src/round/round.cu index 5fc75bdfa1b..81bf03f7c0a 100644 --- a/cpp/src/round/round.cu +++ b/cpp/src/round/round.cu @@ -49,26 +49,26 @@ inline double __device__ generic_round_half_even(double d) { return rint(d); } inline float __device__ generic_modf(float a, float* b) { return modff(a, b); } inline double __device__ generic_modf(double a, double* b) { return modf(a, b); } -template ::value>* = nullptr> +template >* = nullptr> T __device__ generic_abs(T value) { return numeric::detail::abs(value); } -template ::value>* = nullptr> +template >* = nullptr> T __device__ generic_abs(T value) { return value; } -template ::value>* = nullptr> +template >* = nullptr> int16_t __device__ generic_sign(T value) { return value < 0 ? -1 : 1; } // this is needed to suppress warning: pointless comparison of unsigned integer with zero -template ::value>* = nullptr> +template >* = nullptr> int16_t __device__ generic_sign(T) { return 1; @@ -89,7 +89,7 @@ struct half_up_zero { return generic_round(e); } - template ::value>* = nullptr> + template >* = nullptr> __device__ U operator()(U) { assert(false); // Should never get here. Just for compilation @@ -108,7 +108,7 @@ struct half_up_positive { return integer_part + generic_round(fractional_part * n) / n; } - template ::value>* = nullptr> + template >* = nullptr> __device__ U operator()(U) { assert(false); // Should never get here. Just for compilation @@ -125,7 +125,7 @@ struct half_up_negative { return generic_round(e / n) * n; } - template ::value>* = nullptr> + template >* = nullptr> __device__ U operator()(U e) { auto const down = (e / n) * n; // result from rounding down @@ -142,7 +142,7 @@ struct half_even_zero { return generic_round_half_even(e); } - template ::value>* = nullptr> + template >* = nullptr> __device__ U operator()(U) { assert(false); // Should never get here. Just for compilation @@ -161,7 +161,7 @@ struct half_even_positive { return integer_part + generic_round_half_even(fractional_part * n) / n; } - template ::value>* = nullptr> + template >* = nullptr> __device__ U operator()(U) { assert(false); // Should never get here. Just for compilation @@ -178,7 +178,7 @@ struct half_even_negative { return generic_round_half_even(e / n) * n; } - template ::value>* = nullptr> + template >* = nullptr> __device__ U operator()(U e) { auto const down_over_n = e / n; // use this to determine HALF_EVEN case @@ -213,7 +213,7 @@ std::unique_ptr round_with(column_view const& input, { using Functor = RoundFunctor; - if (decimal_places >= 0 && std::is_integral::value) + if (decimal_places >= 0 && std::is_integral_v) return std::make_unique(input, stream, mr); auto result = cudf::make_fixed_width_column( diff --git a/cpp/src/stream_compaction/drop_nans.cu b/cpp/src/stream_compaction/drop_nans.cu index 8105720b390..861b9ad8606 100644 --- a/cpp/src/stream_compaction/drop_nans.cu +++ b/cpp/src/stream_compaction/drop_nans.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,14 +29,14 @@ namespace { struct dispatch_is_not_nan { template - std::enable_if_t::value, bool> __device__ + std::enable_if_t, bool> __device__ operator()(cudf::column_device_view col_device_view, cudf::size_type i) { return col_device_view.is_valid(i) ? not std::isnan(col_device_view.element(i)) : true; } template - std::enable_if_t::value, bool> __device__ + std::enable_if_t, bool> __device__ operator()(cudf::column_device_view, cudf::size_type) { return true; diff --git a/cpp/src/strings/convert/convert_floats.cu b/cpp/src/strings/convert/convert_floats.cu index 70b5f528213..5316c0d46cb 100644 --- a/cpp/src/strings/convert/convert_floats.cu +++ b/cpp/src/strings/convert/convert_floats.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -158,8 +158,7 @@ struct string_to_float_fn { * The output_column is expected to be one of the float types only. */ struct dispatch_to_floats_fn { - template ::value>* = nullptr> + template >* = nullptr> void operator()(column_device_view const& strings_column, mutable_column_view& output_column, rmm::cuda_stream_view stream) const @@ -172,7 +171,7 @@ struct dispatch_to_floats_fn { string_to_float_fn{strings_column}); } // non-integral types throw an exception - template ::value>* = nullptr> + template >* = nullptr> void operator()(column_device_view const&, mutable_column_view&, rmm::cuda_stream_view) const { CUDF_FAIL("Output for to_floats must be a float type."); @@ -474,8 +473,7 @@ struct float_to_string_fn { * The template function declaration ensures only float types are allowed. */ struct dispatch_from_floats_fn { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const& floats, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) const @@ -512,7 +510,7 @@ struct dispatch_from_floats_fn { } // non-float types throw an exception - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) const diff --git a/cpp/src/strings/convert/convert_hex.cu b/cpp/src/strings/convert/convert_hex.cu index e6edcde2d48..3bcfe92f364 100644 --- a/cpp/src/strings/convert/convert_hex.cu +++ b/cpp/src/strings/convert/convert_hex.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,7 +90,7 @@ struct hex_to_integer_fn { * The output_column is expected to be one of the integer types only. */ struct dispatch_hex_to_integers_fn { - template ::value>* = nullptr> + template >* = nullptr> void operator()(column_device_view const& strings_column, mutable_column_view& output_column, rmm::cuda_stream_view stream) const @@ -104,7 +104,7 @@ struct dispatch_hex_to_integers_fn { } // non-integral types throw an exception template - std::enable_if_t::value, void> operator()(Args&&...) const + std::enable_if_t, void> operator()(Args&&...) const { CUDF_FAIL("Output for hex_to_integers must be an integral type."); } diff --git a/cpp/src/strings/convert/convert_integers.cu b/cpp/src/strings/convert/convert_integers.cu index 072e367e19a..7540154d93d 100644 --- a/cpp/src/strings/convert/convert_integers.cu +++ b/cpp/src/strings/convert/convert_integers.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ struct string_to_integer_check_fn { if (!p.second || p.first.empty()) { return false; } auto const d_str = p.first.data(); - if (d_str[0] == '-' && std::is_unsigned::value) { return false; } + if (d_str[0] == '-' && std::is_unsigned_v) { return false; } auto iter = d_str + static_cast((d_str[0] == '-' || d_str[0] == '+')); auto const iter_end = d_str + p.first.size_bytes(); @@ -82,7 +82,7 @@ struct string_to_integer_check_fn { * @brief The dispatch functions for checking if strings are valid integers. */ struct dispatch_is_integer_fn { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(strings_column_view const& strings, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) const @@ -116,7 +116,7 @@ struct dispatch_is_integer_fn { return results; } - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(strings_column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) const @@ -217,7 +217,7 @@ struct string_to_integer_fn { * The output_column is expected to be one of the integer types only. */ struct dispatch_to_integers_fn { - template ::value>* = nullptr> + template >* = nullptr> void operator()(column_device_view const& strings_column, mutable_column_view& output_column, rmm::cuda_stream_view stream) const @@ -229,7 +229,7 @@ struct dispatch_to_integers_fn { string_to_integer_fn{strings_column}); } // non-integral types throw an exception - template ::value>* = nullptr> + template >* = nullptr> void operator()(column_device_view const&, mutable_column_view&, rmm::cuda_stream_view) const { CUDF_FAIL("Output for to_integers must be an integral type."); @@ -329,7 +329,7 @@ struct integer_to_string_fn { * The template function declaration ensures only integer types are used. */ struct dispatch_from_integers_fn { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const& integers, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) const @@ -366,7 +366,7 @@ struct dispatch_from_integers_fn { } // non-integral types throw an exception - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(column_view const&, rmm::cuda_stream_view, rmm::mr::device_memory_resource*) const diff --git a/cpp/src/transform/nans_to_nulls.cu b/cpp/src/transform/nans_to_nulls.cu index 93a7521546d..abe481ced70 100644 --- a/cpp/src/transform/nans_to_nulls.cu +++ b/cpp/src/transform/nans_to_nulls.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ namespace cudf { namespace detail { struct dispatch_nan_to_null { template - std::enable_if_t::value, + std::enable_if_t, std::pair, cudf::size_type>> operator()(column_view const& input, rmm::cuda_stream_view stream, @@ -70,7 +70,7 @@ struct dispatch_nan_to_null { } template - std::enable_if_t::value, + std::enable_if_t, std::pair, cudf::size_type>> operator()(column_view const& input, rmm::cuda_stream_view stream, diff --git a/cpp/src/unary/math_ops.cu b/cpp/src/unary/math_ops.cu index a938fc4d650..474c7b76ddc 100644 --- a/cpp/src/unary/math_ops.cu +++ b/cpp/src/unary/math_ops.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,12 +184,12 @@ struct DeviceFloor { struct DeviceAbs { template - std::enable_if_t::value, T> __device__ operator()(T data) + std::enable_if_t, T> __device__ operator()(T data) { return std::abs(data); } template - std::enable_if_t::value, T> __device__ operator()(T data) + std::enable_if_t, T> __device__ operator()(T data) { return data; } @@ -197,14 +197,14 @@ struct DeviceAbs { struct DeviceRInt { template - std::enable_if_t::value, T> __device__ operator()(T data) + std::enable_if_t, T> __device__ operator()(T data) { return std::rint(data); } // Dummy to handle other types, will never be executed template - std::enable_if_t::value, T> __device__ operator()(T data) + std::enable_if_t, T> __device__ operator()(T data) { return data; } @@ -284,8 +284,8 @@ std::unique_ptr unary_op_with(column_view const& input, // When scale is >= 0 and unary_operator is CEIL or FLOOR, the unary_operation is a no-op if (input.type().scale() >= 0 && - (std::is_same>::value || - std::is_same>::value)) + (std::is_same_v> || + std::is_same_v>)) return std::make_unique(input, stream, mr); auto result = cudf::make_fixed_width_column( @@ -348,7 +348,7 @@ std::unique_ptr transform_fn(cudf::dictionary_column_view const& i template struct MathOpDispatcher { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(cudf::column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -362,7 +362,7 @@ struct MathOpDispatcher { } struct dictionary_dispatch { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(cudf::dictionary_column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -371,15 +371,14 @@ struct MathOpDispatcher { } template - std::enable_if_t::value, std::unique_ptr> operator()( - Args&&...) + std::enable_if_t, std::unique_ptr> operator()(Args&&...) { CUDF_FAIL("dictionary keys must be numeric for this operation"); } }; template ::value and + typename std::enable_if_t and std::is_same_v>* = nullptr> std::unique_ptr operator()(cudf::column_view const& input, rmm::cuda_stream_view stream, @@ -392,7 +391,7 @@ struct MathOpDispatcher { } template - std::enable_if_t::value and !std::is_same_v, + std::enable_if_t and !std::is_same_v, std::unique_ptr> operator()(Args&&...) { @@ -402,7 +401,7 @@ struct MathOpDispatcher { template struct BitwiseOpDispatcher { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(cudf::column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -416,7 +415,7 @@ struct BitwiseOpDispatcher { } struct dictionary_dispatch { - template ::value>* = nullptr> + template >* = nullptr> std::unique_ptr operator()(cudf::dictionary_column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -425,16 +424,15 @@ struct BitwiseOpDispatcher { } template - std::enable_if_t::value, std::unique_ptr> operator()( - Args&&...) + std::enable_if_t, std::unique_ptr> operator()(Args&&...) { CUDF_FAIL("dictionary keys type not supported for this operation"); } }; template ::value and - std::is_same_v>* = nullptr> + typename std::enable_if_t and std::is_same_v>* = + nullptr> std::unique_ptr operator()(cudf::column_view const& input, rmm::cuda_stream_view stream, rmm::mr::device_memory_resource* mr) @@ -446,7 +444,7 @@ struct BitwiseOpDispatcher { } template - std::enable_if_t::value and !std::is_same_v, + std::enable_if_t and !std::is_same_v, std::unique_ptr> operator()(Args&&...) { @@ -460,7 +458,7 @@ struct LogicalOpDispatcher { template static constexpr bool is_supported() { - return std::is_arithmetic::value || std::is_same_v; + return std::is_arithmetic_v || std::is_same_v; } public: diff --git a/cpp/src/unary/nan_ops.cu b/cpp/src/unary/nan_ops.cu index c6b9ecefe94..e11dd00f2ca 100644 --- a/cpp/src/unary/nan_ops.cu +++ b/cpp/src/unary/nan_ops.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ namespace cudf { namespace detail { struct nan_dispatcher { template - std::enable_if_t::value, std::unique_ptr> operator()( + std::enable_if_t, std::unique_ptr> operator()( cudf::column_view const& input, Predicate predicate, rmm::cuda_stream_view stream, @@ -56,7 +56,7 @@ struct nan_dispatcher { } template - std::enable_if_t::value, std::unique_ptr> operator()( + std::enable_if_t, std::unique_ptr> operator()( cudf::column_view const& input, Predicate predicate, rmm::cuda_stream_view stream, diff --git a/cpp/tests/binaryop/util/operation.h b/cpp/tests/binaryop/util/operation.h index 22802580cd0..d78ad8938c4 100644 --- a/cpp/tests/binaryop/util/operation.h +++ b/cpp/tests/binaryop/util/operation.h @@ -97,8 +97,8 @@ struct Mul { typename OutT, typename LhsT, typename RhsT, - typename std::enable_if<(cudf::is_duration_t::value && std::is_integral::value) || - (cudf::is_duration_t::value && std::is_integral::value), + typename std::enable_if<(cudf::is_duration_t::value && std::is_integral_v) || + (cudf::is_duration_t::value && std::is_integral_v), void>::type* = nullptr> OutT DurationProduct(LhsT x, RhsT y) const { @@ -123,12 +123,11 @@ struct Div { return DurationDivide(x, y); } - template < - typename OutT, - typename LhsT, - typename RhsT, - typename std::enable_if<(std::is_integral::value || cudf::is_duration_t::value), - void>::type* = nullptr> + template || cudf::is_duration()), + void>::type* = nullptr> OutT DurationDivide(LhsT x, RhsT y) const { return x / y; @@ -153,33 +152,33 @@ struct FloorDiv { template struct Mod { - template < - typename OutT = TypeOut, - typename LhsT = TypeLhs, - typename RhsT = TypeRhs, - std::enable_if_t< - (std::is_integral::type>::value)>* = nullptr> + template ::type>)>* = nullptr> TypeOut operator()(TypeLhs lhs, TypeRhs rhs) { using TypeCommon = typename std::common_type::type; return static_cast(static_cast(lhs) % static_cast(rhs)); } - template ::type, - float>::value)>* = nullptr> + template ::type, float>)>* = nullptr> TypeOut operator()(TypeLhs lhs, TypeRhs rhs) { return static_cast(fmod(static_cast(lhs), static_cast(rhs))); } - template ::type, - double>::value)>* = nullptr> + template < + typename OutT = TypeOut, + typename LhsT = TypeLhs, + typename RhsT = TypeRhs, + std::enable_if_t<(std::is_same_v::type, double>)>* = + nullptr> TypeOut operator()(TypeLhs lhs, TypeRhs rhs) { return static_cast(fmod(static_cast(lhs), static_cast(rhs))); diff --git a/cpp/tests/column/bit_cast_test.cpp b/cpp/tests/column/bit_cast_test.cpp index c6e6082d4be..8c67c7ad404 100644 --- a/cpp/tests/column/bit_cast_test.cpp +++ b/cpp/tests/column/bit_cast_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,8 +69,8 @@ void do_bit_cast(cudf::column_view const& column_view, Iterator begin, Iterator auto output1 = cudf::bit_cast(mutable_column_view, mutable_column_view.type()); cudf::test::expect_columns_equal(output, column_view); cudf::test::expect_columns_equal(output1, mutable_column_view); - } else if (std::is_same, ToType>::value || - std::is_same>::value) { + } else if (std::is_same_v, ToType> || + std::is_same_v>) { // Cast integer to timestamp or vice versa auto output = cudf::bit_cast(column_view, to_type); auto output1 = cudf::bit_cast(mutable_column_view, to_type); diff --git a/cpp/tests/copying/copy_tests.cpp b/cpp/tests/copying/copy_tests.cpp index 2f02f4cba02..4254794bf19 100644 --- a/cpp/tests/copying/copy_tests.cpp +++ b/cpp/tests/copying/copy_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -379,7 +379,7 @@ template struct create_chrono_scalar { template typename std::enable_if_t< - std::is_same::type, std::true_type>::value, + std::is_same_v::type, std::true_type>, cudf::timestamp_scalar> operator()(Args&&... args) const { @@ -388,7 +388,7 @@ struct create_chrono_scalar { template typename std::enable_if_t< - std::is_same::type, std::true_type>::value, + std::is_same_v::type, std::true_type>, cudf::duration_scalar> operator()(Args&&... args) const { diff --git a/cpp/tests/interop/dlpack_test.cpp b/cpp/tests/interop/dlpack_test.cpp index 7ea5d1edb97..48a3b82d9b5 100644 --- a/cpp/tests/interop/dlpack_test.cpp +++ b/cpp/tests/interop/dlpack_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,11 +35,11 @@ DLDataType get_dtype() { uint8_t const bits{sizeof(T) * 8}; uint16_t const lanes{1}; - if (std::is_floating_point::value) { + if (std::is_floating_point_v) { return DLDataType{kDLFloat, bits, lanes}; - } else if (std::is_signed::value) { + } else if (std::is_signed_v) { return DLDataType{kDLInt, bits, lanes}; - } else if (std::is_unsigned::value) { + } else if (std::is_unsigned_v) { return DLDataType{kDLUInt, bits, lanes}; } else { static_assert(true, "unsupported type"); @@ -50,9 +50,9 @@ template void validate_dtype(DLDataType const& dtype) { switch (dtype.code) { - case kDLInt: EXPECT_TRUE(std::is_integral::value && std::is_signed::value); break; - case kDLUInt: EXPECT_TRUE(std::is_integral::value && std::is_unsigned::value); break; - case kDLFloat: EXPECT_TRUE(std::is_floating_point::value); break; + case kDLInt: EXPECT_TRUE(std::is_integral_v && std::is_signed_v); break; + case kDLUInt: EXPECT_TRUE(std::is_integral_v && std::is_unsigned_v); break; + case kDLFloat: EXPECT_TRUE(std::is_floating_point_v); break; default: FAIL(); } EXPECT_EQ(1, dtype.lanes); diff --git a/cpp/tests/io/csv_test.cpp b/cpp/tests/io/csv_test.cpp index 868b19254ca..08cdbb10359 100644 --- a/cpp/tests/io/csv_test.cpp +++ b/cpp/tests/io/csv_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -138,7 +138,7 @@ inline auto random_values(size_t size) using uniform_distribution = typename std::conditional_t, std::bernoulli_distribution, - std::conditional_t::value, + std::conditional_t, std::uniform_real_distribution, std::uniform_int_distribution>>; @@ -262,7 +262,7 @@ void check_string_column(cudf::column_view const& col_lhs, } // Helper function to compare two floating-point column contents -template ::value>* = nullptr> +template >* = nullptr> void expect_column_data_equal(std::vector const& lhs, cudf::column_view const& rhs) { EXPECT_THAT(cudf::test::to_host(rhs).first, @@ -270,7 +270,7 @@ void expect_column_data_equal(std::vector const& lhs, cudf::column_view const } // Helper function to compare two column contents -template ::value>* = nullptr> +template >* = nullptr> void expect_column_data_equal(std::vector const& lhs, cudf::column_view const& rhs) { EXPECT_THAT(cudf::test::to_host(rhs).first, ::testing::ElementsAreArray(lhs)); diff --git a/cpp/tests/io/json_test.cpp b/cpp/tests/io/json_test.cpp index 121bd1e2c99..b6a6270ca8b 100644 --- a/cpp/tests/io/json_test.cpp +++ b/cpp/tests/io/json_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2021, NVIDIA CORPORATION. + * Copyright (c) 2020-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -118,7 +118,7 @@ inline auto random_values(size_t size) using uniform_distribution = typename std::conditional_t, std::bernoulli_distribution, - std::conditional_t::value, + std::conditional_t, std::uniform_real_distribution, std::uniform_int_distribution>>; diff --git a/cpp/tests/io/orc_test.cpp b/cpp/tests/io/orc_test.cpp index a31cd22ee3e..bac5bf1f55b 100644 --- a/cpp/tests/io/orc_test.cpp +++ b/cpp/tests/io/orc_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -149,7 +149,7 @@ inline auto random_values(size_t size) using uniform_distribution = typename std::conditional_t, std::bernoulli_distribution, - std::conditional_t::value, + std::conditional_t, std::uniform_real_distribution, std::uniform_int_distribution>>; diff --git a/cpp/tests/io/parquet_test.cpp b/cpp/tests/io/parquet_test.cpp index b45670fd265..5cf176b11c2 100644 --- a/cpp/tests/io/parquet_test.cpp +++ b/cpp/tests/io/parquet_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -252,7 +252,7 @@ inline auto random_values(size_t size) using uniform_distribution = typename std::conditional_t, std::bernoulli_distribution, - std::conditional_t::value, + std::conditional_t, std::uniform_real_distribution, std::uniform_int_distribution>>; diff --git a/cpp/tests/quantiles/quantile_test.cpp b/cpp/tests/quantiles/quantile_test.cpp index d4cc0ec4738..20acdd02a93 100644 --- a/cpp/tests/quantiles/quantile_test.cpp +++ b/cpp/tests/quantiles/quantile_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,16 +90,16 @@ test_case interpolate_center() auto low = std::numeric_limits::lowest(); auto max = std::numeric_limits::max(); double mid_d = [] { - if (std::is_floating_point::value) return 0.0; - if (std::is_signed::value) return -0.5; + if (std::is_floating_point_v) return 0.0; + if (std::is_signed_v) return -0.5; return static_cast(std::numeric_limits::max()) / 2.0; }(); // int64_t is internally casted to a double, meaning the lerp center point // is float-like. double lin_d = [] { - if (std::is_floating_point::value || std::is_same_v) return 0.0; - if (std::is_signed::value) return -0.5; + if (std::is_floating_point_v || std::is_same_v) return 0.0; + if (std::is_signed_v) return -0.5; return static_cast(std::numeric_limits::max()) / 2.0; }(); auto max_d = static_cast(max); @@ -164,7 +164,7 @@ test_case interpolate_extrema_low() // single template -std::enable_if_t::value, test_case> single() +std::enable_if_t, test_case> single() { return test_case{fixed_width_column_wrapper({7.309999942779541}), { @@ -196,7 +196,7 @@ std::enable_if_t::value, test_case> single() } template -std::enable_if_t::value and not cudf::is_boolean(), test_case> single() +std::enable_if_t and not cudf::is_boolean(), test_case> single() { return test_case{fixed_width_column_wrapper({1}), {q_expect{0.7, 1, 1, 1, 1, 1}}}; } @@ -210,7 +210,7 @@ std::enable_if_t(), test_case> single() // all_invalid template -std::enable_if_t::value, test_case> all_invalid() +std::enable_if_t, test_case> all_invalid() { return test_case{ fixed_width_column_wrapper({6.8, 0.15, 3.4, 4.17, 2.13, 1.11, -1.01, 0.8, 5.7}, @@ -219,8 +219,7 @@ std::enable_if_t::value, test_case> all_invalid() } template -std::enable_if_t::value and not cudf::is_boolean(), test_case> -all_invalid() +std::enable_if_t and not cudf::is_boolean(), test_case> all_invalid() { return test_case{ fixed_width_column_wrapper({6, 0, 3, 4, 2, 1, -1, 1, 6}, {0, 0, 0, 0, 0, 0, 0, 0, 0}), @@ -274,8 +273,7 @@ std::enable_if_t, test_case> some_invalid() } template -std::enable_if_t::value and not cudf::is_boolean(), test_case> -some_invalid() +std::enable_if_t and not cudf::is_boolean(), test_case> some_invalid() { return test_case{ fixed_width_column_wrapper({6, 0, 3, 4, 2, 1, -1, 1, 6}, {0, 0, 1, 0, 0, 0, 0, 0, 1}), @@ -299,7 +297,7 @@ std::enable_if_t(), test_case> some_invalid() // unsorted template -std::enable_if_t::value, test_case> unsorted() +std::enable_if_t, test_case> unsorted() { return test_case{ fixed_width_column_wrapper({6.8, 0.15, 3.4, 4.17, 2.13, 1.11, -1.00, 0.8, 5.7}), @@ -310,7 +308,7 @@ std::enable_if_t::value, test_case> unsorted() } template -std::enable_if_t::value and not cudf::is_boolean(), test_case> unsorted() +std::enable_if_t and not cudf::is_boolean(), test_case> unsorted() { return std::is_signed() ? test_case{fixed_width_column_wrapper({6, 0, 3, 4, 2, 1, -1, 1, 6}), diff --git a/cpp/tests/reductions/rank_tests.cpp b/cpp/tests/reductions/rank_tests.cpp index ffcbce08163..810d4bef737 100644 --- a/cpp/tests/reductions/rank_tests.cpp +++ b/cpp/tests/reductions/rank_tests.cpp @@ -69,7 +69,7 @@ TYPED_TEST_SUITE(TypedRankScanTest, RankTypes); TYPED_TEST(TypedRankScanTest, Rank) { auto const v = [] { - if (std::is_signed::value) + if (std::is_signed_v) return make_vector({-120, -120, -120, -16, -16, 5, 6, 6, 6, 6, 34, 113}); return make_vector({5, 5, 5, 6, 6, 9, 11, 11, 11, 11, 14, 34}); }(); @@ -97,7 +97,7 @@ TYPED_TEST(TypedRankScanTest, Rank) TYPED_TEST(TypedRankScanTest, RankWithNulls) { auto const v = [] { - if (std::is_signed::value) + if (std::is_signed_v) return make_vector({-120, -120, -120, -16, -16, 5, 6, 6, 6, 6, 34, 113}); return make_vector({5, 5, 5, 6, 6, 9, 11, 11, 11, 11, 14, 34}); }(); diff --git a/cpp/tests/reductions/reduction_tests.cpp b/cpp/tests/reductions/reduction_tests.cpp index e1c426990eb..fcecc124978 100644 --- a/cpp/tests/reductions/reduction_tests.cpp +++ b/cpp/tests/reductions/reduction_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ typename std::enable_if::value, std::vector>::type c { std::vector v(int_values.size()); std::transform(int_values.begin(), int_values.end(), v.begin(), [](int x) { - if (std::is_unsigned::value) x = std::abs(x); + if (std::is_unsigned_v) x = std::abs(x); return static_cast(x); }); return v; @@ -55,7 +55,7 @@ typename std::enable_if::value, std::vector>::type co { std::vector v(int_values.size()); std::transform(int_values.begin(), int_values.end(), v.begin(), [](int x) { - if (std::is_unsigned::value) x = std::abs(x); + if (std::is_unsigned_v) x = std::abs(x); return T{typename T::duration(x)}; }); return v; @@ -88,7 +88,7 @@ template struct ReductionTest : public cudf::test::BaseFixture { // Sum/Prod/SumOfSquare never support non arithmetics static constexpr bool ret_non_arithmetic = - (std::is_arithmetic::value || std::is_same_v) ? true : false; + (std::is_arithmetic_v || std::is_same_v) ? true : false; ReductionTest() {} @@ -954,7 +954,7 @@ TYPED_TEST(ReductionTest, Median) cudf::test::fixed_width_column_wrapper col(v.begin(), v.end()); double expected_value = [] { if (std::is_same_v) return 1.0; - if (std::is_signed::value) return 3.0; + if (std::is_signed_v) return 3.0; return 13.5; }(); this->reduction_test( @@ -963,7 +963,7 @@ TYPED_TEST(ReductionTest, Median) auto col_odd = cudf::split(col, {1})[1]; double expected_value_odd = [] { if (std::is_same_v) return 1.0; - if (std::is_signed::value) return 0.0; + if (std::is_signed_v) return 0.0; return 14.0; }(); this->reduction_test( @@ -972,7 +972,7 @@ TYPED_TEST(ReductionTest, Median) cudf::test::fixed_width_column_wrapper col_nulls = construct_null_column(v, host_bools); double expected_null_value = [] { if (std::is_same_v) return 1.0; - if (std::is_signed::value) return 0.0; + if (std::is_signed_v) return 0.0; return 13.0; }(); @@ -982,7 +982,7 @@ TYPED_TEST(ReductionTest, Median) auto col_nulls_odd = cudf::split(col_nulls, {1})[1]; double expected_null_value_odd = [] { if (std::is_same_v) return 1.0; - if (std::is_signed::value) return -6.5; + if (std::is_signed_v) return -6.5; return 13.5; }(); this->reduction_test(col_nulls_odd, @@ -1002,7 +1002,7 @@ TYPED_TEST(ReductionTest, Quantile) // test without nulls cudf::test::fixed_width_column_wrapper col(v.begin(), v.end()); - double expected_value0 = std::is_same_v || std::is_unsigned::value ? v[4] : v[6]; + double expected_value0 = std::is_same_v || std::is_unsigned_v ? v[4] : v[6]; this->reduction_test( col, expected_value0, this->ret_non_arithmetic, cudf::make_quantile_aggregation({0.0}, interp)); double expected_value1 = v[3]; @@ -1896,7 +1896,7 @@ TYPED_TEST(DictionaryReductionTest, Median) // test without nulls cudf::test::dictionary_column_wrapper col(v.begin(), v.end()); this->reduction_test(col, - (std::is_signed::value) ? 3.0 : 13.5, + (std::is_signed_v) ? 3.0 : 13.5, this->ret_non_arithmetic, cudf::make_median_aggregation(), output_type); @@ -1905,7 +1905,7 @@ TYPED_TEST(DictionaryReductionTest, Median) std::vector validity({1, 1, 1, 0, 1, 1, 1, 1}); cudf::test::dictionary_column_wrapper col_nulls(v.begin(), v.end(), validity.begin()); this->reduction_test(col_nulls, - (std::is_signed::value) ? 0.0 : 13.0, + (std::is_signed_v) ? 0.0 : 13.0, this->ret_non_arithmetic, cudf::make_median_aggregation(), output_type); @@ -1921,7 +1921,7 @@ TYPED_TEST(DictionaryReductionTest, Quantile) // test without nulls cudf::test::dictionary_column_wrapper col(v.begin(), v.end()); - double expected_value = std::is_same_v || std::is_unsigned::value ? 0.0 : -20.0; + double expected_value = std::is_same_v || std::is_unsigned_v ? 0.0 : -20.0; this->reduction_test(col, expected_value, this->ret_non_arithmetic, diff --git a/cpp/tests/reductions/scan_tests.cpp b/cpp/tests/reductions/scan_tests.cpp index 8dee5160fd7..3cbf5f5deb0 100644 --- a/cpp/tests/reductions/scan_tests.cpp +++ b/cpp/tests/reductions/scan_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -262,7 +262,7 @@ TYPED_TEST(ScanTest, Product) TYPED_TEST(ScanTest, Sum) { auto const v = [] { - if (std::is_signed::value) + if (std::is_signed_v) return make_vector({-120, 5, 6, 113, -111, 64, -63, 9, 34, -16}); return make_vector({12, 5, 6, 13, 11, 14, 3, 9, 34, 16}); }(); diff --git a/cpp/tests/rolling/range_window_bounds_test.cpp b/cpp/tests/rolling/range_window_bounds_test.cpp index 451f8b054ce..155b3128fa0 100644 --- a/cpp/tests/rolling/range_window_bounds_test.cpp +++ b/cpp/tests/rolling/range_window_bounds_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, NVIDIA CORPORATION. + * Copyright (c) 2021-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,17 +49,17 @@ TEST_F(RangeWindowBoundsTest, TestBasicTimestampRangeTypeMapping) using namespace cudf::detail; - static_assert(std::is_same, duration_D>::value); - static_assert(std::is_same, duration_s>::value); - static_assert(std::is_same, duration_ms>::value); - static_assert(std::is_same, duration_us>::value); - static_assert(std::is_same, duration_ns>::value); - - static_assert(std::is_same, int32_t>::value); - static_assert(std::is_same, int64_t>::value); - static_assert(std::is_same, int64_t>::value); - static_assert(std::is_same, int64_t>::value); - static_assert(std::is_same, int64_t>::value); + static_assert(std::is_same_v, duration_D>); + static_assert(std::is_same_v, duration_s>); + static_assert(std::is_same_v, duration_ms>); + static_assert(std::is_same_v, duration_us>); + static_assert(std::is_same_v, duration_ns>); + + static_assert(std::is_same_v, int32_t>); + static_assert(std::is_same_v, int64_t>); + static_assert(std::is_same_v, int64_t>); + static_assert(std::is_same_v, int64_t>); + static_assert(std::is_same_v, int64_t>); } TYPED_TEST(TimestampRangeWindowBoundsTest, BoundsConstruction) @@ -124,7 +124,7 @@ TYPED_TEST(NumericRangeWindowBoundsTest, BoundsConstruction) using range_window_bounds = cudf::range_window_bounds; - static_assert(std::is_integral::value); + static_assert(std::is_integral_v); auto range_3 = range_window_bounds::get(numeric_scalar{3, true}); EXPECT_FALSE(range_3.is_unbounded() && "range_window_bounds constructed from scalar cannot be unbounded."); diff --git a/cpp/tests/sort/is_sorted_tests.cpp b/cpp/tests/sort/is_sorted_tests.cpp index f2d82d6ecb4..7d277059ef7 100644 --- a/cpp/tests/sort/is_sorted_tests.cpp +++ b/cpp/tests/sort/is_sorted_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,48 +36,47 @@ namespace testdata { // ----- most numerics template -typename std::enable_if::value && !std::is_same_v, +typename std::enable_if && !std::is_same_v, fixed_width_column_wrapper>::type ascending() { - return std::is_signed::value ? fixed_width_column_wrapper({std::numeric_limits::lowest(), - T(-100), - T(-10), - T(-1), - T(0), - T(1), - T(10), - T(100), - std::numeric_limits::max()}) - : fixed_width_column_wrapper({std::numeric_limits::lowest(), - T(0), - T(1), - T(10), - T(100), - std::numeric_limits::max()}); + return std::is_signed_v ? fixed_width_column_wrapper({std::numeric_limits::lowest(), + T(-100), + T(-10), + T(-1), + T(0), + T(1), + T(10), + T(100), + std::numeric_limits::max()}) + : fixed_width_column_wrapper({std::numeric_limits::lowest(), + T(0), + T(1), + T(10), + T(100), + std::numeric_limits::max()}); } template -typename std::enable_if::value && !std::is_same_v, +typename std::enable_if && !std::is_same_v, fixed_width_column_wrapper>::type descending() { - return std::is_signed::value - ? fixed_width_column_wrapper({std::numeric_limits::max(), - T(100), - T(10), - T(1), - T(0), - T(-1), - T(-10), - T(-100), - std::numeric_limits::lowest()}) - : fixed_width_column_wrapper({std::numeric_limits::max(), - T(100), - T(10), - T(1), - T(0), - std::numeric_limits::lowest()}); + return std::is_signed_v ? fixed_width_column_wrapper({std::numeric_limits::max(), + T(100), + T(10), + T(1), + T(0), + T(-1), + T(-10), + T(-100), + std::numeric_limits::lowest()}) + : fixed_width_column_wrapper({std::numeric_limits::max(), + T(100), + T(10), + T(1), + T(0), + std::numeric_limits::lowest()}); } template diff --git a/cpp/tests/unary/math_ops_test.cpp b/cpp/tests/unary/math_ops_test.cpp index b0c59b4354a..5b468bf4d9f 100644 --- a/cpp/tests/unary/math_ops_test.cpp +++ b/cpp/tests/unary/math_ops_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,9 +99,8 @@ TYPED_TEST(UnaryMathOpsTest, ABS) std::vector h_input_v(colSize); std::vector h_expect_v(colSize); - std::iota(std::begin(h_input_v), - std::end(h_input_v), - std::is_unsigned::value ? colSize : -1 * colSize); + std::iota( + std::begin(h_input_v), std::end(h_input_v), std::is_unsigned_v ? colSize : -1 * colSize); std::transform(std::cbegin(h_input_v), std::cend(h_input_v), std::begin(h_expect_v), [](auto e) { return cudf::util::absolute_value(e); diff --git a/cpp/tests/utilities/column_utilities.cu b/cpp/tests/utilities/column_utilities.cu index 2d9fe7775d5..5403d56318e 100644 --- a/cpp/tests/utilities/column_utilities.cu +++ b/cpp/tests/utilities/column_utilities.cu @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021, NVIDIA CORPORATION. + * Copyright (c) 2019-2022, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -373,7 +373,7 @@ class corresponding_rows_not_equivalent { struct typed_element_not_equivalent { template - __device__ std::enable_if_t::value, bool> operator()( + __device__ std::enable_if_t, bool> operator()( column_device_view const& lhs, column_device_view const& rhs, size_type lhs_index, @@ -401,7 +401,7 @@ class corresponding_rows_not_equivalent { } template - __device__ std::enable_if_t::value, bool> operator()(Args...) + __device__ std::enable_if_t, bool> operator()(Args...) { // Non-floating point inequality is checked already return true; @@ -836,13 +836,13 @@ std::vector bitmask_to_host(cudf::column_view const& c) namespace { -template ::value>* = nullptr> +template >* = nullptr> static auto numeric_to_string_precise(T value) { return std::to_string(value); } -template ::value>* = nullptr> +template >* = nullptr> static auto numeric_to_string_precise(T value) { std::ostringstream o;