-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test combined internal/user-side use of NVTX (#1690)
Co-authored-by: Allison Piper <apiper@nvidia.com>
- Loading branch information
1 parent
db61c65
commit c910b16
Showing
2 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <cub/device/device_for.cuh> // internal include of NVTX | ||
|
||
#include <thrust/iterator/counting_iterator.h> | ||
|
||
#include <nvtx3/nvtx3.hpp> // user-side include of NVTX, retrieved elsewhere | ||
|
||
struct Op | ||
{ | ||
_CCCL_HOST_DEVICE void operator()(int i) const | ||
{ | ||
printf("%d\n", i); | ||
} | ||
}; | ||
|
||
int main() | ||
{ | ||
nvtx3::scoped_range range("user-range"); // user-side use of NVTX | ||
|
||
thrust::counting_iterator<int> it{0}; | ||
cub::DeviceFor::ForEach(it, it + 16, Op{}); // internal use of NVTX | ||
cudaDeviceSynchronize(); | ||
} |