2 * Copyright 2012 NVIDIA Corporation. All rights reserved.
6 * This source code is subject to NVIDIA ownership rights under U.S. and
7 * international Copyright laws.
9 * This software and the information contained herein is PROPRIETARY and
10 * CONFIDENTIAL to NVIDIA and is being provided under the terms and conditions
11 * of a form of NVIDIA software license agreement.
13 * NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE
14 * CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR
15 * IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH
16 * REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF
17 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
18 * IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
19 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
20 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
21 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
22 * OR PERFORMANCE OF THIS SOURCE CODE.
24 * U.S. Government End Users. This source code is a "commercial item" as
25 * that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting of
26 * "commercial computer software" and "commercial computer software
27 * documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995)
28 * and is provided to the U.S. Government only as a commercial end item.
29 * Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through
30 * 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the
31 * source code with only those rights set forth herein.
33 * Any use of this source code in individual and commercial software must
34 * include, in the user documentation and internal comments to the code,
35 * the above Disclaimer and U.S. Government End Users Notice.
38 #ifndef NVTOOLSEXT_CUDART_H_
39 #define NVTOOLSEXT_CUDART_H_
42 #include "cuda_runtime_api.h"
44 #include "nvToolsExt.h"
48 #endif /* __cplusplus */
50 /* ========================================================================= */
51 /** \name Functions for CUDA Resource Naming
53 /** \addtogroup RESOURCE_NAMING
54 * \section RESOURCE_NAMING_CUDA CUDA Resource Naming
56 * This section covers the API functions that allow to annotate CUDA resources
57 * with user-provided names.
62 /* ------------------------------------------------------------------------- */
63 /** \brief Annotates a CUDA device.
65 * Allows the user to associate a CUDA device with a user-provided name.
67 * \param device - The id of the CUDA device to name.
68 * \param name - The name of the CUDA device.
70 * \version \NVTX_VERSION_1
72 NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceA(int device, const char* name);
73 NVTX_DECLSPEC void NVTX_API nvtxNameCudaDeviceW(int device, const wchar_t* name);
76 /* ------------------------------------------------------------------------- */
77 /** \brief Annotates a CUDA stream.
79 * Allows the user to associate a CUDA stream with a user-provided name.
81 * \param stream - The handle of the CUDA stream to name.
82 * \param name - The name of the CUDA stream.
84 * \version \NVTX_VERSION_1
86 NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamA(cudaStream_t stream, const char* name);
87 NVTX_DECLSPEC void NVTX_API nvtxNameCudaStreamW(cudaStream_t stream, const wchar_t* name);
90 /* ------------------------------------------------------------------------- */
91 /** \brief Annotates a CUDA event.
93 * Allows the user to associate a CUDA event with a user-provided name.
95 * \param event - The handle of the CUDA event to name.
96 * \param name - The name of the CUDA event.
98 * \version \NVTX_VERSION_1
100 NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventA(cudaEvent_t event, const char* name);
101 NVTX_DECLSPEC void NVTX_API nvtxNameCudaEventW(cudaEvent_t event, const wchar_t* name);
104 /** @} */ /* END RESOURCE_NAMING */
106 /* ========================================================================= */
108 #define nvtxNameCudaDevice nvtxNameCudaDeviceW
109 #define nvtxNameCudaStream nvtxNameCudaStreamW
110 #define nvtxNameCudaEvent nvtxNameCudaEventW
112 #define nvtxNameCudaDevice nvtxNameCudaDeviceA
113 #define nvtxNameCudaStream nvtxNameCudaStreamA
114 #define nvtxNameCudaEvent nvtxNameCudaEventA
119 #endif /* __cplusplus */
121 #endif /* NVTOOLSEXT_CUDART_H_ */