Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ifdefs around nvcc-specific pragmas #13110

Merged
merged 4 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpp/include/cudf/column/column_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
/**
Expand Down
4 changes: 4 additions & 0 deletions cpp/include/cudf/detail/interop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <arrow/api.h>
#ifdef __CUDACC__
#pragma nv_diag_default 611
#pragma nv_diag_default 2810
#endif

#include <cudf/interop.hpp>
#include <cudf/utilities/default_stream.hpp>
Expand Down
6 changes: 5 additions & 1 deletion cpp/include/cudf/interop.hpp
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 <arrow/api.h>
#ifdef __CUDACC__
#pragma nv_diag_default 611
#pragma nv_diag_default 2810
#endif

#include <cudf/column/column.hpp>
#include <cudf/detail/transform.hpp>
Expand Down
8 changes: 8 additions & 0 deletions cpp/include/cudf/io/datasource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <arrow/filesystem/filesystem.h>
#include <arrow/filesystem/s3fs.h>
#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 <arrow/result.h>
#ifdef __CUDACC__
#pragma nv_diag_default 2810
#endif

#include <arrow/io/file.h>
#include <arrow/io/interfaces.h>
Expand Down
8 changes: 8 additions & 0 deletions cpp/include/cudf/utilities/type_dispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ using scalar_device_type_t = typename type_to_scalar_type_impl<T>::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 <template <cudf::type_id> typename IdTypeMap = id_to_type_impl,
typename Functor,
typename... Ts>
Expand Down Expand Up @@ -540,7 +542,9 @@ CUDF_HOST_DEVICE __forceinline__ constexpr decltype(auto) type_dispatcher(cudf::
namespace detail {
template <typename T1>
struct double_type_dispatcher_second_type {
#ifdef __CUDACC__
#pragma nv_exec_check_disable
#endif
template <typename T2, typename F, typename... Ts>
CUDF_HOST_DEVICE __forceinline__ decltype(auto) operator()(F&& f, Ts&&... args) const
{
Expand All @@ -550,7 +554,9 @@ struct double_type_dispatcher_second_type {

template <template <cudf::type_id> typename IdTypeMap>
struct double_type_dispatcher_first_type {
#ifdef __CUDACC__
#pragma nv_exec_check_disable
#endif
template <typename T1, typename F, typename... Ts>
CUDF_HOST_DEVICE __forceinline__ decltype(auto) operator()(cudf::data_type type2,
F&& f,
Expand Down Expand Up @@ -580,7 +586,9 @@ struct double_type_dispatcher_first_type {
*
* @return The result of invoking `f.template operator<T1, T2>(args)`
*/
#ifdef __CUDACC__
#pragma nv_exec_check_disable
#endif
template <template <cudf::type_id> typename IdTypeMap = id_to_type_impl, typename F, typename... Ts>
CUDF_HOST_DEVICE __forceinline__ constexpr decltype(auto) double_type_dispatcher(
cudf::data_type type1, cudf::data_type type2, F&& f, Ts&&... args)
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/quantiles/quantiles_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ struct quantile_index {
}
};

#ifdef __CUDACC__
#pragma nv_exec_check_disable
#endif
/* @brief computes a quantile value.
*
* Computes a value for a quantile by interpolating between two values on either
Expand Down