NVTX C API Reference v3
NVIDIA Tools Extension Library
Loading...
Searching...
No Matches
nvToolsExtCuda.h
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2009-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 * Licensed under the Apache License v2.0 with LLVM Exceptions.
18 * See LICENSE.txt for license information.
19 */
20
21#include "nvToolsExt.h"
22
23#include "cuda.h"
24
25#ifndef NVTOOLSEXT_CUDA_V3
26#define NVTOOLSEXT_CUDA_V3
27
28#ifdef __cplusplus
29extern "C" {
30#endif /* __cplusplus */
31
32/* ========================================================================= */
44/* ------------------------------------------------------------------------- */
45/* \cond SHOW_HIDDEN
46* \brief Used to build a non-colliding value for resource types separated class
47* \version \NVTX_VERSION_2
48*/
49#define NVTX_RESOURCE_CLASS_CUDA 4
52/* ------------------------------------------------------------------------- */
56{
57 NVTX_RESOURCE_TYPE_CUDA_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDA, 1), /* CUdevice */
58 NVTX_RESOURCE_TYPE_CUDA_CONTEXT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 2), /* CUcontext */
59 NVTX_RESOURCE_TYPE_CUDA_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDA, 3), /* CUstream */
60 NVTX_RESOURCE_TYPE_CUDA_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDA, 4), /* CUevent */
62
63
64/* ------------------------------------------------------------------------- */
74NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char* name);
75NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceW(CUdevice device, const wchar_t* name);
78/* ------------------------------------------------------------------------- */
96NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char* name);
97NVTX_DECLSPEC void NVTX_API nvtxNameCuContextW(CUcontext context, const wchar_t* name);
100/* ------------------------------------------------------------------------- */
110NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char* name);
111NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamW(CUstream stream, const wchar_t* name);
114/* ------------------------------------------------------------------------- */
124NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char* name);
125NVTX_DECLSPEC void NVTX_API nvtxNameCuEventW(CUevent event, const wchar_t* name);
/* END RESOURCE_NAMING */
129
130/* ========================================================================= */
131#ifdef UNICODE
132 #define nvtxNameCuDevice nvtxNameCuDeviceW
133 #define nvtxNameCuContext nvtxNameCuContextW
134 #define nvtxNameCuStream nvtxNameCuStreamW
135 #define nvtxNameCuEvent nvtxNameCuEventW
136#else
137 #define nvtxNameCuDevice nvtxNameCuDeviceA
138 #define nvtxNameCuContext nvtxNameCuContextA
139 #define nvtxNameCuStream nvtxNameCuStreamA
140 #define nvtxNameCuEvent nvtxNameCuEventA
141#endif
142
143#ifdef __cplusplus
144}
145#endif /* __cplusplus */
146
147#ifndef NVTX_NO_IMPL
148#define NVTX_IMPL_GUARD_CUDA /* Ensure other headers cannot be included directly */
149#include "nvtxDetail/nvtxImplCuda_v3.h"
150#undef NVTX_IMPL_GUARD_CUDA
151#endif /*NVTX_NO_IMPL*/
152
153#endif /* NVTOOLSEXT_CUDA_V3 */
NVTX_DECLSPEC void NVTX_API nvtxNameCuDeviceA(CUdevice device, const char *name)
Annotates a CUDA device.
NVTX_DECLSPEC void NVTX_API nvtxNameCuEventA(CUevent event, const char *name)
Annotates a CUDA event.
NVTX_DECLSPEC void NVTX_API nvtxNameCuContextA(CUcontext context, const char *name)
Annotates a CUDA context.
nvtxResourceCUDAType_t
Resource types for CUDA.
NVTX_DECLSPEC void NVTX_API nvtxNameCuStreamA(CUstream stream, const char *name)
Annotates a CUDA stream.