diff --git a/cpp/include/cudf/detail/utilities/device_operators.cuh b/cpp/include/cudf/detail/utilities/device_operators.cuh index 46f424e051b..d16be5e22dd 100644 --- a/cpp/include/cudf/detail/utilities/device_operators.cuh +++ b/cpp/include/cudf/detail/utilities/device_operators.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2023, NVIDIA CORPORATION. + * Copyright (c) 2019-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. @@ -83,7 +83,11 @@ struct DeviceSum { template ()>* = nullptr> static constexpr T identity() { +#ifndef __CUDA_ARCH__ CUDF_FAIL("fixed_point does not yet support device operator identity"); +#else + CUDF_UNREACHABLE("fixed_point does not yet support device operator identity"); +#endif return T{}; } }; @@ -141,7 +145,11 @@ struct DeviceMin { template ()>* = nullptr> static constexpr T identity() { +#ifndef __CUDA_ARCH__ CUDF_FAIL("fixed_point does not yet support DeviceMin identity"); +#else + CUDF_UNREACHABLE("fixed_point does not yet support DeviceMin identity"); +#endif return cuda::std::numeric_limits::max(); } @@ -189,7 +197,11 @@ struct DeviceMax { template ()>* = nullptr> static constexpr T identity() { +#ifndef __CUDA_ARCH__ CUDF_FAIL("fixed_point does not yet support DeviceMax identity"); +#else + CUDF_UNREACHABLE("fixed_point does not yet support DeviceMax identity"); +#endif return cuda::std::numeric_limits::lowest(); } @@ -225,7 +237,11 @@ struct DeviceProduct { template ()>* = nullptr> static constexpr T identity() { +#ifndef __CUDA_ARCH__ CUDF_FAIL("fixed_point does not yet support DeviceProduct identity"); +#else + CUDF_UNREACHABLE("fixed_point does not yet support DeviceProduct identity"); +#endif return T{1, numeric::scale_type{0}}; } }; diff --git a/cpp/include/cudf/utilities/span.hpp b/cpp/include/cudf/utilities/span.hpp index 21ee4fa9e9b..2273a89892b 100644 --- a/cpp/include/cudf/utilities/span.hpp +++ b/cpp/include/cudf/utilities/span.hpp @@ -417,7 +417,9 @@ class base_2dspan { constexpr base_2dspan(RowType flat_view, size_t columns) : _flat{flat_view}, _size{columns == 0 ? 0 : flat_view.size() / columns, columns} { +#ifndef __CUDA_ARCH__ CUDF_EXPECTS(_size.first * _size.second == flat_view.size(), "Invalid 2D span size"); +#endif } /** diff --git a/cpp/src/io/orc/writer_impl.cu b/cpp/src/io/orc/writer_impl.cu index d432deb8e79..76e5369ffd0 100644 --- a/cpp/src/io/orc/writer_impl.cu +++ b/cpp/src/io/orc/writer_impl.cu @@ -506,7 +506,7 @@ size_t max_varint_size() return cudf::util::div_rounding_up_unsafe(sizeof(T) * 8, 7); } -constexpr size_t RLE_stream_size(TypeKind kind, size_t count) +size_t RLE_stream_size(TypeKind kind, size_t count) { using cudf::util::div_rounding_up_unsafe; constexpr auto byte_rle_max_len = 128; diff --git a/cpp/src/io/utilities/time_utils.cuh b/cpp/src/io/utilities/time_utils.cuh index 687766c1bcc..ff1b9f58e6c 100644 --- a/cpp/src/io/utilities/time_utils.cuh +++ b/cpp/src/io/utilities/time_utils.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, 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. @@ -32,7 +32,7 @@ static const __device__ __constant__ int32_t powers_of_ten[10] = { struct get_period { template - constexpr int32_t operator()() + int32_t operator()() { if constexpr (is_chrono()) { return T::period::den; } CUDF_FAIL("Invalid, non chrono type"); @@ -42,7 +42,7 @@ struct get_period { /** * @brief Function that translates cuDF time unit to clock frequency */ -constexpr int32_t to_clockrate(type_id timestamp_type_id) +inline int32_t to_clockrate(type_id timestamp_type_id) { return timestamp_type_id == type_id::EMPTY ? 0