Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
cudaProfiler.h217 linesDownload Raw Back to include
1/*
2 * Copyright 1993-2018 NVIDIA Corporation.  All rights reserved.
3 *
4 * NOTICE TO LICENSEE:
5 *
6 * This source code and/or documentation ("Licensed Deliverables") are
7 * subject to NVIDIA intellectual property rights under U.S. and
8 * international Copyright laws.
9 *
10 * These Licensed Deliverables contained herein is PROPRIETARY and
11 * CONFIDENTIAL to NVIDIA and is being provided under the terms and
12 * conditions of a form of NVIDIA software license agreement by and
13 * between NVIDIA and Licensee ("License Agreement") or electronically
14 * accepted by Licensee.  Notwithstanding any terms or conditions to
15 * the contrary in the License Agreement, reproduction or disclosure
16 * of the Licensed Deliverables to any third party without the express
17 * written consent of NVIDIA is prohibited.
18 *
19 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
20 * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
21 * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE.  IT IS
22 * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
23 * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
24 * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
25 * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
26 * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
27 * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
28 * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
29 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
30 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
31 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
32 * OF THESE LICENSED DELIVERABLES.
33 *
34 * U.S. Government End Users.  These Licensed Deliverables are a
35 * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
36 * 1995), consisting of "commercial computer software" and "commercial
37 * computer software documentation" as such terms are used in 48
38 * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
39 * only as a commercial end item.  Consistent with 48 C.F.R.12.212 and
40 * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
41 * U.S. Government End Users acquire the Licensed Deliverables with
42 * only those rights set forth herein.
43 *
44 * Any use of the Licensed Deliverables in individual and commercial
45 * software must include, in the user documentation and internal
46 * comments to the code, the above Disclaimer and U.S. Government End
47 * Users Notice.
48 */
49
50#ifndef cuda_profiler_H
51#define cuda_profiler_H
52
53#include <cuda.h>
54
55#if defined(__CUDA_API_VERSION_INTERNAL) || defined(__DOXYGEN_ONLY__) || defined(CUDA_ENABLE_DEPRECATED)
56#define __CUDA_DEPRECATED
57#elif defined(_MSC_VER)
58#define __CUDA_DEPRECATED __declspec(deprecated)
59#elif defined(__GNUC__)
60#define __CUDA_DEPRECATED __attribute__((deprecated))
61#else
62#define __CUDA_DEPRECATED
63#endif
64
65#ifdef __cplusplus
66extern "C" {
67#endif
68
69/**
70 * Profiler Output Modes
71 */
72/*DEVICE_BUILTIN*/
73typedef enum CUoutput_mode_enum
74{
75    CU_OUT_KEY_VALUE_PAIR  = 0x00, /**< Output mode Key-Value pair format. */
76    CU_OUT_CSV             = 0x01  /**< Output mode Comma separated values format. */
77}CUoutput_mode;
78
79
80/**
81 * \ingroup CUDA_DRIVER
82 * \defgroup CUDA_PROFILER_DEPRECATED Profiler Control [DEPRECATED]
83 *
84 * ___MANBRIEF___ profiler control functions of the low-level CUDA driver API
85 * (___CURRENT_FILE___) ___ENDMANBRIEF___
86 *
87 * This section describes the profiler control functions of the low-level CUDA
88 * driver application programming interface.
89 *
90 * @{
91 */
92
93/**
94 * \brief Initialize the profiling.
95 *
96 * \deprecated
97 *
98 * Note that this function is deprecated and should not be used.
99 * Starting with CUDA 12.0, it always returns error code ::CUDA_ERROR_NOT_SUPPORTED.
100 * 
101 * Using this API user can initialize the CUDA profiler by specifying
102 * the configuration file, output file and output file format. This
103 * API is generally used to profile different set of counters by
104 * looping the kernel launch. The \p configFile parameter can be used
105 * to select profiling options including profiler counters. Refer to
106 * the "Compute Command Line Profiler User Guide" for supported
107 * profiler options and counters.
108 *
109 * Limitation: The CUDA profiler cannot be initialized with this API
110 * if another profiling tool is already active, as indicated by the
111 * ::CUDA_ERROR_PROFILER_DISABLED return code.
112 *
113 * Typical usage of the profiling APIs is as follows: 
114 *
115 * for each set of counters/options\n
116 * {\n
117 *     cuProfilerInitialize(); //Initialize profiling, set the counters or options in the config file \n
118 *     ...\n
119 *     cuProfilerStart(); \n
120 *     // code to be profiled \n
121 *     cuProfilerStop(); \n
122 *     ...\n
123 *     cuProfilerStart(); \n
124 *     // code to be profiled \n
125 *     cuProfilerStop(); \n
126 *     ...\n
127 * }\n
128 *
129 * \param configFile - Name of the config file that lists the counters/options
130 * for profiling.
131 * \param outputFile - Name of the outputFile where the profiling results will
132 * be stored.
133 * \param outputMode - outputMode, can be ::CU_OUT_KEY_VALUE_PAIR or ::CU_OUT_CSV.
134 *
135 * \return
136 * ::CUDA_ERROR_NOT_SUPPORTED
137 * \notefnerr
138 *
139 * \sa
140 * ::cuProfilerStart,
141 * ::cuProfilerStop,
142 */
143__CUDA_DEPRECATED CUresult CUDAAPI cuProfilerInitialize(const char *configFile, const char *outputFile, CUoutput_mode outputMode);
144 
145/** @} */ /* END CUDA_PROFILER_DEPRECATED */
146
147/**
148 * \ingroup CUDA_DRIVER
149 * \defgroup CUDA_PROFILER Profiler Control 
150 *
151 * ___MANBRIEF___ profiler control functions of the low-level CUDA driver API
152 * (___CURRENT_FILE___) ___ENDMANBRIEF___
153 *
154 * This section describes the profiler control functions of the low-level CUDA
155 * driver application programming interface.
156 *
157 * @{
158 */
159
160/**
161 * \brief Enable profiling.
162 *
163 * Enables profile collection by the active profiling tool for the
164 * current context. If profiling is already enabled, then
165 * cuProfilerStart() has no effect.
166 *
167 * cuProfilerStart and cuProfilerStop APIs are used to
168 * programmatically control the profiling granularity by allowing
169 * profiling to be done only on selective pieces of code.
170 * 
171 *
172 * \return
173 * ::CUDA_SUCCESS,
174 * ::CUDA_ERROR_INVALID_CONTEXT
175 * \notefnerr
176 *
177 * \sa
178 * ::cuProfilerInitialize,
179 * ::cuProfilerStop,
180 * ::cudaProfilerStart
181 */
182CUresult CUDAAPI cuProfilerStart(void);
183
184/**
185 * \brief Disable profiling.
186 *
187 * Disables profile collection by the active profiling tool for the
188 * current context. If profiling is already disabled, then
189 * cuProfilerStop() has no effect.
190 *
191 * cuProfilerStart and cuProfilerStop APIs are used to
192 * programmatically control the profiling granularity by allowing
193 * profiling to be done only on selective pieces of code.
194 *
195 * \return
196 * ::CUDA_SUCCESS,
197 * ::CUDA_ERROR_INVALID_CONTEXT
198 * \notefnerr
199 *
200 * \sa
201 * ::cuProfilerInitialize,
202 * ::cuProfilerStart,
203 * ::cudaProfilerStop
204 */
205CUresult CUDAAPI cuProfilerStop(void);
206
207/** @} */ /* END CUDA_PROFILER */
208
209#ifdef __cplusplus
210};
211#endif
212
213#undef __CUDA_DEPRECATED
214
215#endif
216
217 
codekingpro/portable-devtools · Team Ai