Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.
Prev Previous commit
Next Next commit
Suppress deprecation warnings for TexRefInputIterator.
We need to deprecate this class since the underlying CUDA APIs
are deprecated. This suppression is a temporary workaround.

Tracked by #191.
  • Loading branch information
alliepiper committed Feb 10, 2021
commit e4591c1e38ee09f1b94988988dff82f980e0d326
20 changes: 20 additions & 0 deletions cub/iterator/tex_ref_input_iterator.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
#include "../util_debug.cuh"
#include "../config.cuh"

// This class needs to go through a deprecation cycle and be removed, as the
// underlying cudaBindTexture / cudaUnbindTexture APIs are deprecated.
// See issue NVIDIA/cub#191.
// Turn off deprecation warnings when compiling this file until then.
#if CUB_HOST_COMPILER == CUB_HOST_COMPILER_MSVC
#pragma warning(disable:4996)
#elif CUB_HOST_COMPILER == CUB_HOST_COMPILER_GCC || \
CUB_HOST_COMPILER == CUB_HOST_COMPILER_CLANG
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would deprecate or remove this entirely.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if (CUDART_VERSION >= 5050) || defined(DOXYGEN_ACTIVE) // This iterator is compatible with CUDA 5.5 and newer

#if (THRUST_VERSION >= 100700) // This iterator is compatible with Thrust API 1.7 and newer
Expand Down Expand Up @@ -377,3 +389,11 @@ public:
CUB_NS_POSTFIX // Optional outer namespace(s)

#endif // CUDART_VERSION

// Re-enable deprecation warnings:
#if CUB_HOST_COMPILER == CUB_HOST_COMPILER_MSVC
#pragma warning(default:4996)
#elif CUB_HOST_COMPILER == CUB_HOST_COMPILER_GCC || \
CUB_HOST_COMPILER == CUB_HOST_COMPILER_CLANG
#pragma GCC diagnostic pop
#endif