From a249f24bcc217fc7a23d46788f1b52d5fdb72936 Mon Sep 17 00:00:00 2001 From: Mike Wilson Date: Mon, 10 Apr 2023 23:52:19 +0000 Subject: [PATCH 1/2] Adding ifdefs around nvcc specific pragmas --- cpp/include/cudf/column/column_view.hpp | 4 ++++ cpp/include/cudf/detail/interop.hpp | 4 ++++ cpp/include/cudf/interop.hpp | 6 +++++- cpp/include/cudf/io/datasource.hpp | 8 ++++++++ cpp/include/cudf/utilities/type_dispatcher.hpp | 8 ++++++++ cpp/src/quantiles/quantiles_util.hpp | 2 ++ 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/cpp/include/cudf/column/column_view.hpp b/cpp/include/cudf/column/column_view.hpp index 4889a62bbe4..6d722675626 100644 --- a/cpp/include/cudf/column/column_view.hpp +++ b/cpp/include/cudf/column/column_view.hpp @@ -329,9 +329,13 @@ class column_view : public detail::column_view_base { // they then end up being called by a simple __host__ function // (eg std::vector destructor) you get a compile error because you're trying to // call a __host__ __device__ function from a __host__ function. +#ifdef __CUDACC__ #pragma nv_exec_check_disable +#endif ~column_view() = default; +#ifdef __CUDACC__ #pragma nv_exec_check_disable +#endif column_view(column_view const&) = default; ///< Copy constructor column_view(column_view&&) = default; ///< Move constructor /** diff --git a/cpp/include/cudf/detail/interop.hpp b/cpp/include/cudf/detail/interop.hpp index 7117517487c..3d4832c8d17 100644 --- a/cpp/include/cudf/detail/interop.hpp +++ b/cpp/include/cudf/detail/interop.hpp @@ -19,11 +19,15 @@ // We disable warning 611 because the `arrow::TableBatchReader` only partially // override the `ReadNext` method of `arrow::RecordBatchReader::ReadNext` // triggering warning 611-D from nvcc. +#ifdef __CUDACC__ #pragma nv_diag_suppress 611 #pragma nv_diag_suppress 2810 +#endif #include +#ifdef __CUDACC__ #pragma nv_diag_default 611 #pragma nv_diag_default 2810 +#endif #include #include diff --git a/cpp/include/cudf/interop.hpp b/cpp/include/cudf/interop.hpp index 7e4eefa86b3..e210179b147 100644 --- a/cpp/include/cudf/interop.hpp +++ b/cpp/include/cudf/interop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2023, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,11 +19,15 @@ // We disable warning 611 because the `arrow::TableBatchReader` only partially // override the `ReadNext` method of `arrow::RecordBatchReader::ReadNext` // triggering warning 611-D from nvcc. +#ifdef __CUDACC__ #pragma nv_diag_suppress 611 #pragma nv_diag_suppress 2810 +#endif #include +#ifdef __CUDACC__ #pragma nv_diag_default 611 #pragma nv_diag_default 2810 +#endif #include #include diff --git a/cpp/include/cudf/io/datasource.hpp b/cpp/include/cudf/io/datasource.hpp index 12b8377bff2..5c37be5a56f 100644 --- a/cpp/include/cudf/io/datasource.hpp +++ b/cpp/include/cudf/io/datasource.hpp @@ -27,16 +27,24 @@ // We disable warning 611 because some Arrow subclasses of // `arrow::fs::FileSystem` only partially override the `Equals` method, // triggering warning 611-D from nvcc. +#ifdef __CUDACC__ #pragma nv_diag_suppress 611 +#endif #include #include +#ifdef __CUDACC__ #pragma nv_diag_default 611 +#endif // We disable warning 2810 to workaround the compile issue (warning treated as error): // result.h(263): error #2810-D: ignoring return value type with "nodiscard" attribute +#ifdef __CUDACC__ #pragma nv_diag_suppress 2810 +#endif #include +#ifdef __CUDACC__ #pragma nv_diag_default 2810 +#endif #include #include diff --git a/cpp/include/cudf/utilities/type_dispatcher.hpp b/cpp/include/cudf/utilities/type_dispatcher.hpp index ac6ef75c824..a80cd15d3c6 100644 --- a/cpp/include/cudf/utilities/type_dispatcher.hpp +++ b/cpp/include/cudf/utilities/type_dispatcher.hpp @@ -433,7 +433,9 @@ using scalar_device_type_t = typename type_to_scalar_type_impl::ScalarDeviceT */ // This pragma disables a compiler warning that complains about the valid usage // of calling a __host__ functor from this function which is __host__ __device__ +#ifdef __CUDACC__ #pragma nv_exec_check_disable +#endif template