From fd544e6cdbea45d15336f9d253617de3fc070421 Mon Sep 17 00:00:00 2001 From: ptaylor Date: Fri, 30 Jul 2021 12:25:15 -0500 Subject: [PATCH 1/5] make all nvcc warnings into errors --- 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 716163b5530..c1ae52a18a8 100644 --- a/cpp/cmake/Modules/ConfigureCUDA.cmake +++ b/cpp/cmake/Modules/ConfigureCUDA.cmake @@ -34,7 +34,7 @@ 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) +list(APPEND CUDF_CUDA_FLAGS -Werror=all-warnings) list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations) if(DISABLE_DEPRECATION_WARNING) From 6ab88446944dc65d0e11a608743b5eea70a899fa Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 1 Nov 2022 16:35:03 -0700 Subject: [PATCH 2/5] Add pragmas to suppress warnings from arrow. --- cpp/include/cudf/io/datasource.hpp | 2 ++ cpp/tests/io/arrow_io_source_test.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cpp/include/cudf/io/datasource.hpp b/cpp/include/cudf/io/datasource.hpp index 907830de2bb..2b56894d375 100644 --- a/cpp/include/cudf/io/datasource.hpp +++ b/cpp/include/cudf/io/datasource.hpp @@ -22,8 +22,10 @@ #include #include +#pragma nv_diag_suppress 611 #include #include +#pragma nv_diag_default 611 #include #include #include diff --git a/cpp/tests/io/arrow_io_source_test.cpp b/cpp/tests/io/arrow_io_source_test.cpp index 3ef61b0ee26..4cc5d272779 100644 --- a/cpp/tests/io/arrow_io_source_test.cpp +++ b/cpp/tests/io/arrow_io_source_test.cpp @@ -25,7 +25,9 @@ #include #include +#pragma nv_diag_suppress 611 #include +#pragma nv_diag_default 611 #include #include From 2889808050c6d10dae80da821ca111313c1f210e Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 1 Nov 2022 17:05:53 -0700 Subject: [PATCH 3/5] Address PR comments. --- cpp/include/cudf/io/datasource.hpp | 5 +++++ cpp/tests/io/arrow_io_source_test.cpp | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/include/cudf/io/datasource.hpp b/cpp/include/cudf/io/datasource.hpp index 2b56894d375..251a93ac21f 100644 --- a/cpp/include/cudf/io/datasource.hpp +++ b/cpp/include/cudf/io/datasource.hpp @@ -22,10 +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 diff --git a/cpp/tests/io/arrow_io_source_test.cpp b/cpp/tests/io/arrow_io_source_test.cpp index 4cc5d272779..3ef61b0ee26 100644 --- a/cpp/tests/io/arrow_io_source_test.cpp +++ b/cpp/tests/io/arrow_io_source_test.cpp @@ -25,9 +25,7 @@ #include #include -#pragma nv_diag_suppress 611 #include -#pragma nv_diag_default 611 #include #include From b0af93a395511df3d872dc2723d5ea89fdf917a0 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 1 Nov 2022 18:18:40 -0700 Subject: [PATCH 4/5] Also stop warnings on arrow/api.h. --- cpp/include/cudf/detail/interop.hpp | 6 ++++++ cpp/include/cudf/interop.hpp | 5 +++++ 2 files changed, 11 insertions(+) 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 From 0104a3db1ca22c36c62a773f9f316e3d4d3043b3 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 2 Nov 2022 09:44:10 -0700 Subject: [PATCH 5/5] Make warnings as errors optional. --- cpp/CMakeLists.txt | 1 + cpp/cmake/Modules/ConfigureCUDA.cmake | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 0c251511aa6..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=all-warnings) +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)