NVTX C API Reference v3
NVIDIA Tools Extension Library
Loading...
Searching...
No Matches
nvToolsExtCudaRt.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#include "driver_types.h"
25
26#ifndef NVTOOLSEXT_CUDART_V3
27#define NVTOOLSEXT_CUDART_V3
28
29#ifdef __cplusplus
30extern "C" {
31#endif /* __cplusplus */
32
33/* ========================================================================= */
45/* ------------------------------------------------------------------------- */
46/* \cond SHOW_HIDDEN
47* \brief Used to build a non-colliding value for resource types separated class
48* \version \NVTX_VERSION_2
49*/
50#define NVTX_RESOURCE_CLASS_CUDART 5
53/* ------------------------------------------------------------------------- */
57{
58 NVTX_RESOURCE_TYPE_CUDART_DEVICE = NVTX_RESOURCE_MAKE_TYPE(CUDART, 0), /* int device */
59 NVTX_RESOURCE_TYPE_CUDART_STREAM = NVTX_RESOURCE_MAKE_TYPE(CUDART, 1), /* cudaStream_t */
60 NVTX_RESOURCE_TYPE_CUDART_EVENT = NVTX_RESOURCE_MAKE_TYPE(CUDART, 2), /* cudaEvent_t */
62
63
64/* ------------------------------------------------------------------------- */
74NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceA(int device, const char* name);
75NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceW(int device, const wchar_t* name);
78/* ------------------------------------------------------------------------- */
88NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamA(cudaStream_t stream, const char* name);
89NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamW(cudaStream_t stream, const wchar_t* name);
92/* ------------------------------------------------------------------------- */
102NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventA(cudaEvent_t event, const char* name);
103NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventW(cudaEvent_t event, const wchar_t* name);
/* END RESOURCE_NAMING */
107
108/* ========================================================================= */
109#ifdef UNICODE
110 #define nvtxNameCudaDevice nvtxNameCudaDeviceW
111 #define nvtxNameCudaStream nvtxNameCudaStreamW
112 #define nvtxNameCudaEvent nvtxNameCudaEventW
113#else
114 #define nvtxNameCudaDevice nvtxNameCudaDeviceA
115 #define nvtxNameCudaStream nvtxNameCudaStreamA
116 #define nvtxNameCudaEvent nvtxNameCudaEventA
117#endif
118
119#ifdef __cplusplus
120}
121#endif /* __cplusplus */
122
123#ifndef NVTX_NO_IMPL
124#define NVTX_IMPL_GUARD_CUDART /* Ensure other headers cannot be included directly */
125#include "nvtxDetail/nvtxImplCudaRt_v3.h"
126#undef NVTX_IMPL_GUARD_CUDART
127#endif /*NVTX_NO_IMPL*/
128
129#endif /* NVTOOLSEXT_CUDART_V3 */
nvtxResourceCUDARTType_t
Resource types for CUDART.
NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceA(int device, const char *name)
Annotates a CUDA device.
NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamA(cudaStream_t stream, const char *name)
Annotates a CUDA stream.
NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventA(cudaEvent_t event, const char *name)
Annotates a CUDA event.