diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 289c432dea5..d63c7e75616 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -66,6 +66,7 @@ option(DISABLE_DEPRECATION_WARNINGS "Disable warnings generated from deprecated option(CUDA_ENABLE_LINEINFO "Enable the -lineinfo option for nvcc (useful for cuda-memcheck / profiler" OFF ) +option(CUDA_WARNINGS_AS_ERRORS "Enable -Werror=all-warnings for all CUDA compilation" ON) # cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic linking option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF) diff --git a/cpp/cmake/Modules/ConfigureCUDA.cmake b/cpp/cmake/Modules/ConfigureCUDA.cmake index 9ee4d3e411c..f79e4c37228 100644 --- a/cpp/cmake/Modules/ConfigureCUDA.cmake +++ b/cpp/cmake/Modules/ConfigureCUDA.cmake @@ -19,7 +19,11 @@ endif() list(APPEND CUDF_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) # set warnings as errors -list(APPEND CUDF_CUDA_FLAGS -Werror=cross-execution-space-call) +if(CUDA_WARNINGS_AS_ERRORS) + list(APPEND CUDF_CUDA_FLAGS -Werror=all-warnings) +else() + list(APPEND CUDF_CUDA_FLAGS -Werror=cross-execution-space-call) +endif() list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations) if(DISABLE_DEPRECATION_WARNINGS) diff --git a/cpp/include/cudf/detail/interop.hpp b/cpp/include/cudf/detail/interop.hpp index 2215f052113..5a5bbe7f683 100644 --- a/cpp/include/cudf/detail/interop.hpp +++ b/cpp/include/cudf/detail/interop.hpp @@ -16,7 +16,13 @@ #pragma once +// We disable warning 611 because the `arrow::TableBatchReader` only partially +// override the `ReadNext` method of `arrow::RecordBatchReader::ReadNext` +// triggering warning 611-D from nvcc. +#pragma nv_diag_suppress 611 #include +#pragma nv_diag_default 611 + #include #include #include diff --git a/cpp/include/cudf/interop.hpp b/cpp/include/cudf/interop.hpp index 016e23688c7..c1c58f136d6 100644 --- a/cpp/include/cudf/interop.hpp +++ b/cpp/include/cudf/interop.hpp @@ -16,7 +16,12 @@ #pragma once +// We disable warning 611 because the `arrow::TableBatchReader` only partially +// override the `ReadNext` method of `arrow::RecordBatchReader::ReadNext` +// triggering warning 611-D from nvcc. +#pragma nv_diag_suppress 611 #include +#pragma nv_diag_default 611 #include #include diff --git a/cpp/include/cudf/io/datasource.hpp b/cpp/include/cudf/io/datasource.hpp index 907830de2bb..251a93ac21f 100644 --- a/cpp/include/cudf/io/datasource.hpp +++ b/cpp/include/cudf/io/datasource.hpp @@ -22,8 +22,15 @@ #include #include + +// We disable warning 611 because some Arrow subclasses of +// `arrow::fs::FileSystem` only partially override the `Equals` method, +// triggering warning 611-D from nvcc. +#pragma nv_diag_suppress 611 #include #include +#pragma nv_diag_default 611 + #include #include #include