-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use only explicit NVTX3 V1 API in CUB (#1751)
* Simplify NVTX tests * Add test for explicit user-side NVTX API use * Program against explicitly versioned NVTX V1 API The explicit V1 API is always available. See discussion here: NVIDIA/NVTX#96 Fixes: #1750
- Loading branch information
1 parent
2f8aa7d
commit d6fe433
Showing
4 changed files
with
56 additions
and
36 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#define NVTX3_CPP_REQUIRE_EXPLICIT_VERSION | ||
#include <cub/device/device_for.cuh> // internal include of NVTX | ||
|
||
#include <thrust/iterator/counting_iterator.h> | ||
|
||
#include <cuda/std/functional> | ||
|
||
#include <nvtx3/nvtx3.hpp> // user-side include of NVTX, retrieved elsewhere | ||
|
||
int main() | ||
{ | ||
nvtx3::v1::scoped_range range("user-range"); // user-side use of explicit NVTX API | ||
|
||
thrust::counting_iterator<int> it{0}; | ||
cub::DeviceFor::ForEach(it, it + 16, ::cuda::std::negate<int>{}); // internal use of NVTX | ||
cudaDeviceSynchronize(); | ||
} |
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