Skip to content

Commit

Permalink
Make all nvcc warnings into errors (#8916)
Browse files Browse the repository at this point in the history
Seeing what impact [`-Werror=all-warnings`](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#generic-tool-options-Werror) has on device-side compilation.

Device warnings now treated as errors:
```
cudf/cpp/src/io/orc/stripe_enc.cu (633): error: dynamic initialization is not supported for a function-scope static __shared__ variable within a __device__/__global__ function

cudf/cpp/src/io/orc/writer_impl.cu
ptxas error   : Stack size for entry function '_ZN4cudf6detail20single_thread_kernelIZNS_2io6detail3orc19make_orc_table_viewERKNS_10table_viewERKNS_17table_device_viewEPKNS2_14table_metadataEN3rmm16cuda_stream_viewEEUlvE_EEvT_' cannot be statically determined

cudf/cpp/src/binaryop/compiled/binary_ops.cu(46): error: parameter "mr" was declared but never referenced

cudf/cpp/src/binaryop/compiled/binary_ops.cu(204): error: variable "out" was declared but never referenced
```

Authors:
  - Paul Taylor (https://github.com/trxcllnt)
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Jake Hemstad (https://github.com/jrhemstad)
  - Bradley Dice (https://github.com/bdice)
  - Robert Maynard (https://github.com/robertmaynard)

URL: #8916
  • Loading branch information
trxcllnt authored Nov 2, 2022
1 parent 856ac3f commit d949cd2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 5 additions & 1 deletion cpp/cmake/Modules/ConfigureCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions cpp/include/cudf/detail/interop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <arrow/api.h>
#pragma nv_diag_default 611

#include <cudf/interop.hpp>
#include <cudf/utilities/default_stream.hpp>
#include <cudf/utilities/error.hpp>
Expand Down
5 changes: 5 additions & 0 deletions cpp/include/cudf/interop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <arrow/api.h>
#pragma nv_diag_default 611

#include <cudf/column/column.hpp>
#include <cudf/detail/transform.hpp>
Expand Down
7 changes: 7 additions & 0 deletions cpp/include/cudf/io/datasource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@
#include <rmm/cuda_stream_view.hpp>

#include <arrow/buffer.h>

// 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 <arrow/filesystem/filesystem.h>
#include <arrow/filesystem/s3fs.h>
#pragma nv_diag_default 611

#include <arrow/io/file.h>
#include <arrow/io/interfaces.h>
#include <arrow/io/memory.h>
Expand Down

0 comments on commit d949cd2

Please sign in to comment.