This repository was archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 450
Deprecate TexRefInputIterator. #320
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,18 +42,6 @@ | |
#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 | ||
|
||
#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 | ||
|
@@ -79,8 +67,21 @@ namespace { | |
|
||
/// Global texture reference specialized by type | ||
template <typename T> | ||
struct IteratorTexRef | ||
struct CUB_DEPRECATED IteratorTexRef | ||
{ | ||
|
||
// This class uses the deprecated cudaBindTexture / cudaUnbindTexture APIs. | ||
// See issue NVIDIA/cub#191. | ||
// Turn off deprecation warnings when compiling class implementation in favor | ||
// of deprecating TexRefInputIterator instead. | ||
#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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do this so that we don't trigger deprecation warnings in our own code, only when users use the deprecated facility, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. |
||
|
||
/// And by unique ID | ||
template <int UNIQUE_ID> | ||
struct TexId | ||
|
@@ -143,6 +144,13 @@ template <typename T> | |
template <int UNIQUE_ID> | ||
typename IteratorTexRef<T>::template TexId<UNIQUE_ID>::TexRef IteratorTexRef<T>::template TexId<UNIQUE_ID>::ref = 0; | ||
|
||
// 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 | ||
|
||
} // Anonymous namespace | ||
|
||
|
@@ -161,6 +169,9 @@ typename IteratorTexRef<T>::template TexId<UNIQUE_ID>::TexRef IteratorTexRef<T>: | |
/** | ||
* \brief A random-access input wrapper for dereferencing array values through texture cache. Uses older Tesla/Fermi-style texture references. | ||
* | ||
* \deprecated [Since 1.13.0] The CUDA texture management APIs used by | ||
* TexRefInputIterator are deprecated. Use cub::TexObjInputIterator instead. | ||
* | ||
* \par Overview | ||
* - TexRefInputIterator wraps a native device pointer of type <tt>ValueType*</tt>. References | ||
* to elements are to be loaded through texture cache. | ||
|
@@ -176,7 +187,6 @@ typename IteratorTexRef<T>::template TexId<UNIQUE_ID>::TexRef IteratorTexRef<T>: | |
* created by the host thread and used by a top-level kernel (i.e. the one which is launched | ||
* from the host). | ||
* - Compatible with Thrust API v1.7 or newer. | ||
* - Compatible with CUDA toolkit v5.5 or newer. | ||
* | ||
* \par Snippet | ||
* The code snippet below illustrates the use of \p TexRefInputIterator to | ||
|
@@ -212,8 +222,21 @@ template < | |
typename T, | ||
int UNIQUE_ID, | ||
typename OffsetT = ptrdiff_t> | ||
class TexRefInputIterator | ||
class CUB_DEPRECATED TexRefInputIterator | ||
{ | ||
|
||
// This class uses the deprecated cudaBindTexture / cudaUnbindTexture APIs. | ||
// See issue NVIDIA/cub#191. | ||
// Turn off deprecation warnings when compiling class implementation in favor | ||
// of deprecating TexRefInputIterator instead. | ||
#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 | ||
|
||
public: | ||
|
||
// Required iterator traits | ||
|
@@ -379,6 +402,14 @@ public: | |
return os; | ||
} | ||
|
||
// 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 | ||
|
||
}; | ||
|
||
|
||
|
@@ -389,11 +420,3 @@ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this comment, why "in favor of deprecating TexRefInputIterator"? Don't we disable warnings here so that they don't trigger in our own code, just on external usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The internal usages of deprecated CUDART APIs are always suppressed, and instead we deprecate the CUB utilities that call them. So instead of emitting deprecation warnings for
cudaBindTexture
, etc, we deprecatecub::TexRefInputIterator
directly.