From 1f0428f6013c17935fe5ea2da8e2ca82e3b802d3 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Mon, 16 Dec 2024 10:50:40 -0800 Subject: [PATCH 1/6] Remove relaxed constexpr --- cpp/cmake/Modules/ConfigureCUDA.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/Modules/ConfigureCUDA.cmake b/cpp/cmake/Modules/ConfigureCUDA.cmake index f75b5aef7af..2b44a7c22d5 100644 --- a/cpp/cmake/Modules/ConfigureCUDA.cmake +++ b/cpp/cmake/Modules/ConfigureCUDA.cmake @@ -16,7 +16,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) list(APPEND CUDF_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations) endif() -list(APPEND CUDF_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) +list(APPEND CUDF_CUDA_FLAGS --expt-extended-lambda) # set warnings as errors if(CUDA_WARNINGS_AS_ERRORS) From aaa8f5d3d167133c5496e2a11e23b7842aeb999d Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Mon, 16 Dec 2024 11:14:34 -0800 Subject: [PATCH 2/6] Enable binaryop build without relying on relaxed constexpr --- cpp/include/cudf/fixed_point/fixed_point.hpp | 25 ++++++------- cpp/src/binaryop/compiled/binary_ops.cuh | 38 ++++++++++---------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/cpp/include/cudf/fixed_point/fixed_point.hpp b/cpp/include/cudf/fixed_point/fixed_point.hpp index ea2f5d4b6ca..857654b89d9 100644 --- a/cpp/include/cudf/fixed_point/fixed_point.hpp +++ b/cpp/include/cudf/fixed_point/fixed_point.hpp @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -60,7 +61,7 @@ enum class Radix : int32_t { BASE_2 = 2, BASE_10 = 10 }; * @return `true` if the type is supported by `fixed_point` implementation */ template -constexpr inline auto is_supported_representation_type() +CUDF_HOST_DEVICE constexpr inline auto is_supported_representation_type() { return cuda::std::is_same_v || // cuda::std::is_same_v || // @@ -267,12 +268,12 @@ class fixed_point { * @return The `fixed_point` number in base 10 (aka human readable format) */ template >* = nullptr> - explicit constexpr operator U() const + CUDF_HOST_DEVICE explicit constexpr operator U() const { // Cast to the larger of the two types (of U and Rep) before converting to Rep because in // certain cases casting to U before shifting will result in integer overflow (i.e. if U = // int32_t, Rep = int64_t and _value > 2 billion) - auto const value = std::common_type_t(_value); + auto const value = cuda::std::common_type_t(_value); return static_cast(detail::shift(value, scale_type{-_scale})); } @@ -669,7 +670,7 @@ template CUDF_HOST_DEVICE inline fixed_point operator+(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); auto const sum = lhs.rescaled(scale)._value + rhs.rescaled(scale)._value; #if defined(__CUDACC_DEBUG__) @@ -687,7 +688,7 @@ template CUDF_HOST_DEVICE inline fixed_point operator-(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); auto const diff = lhs.rescaled(scale)._value - rhs.rescaled(scale)._value; #if defined(__CUDACC_DEBUG__) @@ -735,7 +736,7 @@ template CUDF_HOST_DEVICE inline bool operator==(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value == rhs.rescaled(scale)._value; } @@ -744,7 +745,7 @@ template CUDF_HOST_DEVICE inline bool operator!=(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value != rhs.rescaled(scale)._value; } @@ -753,7 +754,7 @@ template CUDF_HOST_DEVICE inline bool operator<=(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value <= rhs.rescaled(scale)._value; } @@ -762,7 +763,7 @@ template CUDF_HOST_DEVICE inline bool operator>=(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value >= rhs.rescaled(scale)._value; } @@ -771,7 +772,7 @@ template CUDF_HOST_DEVICE inline bool operator<(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value < rhs.rescaled(scale)._value; } @@ -780,7 +781,7 @@ template CUDF_HOST_DEVICE inline bool operator>(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value > rhs.rescaled(scale)._value; } @@ -789,7 +790,7 @@ template CUDF_HOST_DEVICE inline fixed_point operator%(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = std::min(lhs._scale, rhs._scale); + auto const scale = cuda::std::min(lhs._scale, rhs._scale); auto const remainder = lhs.rescaled(scale)._value % rhs.rescaled(scale)._value; return fixed_point{scaled_integer{remainder, scale}}; } diff --git a/cpp/src/binaryop/compiled/binary_ops.cuh b/cpp/src/binaryop/compiled/binary_ops.cuh index 0e31a0b6cf5..0e13331ed4d 100644 --- a/cpp/src/binaryop/compiled/binary_ops.cuh +++ b/cpp/src/binaryop/compiled/binary_ops.cuh @@ -27,6 +27,8 @@ #include #include +#include + namespace cudf { namespace binops { namespace compiled { @@ -51,7 +53,7 @@ struct type_casted_accessor { { if constexpr (column_device_view::has_element_accessor()) { auto const element = col.element(is_scalar ? 0 : i); - if constexpr (std::is_convertible_v) { + if constexpr (cuda::std::is_convertible_v) { return static_cast(element); } else if constexpr (is_fixed_point() && cuda::std::is_floating_point_v) { return convert_fixed_to_floating(element); @@ -75,7 +77,7 @@ struct typed_casted_writer { FromType val) const { if constexpr (mutable_column_device_view::has_element_accessor() and - std::is_constructible_v) { + cuda::std::is_constructible_v) { col.element(i) = static_cast(val); } else if constexpr (is_fixed_point()) { auto const scale = numeric::scale_type{col.type().scale()}; @@ -109,18 +111,18 @@ struct ops_wrapper { template __device__ void operator()(size_type i) { - if constexpr (std::is_invocable_v) { + if constexpr (cuda::std::is_invocable_v) { TypeCommon x = type_dispatcher(lhs.type(), type_casted_accessor{}, i, lhs, is_lhs_scalar); TypeCommon y = type_dispatcher(rhs.type(), type_casted_accessor{}, i, rhs, is_rhs_scalar); auto result = [&]() { - if constexpr (std::is_same_v or - std::is_same_v or - std::is_same_v or - std::is_same_v or - std::is_same_v or - std::is_same_v) { + if constexpr (cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v) { bool output_valid = false; auto result = BinaryOperator{}.template operator()( x, @@ -134,7 +136,7 @@ struct ops_wrapper { return BinaryOperator{}.template operator()(x, y); } // To suppress nvcc warning - return std::invoke_result_t{}; + return cuda::std::invoke_result_t{}; }(); if constexpr (is_bool_result()) out.element(i) = result; @@ -161,16 +163,16 @@ struct ops2_wrapper { __device__ void operator()(size_type i) { if constexpr (!has_common_type_v and - std::is_invocable_v) { + cuda::std::is_invocable_v) { TypeLhs x = lhs.element(is_lhs_scalar ? 0 : i); TypeRhs y = rhs.element(is_rhs_scalar ? 0 : i); auto result = [&]() { - if constexpr (std::is_same_v or - std::is_same_v or - std::is_same_v or - std::is_same_v or - std::is_same_v or - std::is_same_v) { + if constexpr (cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v or + cuda::std::is_same_v) { bool output_valid = false; auto result = BinaryOperator{}.template operator()( x, @@ -184,7 +186,7 @@ struct ops2_wrapper { return BinaryOperator{}.template operator()(x, y); } // To suppress nvcc warning - return std::invoke_result_t{}; + return cuda::std::invoke_result_t{}; }(); if constexpr (is_bool_result()) out.element(i) = result; From f556d1bceab8b78b00debab3671f8000e08e08ee Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Mon, 16 Dec 2024 11:19:56 -0800 Subject: [PATCH 3/6] Make fixed_point a CUDA header --- cpp/include/cudf/column/column_device_view.cuh | 2 +- cpp/include/cudf/detail/utilities/device_operators.cuh | 2 +- .../cudf/fixed_point/{fixed_point.hpp => fixed_point.cuh} | 0 cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh | 2 +- cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh | 2 +- cpp/include/cudf/hashing/detail/xxhash_64.cuh | 2 +- cpp/include/cudf/unary.hpp | 2 +- cpp/include/cudf/utilities/traits.hpp | 2 +- cpp/include/cudf/utilities/type_dispatcher.hpp | 2 +- cpp/src/binaryop/jit/kernel.cu | 2 +- cpp/src/interop/decimal_conversion_utilities.cu | 2 +- cpp/src/io/csv/csv_gpu.cu | 2 +- cpp/src/io/csv/datetime.cuh | 2 +- cpp/src/io/parquet/reader_impl_helpers.hpp | 2 +- cpp/src/io/statistics/statistics_type_identification.cuh | 2 +- cpp/src/io/statistics/temp_storage_wrapper.cuh | 4 ++-- cpp/src/io/statistics/typed_statistics_chunk.cuh | 2 +- cpp/src/round/round.cu | 2 +- cpp/src/scalar/scalar.cpp | 2 +- cpp/src/unary/cast_ops.cu | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) rename cpp/include/cudf/fixed_point/{fixed_point.hpp => fixed_point.cuh} (100%) diff --git a/cpp/include/cudf/column/column_device_view.cuh b/cpp/include/cudf/column/column_device_view.cuh index ea480b133dc..ce7a540f2e4 100644 --- a/cpp/include/cudf/column/column_device_view.cuh +++ b/cpp/include/cudf/column/column_device_view.cuh @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/cudf/detail/utilities/device_operators.cuh b/cpp/include/cudf/detail/utilities/device_operators.cuh index 923cd04479d..073f3eda3f5 100644 --- a/cpp/include/cudf/detail/utilities/device_operators.cuh +++ b/cpp/include/cudf/detail/utilities/device_operators.cuh @@ -21,7 +21,7 @@ * @file */ -#include +#include #include #include #include diff --git a/cpp/include/cudf/fixed_point/fixed_point.hpp b/cpp/include/cudf/fixed_point/fixed_point.cuh similarity index 100% rename from cpp/include/cudf/fixed_point/fixed_point.hpp rename to cpp/include/cudf/fixed_point/fixed_point.cuh diff --git a/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh b/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh index 31390aa3edf..103a70c078c 100644 --- a/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh +++ b/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh b/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh index e0c7ce840d7..3a89276b2d4 100644 --- a/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh +++ b/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/hashing/detail/xxhash_64.cuh b/cpp/include/cudf/hashing/detail/xxhash_64.cuh index d77d040b365..03e2b31ef41 100644 --- a/cpp/include/cudf/hashing/detail/xxhash_64.cuh +++ b/cpp/include/cudf/hashing/detail/xxhash_64.cuh @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/unary.hpp b/cpp/include/cudf/unary.hpp index 046e9745a71..344f9581c53 100644 --- a/cpp/include/cudf/unary.hpp +++ b/cpp/include/cudf/unary.hpp @@ -17,7 +17,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/cpp/include/cudf/utilities/traits.hpp b/cpp/include/cudf/utilities/traits.hpp index 0f4bde204fa..a79631861e8 100644 --- a/cpp/include/cudf/utilities/traits.hpp +++ b/cpp/include/cudf/utilities/traits.hpp @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/utilities/type_dispatcher.hpp b/cpp/include/cudf/utilities/type_dispatcher.hpp index 6351a84e38f..16b5e39fe7a 100644 --- a/cpp/include/cudf/utilities/type_dispatcher.hpp +++ b/cpp/include/cudf/utilities/type_dispatcher.hpp @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/src/binaryop/jit/kernel.cu b/cpp/src/binaryop/jit/kernel.cu index 1133e9ac22e..0f6d8fe5c9c 100644 --- a/cpp/src/binaryop/jit/kernel.cu +++ b/cpp/src/binaryop/jit/kernel.cu @@ -18,7 +18,7 @@ * limitations under the License. */ -#include +#include #include #include #include diff --git a/cpp/src/interop/decimal_conversion_utilities.cu b/cpp/src/interop/decimal_conversion_utilities.cu index 2f81c754a30..6eb725da48d 100644 --- a/cpp/src/interop/decimal_conversion_utilities.cu +++ b/cpp/src/interop/decimal_conversion_utilities.cu @@ -18,7 +18,7 @@ #include #include -#include +#include #include diff --git a/cpp/src/io/csv/csv_gpu.cu b/cpp/src/io/csv/csv_gpu.cu index e2bc75d4bab..b4c53fe52bf 100644 --- a/cpp/src/io/csv/csv_gpu.cu +++ b/cpp/src/io/csv/csv_gpu.cu @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/cpp/src/io/csv/datetime.cuh b/cpp/src/io/csv/datetime.cuh index bfdba238a1e..74bed6c298d 100644 --- a/cpp/src/io/csv/datetime.cuh +++ b/cpp/src/io/csv/datetime.cuh @@ -19,7 +19,7 @@ #include "io/utilities/parsing_utils.cuh" #include "io/utilities/time_utils.cuh" -#include +#include #include #include diff --git a/cpp/src/io/parquet/reader_impl_helpers.hpp b/cpp/src/io/parquet/reader_impl_helpers.hpp index fd692c0cdd6..f0da204f932 100644 --- a/cpp/src/io/parquet/reader_impl_helpers.hpp +++ b/cpp/src/io/parquet/reader_impl_helpers.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/io/statistics/statistics_type_identification.cuh b/cpp/src/io/statistics/statistics_type_identification.cuh index 5e11646be6b..20d31308c97 100644 --- a/cpp/src/io/statistics/statistics_type_identification.cuh +++ b/cpp/src/io/statistics/statistics_type_identification.cuh @@ -24,7 +24,7 @@ #include "byte_array_view.cuh" #include "conversion_type_select.cuh" -#include +#include #include #include #include diff --git a/cpp/src/io/statistics/temp_storage_wrapper.cuh b/cpp/src/io/statistics/temp_storage_wrapper.cuh index b2e31ce9da7..3fbf3dbb15c 100644 --- a/cpp/src/io/statistics/temp_storage_wrapper.cuh +++ b/cpp/src/io/statistics/temp_storage_wrapper.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, NVIDIA CORPORATION. + * Copyright (c) 2021-2024, 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 @@ #include "byte_array_view.cuh" #include "statistics.cuh" -#include +#include #include #include #include diff --git a/cpp/src/io/statistics/typed_statistics_chunk.cuh b/cpp/src/io/statistics/typed_statistics_chunk.cuh index dc023e69423..21b2670f73a 100644 --- a/cpp/src/io/statistics/typed_statistics_chunk.cuh +++ b/cpp/src/io/statistics/typed_statistics_chunk.cuh @@ -27,7 +27,7 @@ #include "statistics_type_identification.cuh" #include "temp_storage_wrapper.cuh" -#include +#include #include #include diff --git a/cpp/src/round/round.cu b/cpp/src/round/round.cu index 332c440aea9..9321b062e1b 100644 --- a/cpp/src/round/round.cu +++ b/cpp/src/round/round.cu @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/src/scalar/scalar.cpp b/cpp/src/scalar/scalar.cpp index 4ec2174a96f..c1aa7aa8989 100644 --- a/cpp/src/scalar/scalar.cpp +++ b/cpp/src/scalar/scalar.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/src/unary/cast_ops.cu b/cpp/src/unary/cast_ops.cu index 0913796a527..2d1a01c5f2f 100644 --- a/cpp/src/unary/cast_ops.cu +++ b/cpp/src/unary/cast_ops.cu @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include From 55a453dd4423b385b1025a76ce09e6a31b7c418f Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Mon, 16 Dec 2024 11:32:29 -0800 Subject: [PATCH 4/6] Revert CMake changes --- cpp/cmake/Modules/ConfigureCUDA.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/cmake/Modules/ConfigureCUDA.cmake b/cpp/cmake/Modules/ConfigureCUDA.cmake index 2b44a7c22d5..f75b5aef7af 100644 --- a/cpp/cmake/Modules/ConfigureCUDA.cmake +++ b/cpp/cmake/Modules/ConfigureCUDA.cmake @@ -16,7 +16,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) list(APPEND CUDF_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations) endif() -list(APPEND CUDF_CUDA_FLAGS --expt-extended-lambda) +list(APPEND CUDF_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) # set warnings as errors if(CUDA_WARNINGS_AS_ERRORS) From 775de860080cc7ffb6f467f3cc879dbc460771b3 Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Fri, 20 Dec 2024 13:57:17 -0800 Subject: [PATCH 5/6] Revert fixed point back to cpp header + fix an nvrtc issue --- .../cudf/column/column_device_view.cuh | 2 +- .../detail/utilities/device_operators.cuh | 2 +- .../{fixed_point.cuh => fixed_point.hpp} | 37 ++++++++++++++----- .../hashing/detail/murmurhash3_x64_128.cuh | 2 +- .../hashing/detail/murmurhash3_x86_32.cuh | 2 +- cpp/include/cudf/hashing/detail/xxhash_64.cuh | 2 +- cpp/include/cudf/unary.hpp | 2 +- cpp/include/cudf/utilities/traits.hpp | 2 +- .../cudf/utilities/type_dispatcher.hpp | 2 +- cpp/src/binaryop/jit/kernel.cu | 2 +- .../interop/decimal_conversion_utilities.cu | 2 +- cpp/src/io/csv/csv_gpu.cu | 2 +- cpp/src/io/csv/datetime.cuh | 2 +- cpp/src/io/parquet/reader_impl_helpers.hpp | 2 +- .../statistics_type_identification.cuh | 2 +- .../io/statistics/temp_storage_wrapper.cuh | 4 +- .../io/statistics/typed_statistics_chunk.cuh | 2 +- cpp/src/round/round.cu | 2 +- cpp/src/scalar/scalar.cpp | 2 +- cpp/src/unary/cast_ops.cu | 2 +- 20 files changed, 47 insertions(+), 30 deletions(-) rename cpp/include/cudf/fixed_point/{fixed_point.cuh => fixed_point.hpp} (96%) diff --git a/cpp/include/cudf/column/column_device_view.cuh b/cpp/include/cudf/column/column_device_view.cuh index 00549f3a4e3..aacb5ccfede 100644 --- a/cpp/include/cudf/column/column_device_view.cuh +++ b/cpp/include/cudf/column/column_device_view.cuh @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/include/cudf/detail/utilities/device_operators.cuh b/cpp/include/cudf/detail/utilities/device_operators.cuh index 073f3eda3f5..923cd04479d 100644 --- a/cpp/include/cudf/detail/utilities/device_operators.cuh +++ b/cpp/include/cudf/detail/utilities/device_operators.cuh @@ -21,7 +21,7 @@ * @file */ -#include +#include #include #include #include diff --git a/cpp/include/cudf/fixed_point/fixed_point.cuh b/cpp/include/cudf/fixed_point/fixed_point.hpp similarity index 96% rename from cpp/include/cudf/fixed_point/fixed_point.cuh rename to cpp/include/cudf/fixed_point/fixed_point.hpp index 857654b89d9..a6fb692612b 100644 --- a/cpp/include/cudf/fixed_point/fixed_point.cuh +++ b/cpp/include/cudf/fixed_point/fixed_point.hpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -73,6 +72,24 @@ CUDF_HOST_DEVICE constexpr inline auto is_supported_representation_type() // Helper functions for `fixed_point` type namespace detail { +/** + * @brief Returns the smaller of the given scales + * + * @param a The left-hand side value to compare + * @param b The right-hand side value to compare + * @return The smaller of the given scales + */ +CUDF_HOST_DEVICE constexpr inline scale_type min(scale_type const& a, scale_type const& b) +{ + // TODO This is a temporary workaround because is not self-contained when + // built with NVRTC 11.8. Replace this with cuda::std::min once the underlying issue is resolved. +#ifdef __CUDA_ARCH__ + return scale_type{min(static_cast(a), static_cast(b))}; +#else + return std::min(a, b); +#endif +} + /** * @brief A function for integer exponentiation by squaring. * @@ -670,7 +687,7 @@ template CUDF_HOST_DEVICE inline fixed_point operator+(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); auto const sum = lhs.rescaled(scale)._value + rhs.rescaled(scale)._value; #if defined(__CUDACC_DEBUG__) @@ -688,7 +705,7 @@ template CUDF_HOST_DEVICE inline fixed_point operator-(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); auto const diff = lhs.rescaled(scale)._value - rhs.rescaled(scale)._value; #if defined(__CUDACC_DEBUG__) @@ -736,7 +753,7 @@ template CUDF_HOST_DEVICE inline bool operator==(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value == rhs.rescaled(scale)._value; } @@ -745,7 +762,7 @@ template CUDF_HOST_DEVICE inline bool operator!=(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value != rhs.rescaled(scale)._value; } @@ -754,7 +771,7 @@ template CUDF_HOST_DEVICE inline bool operator<=(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value <= rhs.rescaled(scale)._value; } @@ -763,7 +780,7 @@ template CUDF_HOST_DEVICE inline bool operator>=(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value >= rhs.rescaled(scale)._value; } @@ -772,7 +789,7 @@ template CUDF_HOST_DEVICE inline bool operator<(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value < rhs.rescaled(scale)._value; } @@ -781,7 +798,7 @@ template CUDF_HOST_DEVICE inline bool operator>(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); return lhs.rescaled(scale)._value > rhs.rescaled(scale)._value; } @@ -790,7 +807,7 @@ template CUDF_HOST_DEVICE inline fixed_point operator%(fixed_point const& lhs, fixed_point const& rhs) { - auto const scale = cuda::std::min(lhs._scale, rhs._scale); + auto const scale = detail::min(lhs._scale, rhs._scale); auto const remainder = lhs.rescaled(scale)._value % rhs.rescaled(scale)._value; return fixed_point{scaled_integer{remainder, scale}}; } diff --git a/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh b/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh index 103a70c078c..31390aa3edf 100644 --- a/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh +++ b/cpp/include/cudf/hashing/detail/murmurhash3_x64_128.cuh @@ -15,7 +15,7 @@ */ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh b/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh index ad9f4b08f4e..69edf38e359 100644 --- a/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh +++ b/cpp/include/cudf/hashing/detail/murmurhash3_x86_32.cuh @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/hashing/detail/xxhash_64.cuh b/cpp/include/cudf/hashing/detail/xxhash_64.cuh index 03e2b31ef41..d77d040b365 100644 --- a/cpp/include/cudf/hashing/detail/xxhash_64.cuh +++ b/cpp/include/cudf/hashing/detail/xxhash_64.cuh @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/unary.hpp b/cpp/include/cudf/unary.hpp index 344f9581c53..046e9745a71 100644 --- a/cpp/include/cudf/unary.hpp +++ b/cpp/include/cudf/unary.hpp @@ -17,7 +17,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/cpp/include/cudf/utilities/traits.hpp b/cpp/include/cudf/utilities/traits.hpp index a79631861e8..0f4bde204fa 100644 --- a/cpp/include/cudf/utilities/traits.hpp +++ b/cpp/include/cudf/utilities/traits.hpp @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/include/cudf/utilities/type_dispatcher.hpp b/cpp/include/cudf/utilities/type_dispatcher.hpp index 16b5e39fe7a..6351a84e38f 100644 --- a/cpp/include/cudf/utilities/type_dispatcher.hpp +++ b/cpp/include/cudf/utilities/type_dispatcher.hpp @@ -16,7 +16,7 @@ #pragma once -#include +#include #include #include #include diff --git a/cpp/src/binaryop/jit/kernel.cu b/cpp/src/binaryop/jit/kernel.cu index 0f6d8fe5c9c..1133e9ac22e 100644 --- a/cpp/src/binaryop/jit/kernel.cu +++ b/cpp/src/binaryop/jit/kernel.cu @@ -18,7 +18,7 @@ * limitations under the License. */ -#include +#include #include #include #include diff --git a/cpp/src/interop/decimal_conversion_utilities.cu b/cpp/src/interop/decimal_conversion_utilities.cu index 6eb725da48d..2f81c754a30 100644 --- a/cpp/src/interop/decimal_conversion_utilities.cu +++ b/cpp/src/interop/decimal_conversion_utilities.cu @@ -18,7 +18,7 @@ #include #include -#include +#include #include diff --git a/cpp/src/io/csv/csv_gpu.cu b/cpp/src/io/csv/csv_gpu.cu index b4c53fe52bf..e2bc75d4bab 100644 --- a/cpp/src/io/csv/csv_gpu.cu +++ b/cpp/src/io/csv/csv_gpu.cu @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/cpp/src/io/csv/datetime.cuh b/cpp/src/io/csv/datetime.cuh index 74bed6c298d..bfdba238a1e 100644 --- a/cpp/src/io/csv/datetime.cuh +++ b/cpp/src/io/csv/datetime.cuh @@ -19,7 +19,7 @@ #include "io/utilities/parsing_utils.cuh" #include "io/utilities/time_utils.cuh" -#include +#include #include #include diff --git a/cpp/src/io/parquet/reader_impl_helpers.hpp b/cpp/src/io/parquet/reader_impl_helpers.hpp index f0da204f932..fd692c0cdd6 100644 --- a/cpp/src/io/parquet/reader_impl_helpers.hpp +++ b/cpp/src/io/parquet/reader_impl_helpers.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/cpp/src/io/statistics/statistics_type_identification.cuh b/cpp/src/io/statistics/statistics_type_identification.cuh index 20d31308c97..5e11646be6b 100644 --- a/cpp/src/io/statistics/statistics_type_identification.cuh +++ b/cpp/src/io/statistics/statistics_type_identification.cuh @@ -24,7 +24,7 @@ #include "byte_array_view.cuh" #include "conversion_type_select.cuh" -#include +#include #include #include #include diff --git a/cpp/src/io/statistics/temp_storage_wrapper.cuh b/cpp/src/io/statistics/temp_storage_wrapper.cuh index 3fbf3dbb15c..b2e31ce9da7 100644 --- a/cpp/src/io/statistics/temp_storage_wrapper.cuh +++ b/cpp/src/io/statistics/temp_storage_wrapper.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024, 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. @@ -24,7 +24,7 @@ #include "byte_array_view.cuh" #include "statistics.cuh" -#include +#include #include #include #include diff --git a/cpp/src/io/statistics/typed_statistics_chunk.cuh b/cpp/src/io/statistics/typed_statistics_chunk.cuh index 21b2670f73a..dc023e69423 100644 --- a/cpp/src/io/statistics/typed_statistics_chunk.cuh +++ b/cpp/src/io/statistics/typed_statistics_chunk.cuh @@ -27,7 +27,7 @@ #include "statistics_type_identification.cuh" #include "temp_storage_wrapper.cuh" -#include +#include #include #include diff --git a/cpp/src/round/round.cu b/cpp/src/round/round.cu index 9321b062e1b..332c440aea9 100644 --- a/cpp/src/round/round.cu +++ b/cpp/src/round/round.cu @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/src/scalar/scalar.cpp b/cpp/src/scalar/scalar.cpp index d96dceeebeb..4b0b08fe251 100644 --- a/cpp/src/scalar/scalar.cpp +++ b/cpp/src/scalar/scalar.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cpp/src/unary/cast_ops.cu b/cpp/src/unary/cast_ops.cu index 2d1a01c5f2f..0913796a527 100644 --- a/cpp/src/unary/cast_ops.cu +++ b/cpp/src/unary/cast_ops.cu @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include From 623d672f1d78745a05f7337f494c3e21755c22cc Mon Sep 17 00:00:00 2001 From: Yunsong Wang Date: Sun, 5 Jan 2025 18:22:01 -0800 Subject: [PATCH 6/6] Update copyright years --- cpp/include/cudf/fixed_point/fixed_point.hpp | 2 +- cpp/src/binaryop/compiled/binary_ops.cuh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/include/cudf/fixed_point/fixed_point.hpp b/cpp/include/cudf/fixed_point/fixed_point.hpp index a6fb692612b..5edbb322231 100644 --- a/cpp/include/cudf/fixed_point/fixed_point.hpp +++ b/cpp/include/cudf/fixed_point/fixed_point.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2024, NVIDIA CORPORATION. + * Copyright (c) 2020-2025, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/cpp/src/binaryop/compiled/binary_ops.cuh b/cpp/src/binaryop/compiled/binary_ops.cuh index 0e13331ed4d..2f255e7a07c 100644 --- a/cpp/src/binaryop/compiled/binary_ops.cuh +++ b/cpp/src/binaryop/compiled/binary_ops.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024, NVIDIA CORPORATION. + * Copyright (c) 2021-2025, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.