Skip to content

Commit

Permalink
Add test for explicit user-side NVTX API use
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed May 20, 2024
1 parent a735b21 commit 18c083b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cub/test/test_nvtx_in_usercode_explicit.cu
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();
}

0 comments on commit 18c083b

Please sign in to comment.