<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>NVIDIA CUDA Library: cuProfilerInitialize</title> <link href="customdoxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> </div> <div class="contents"> <div class="navpath"><a class="el" href="group__CUDA__PROFILER.html">Profiler Control</a> </div> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td valign="top"> <div class="navtab"> <table> <tr><td class="navtab"><a class="qindexHL" href="group__CUDA__PROFILER_gd5d346ef62db53032948f387650d1a18.html#gd5d346ef62db53032948f387650d1a18">cuProfilerInitialize</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDA__PROFILER_g8a5314de2292c2efac83ac7fcfa9190e.html#g8a5314de2292c2efac83ac7fcfa9190e">cuProfilerStart</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDA__PROFILER_g4d8edef6174fd90165e6ac838f320a5f.html#g4d8edef6174fd90165e6ac838f320a5f">cuProfilerStop</a></td></tr> </table> </div> </td> <td valign="top"> <a class="anchor" name="gd5d346ef62db53032948f387650d1a18"></a><!-- doxytag: member="cudaProfiler.h::cuProfilerInitialize" ref="gd5d346ef62db53032948f387650d1a18" args="(const char *configFile, const char *outputFile, CUoutput_mode outputMode)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CUDA__TYPES_g09da14df1a751dcbfeccb9cf0073d64c.html#g09da14df1a751dcbfeccb9cf0073d64c">CUresult</a> cuProfilerInitialize </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>configFile</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>outputFile</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">CUoutput_mode </td> <td class="paramname"> <em>outputMode</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Using this API user can specify the configuration file, output file and output file format. This API is generally used to profile different set of counters/options by looping the kernel launch. <code>configFile</code> parameter can be used to select profiling options including profiler counters/options. Refer the "Command Line Profiler" section in the "Compute Visual Profiler User Guide" for supported profiler options and counters.<p> Configurations defined initially by environment variable settings are overwritten by <a class="el" href="group__CUDA__PROFILER_gd5d346ef62db53032948f387650d1a18.html#gd5d346ef62db53032948f387650d1a18" title="Initialize the profiling.">cuProfilerInitialize()</a>.<p> Limitation: Profiling APIs do not work when the application is running with any profiler tool such as Compute Visual Profiler. User must handle error <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa624eb27178556d6a93433a610b36c0f9">CUDA_ERROR_PROFILER_DISABLED</a> returned by profiler APIs if application is likely to be used with any profiler tool.<p> Typical usage of the profiling APIs is as follows:<p> for each set of counters/options<br> {<br> <a class="el" href="group__CUDA__PROFILER_gd5d346ef62db53032948f387650d1a18.html#gd5d346ef62db53032948f387650d1a18" title="Initialize the profiling.">cuProfilerInitialize()</a>; //Initialize profiling, set the counters or options in the config file <br> ...<br> <a class="el" href="group__CUDA__PROFILER_g8a5314de2292c2efac83ac7fcfa9190e.html#g8a5314de2292c2efac83ac7fcfa9190e" title="Start the profiling.">cuProfilerStart()</a>; <br> // code to be profiled <br> <a class="el" href="group__CUDA__PROFILER_g4d8edef6174fd90165e6ac838f320a5f.html#g4d8edef6174fd90165e6ac838f320a5f" title="Stop the profiling.">cuProfilerStop()</a>; <br> ...<br> <a class="el" href="group__CUDA__PROFILER_g8a5314de2292c2efac83ac7fcfa9190e.html#g8a5314de2292c2efac83ac7fcfa9190e" title="Start the profiling.">cuProfilerStart()</a>; <br> // code to be profiled <br> <a class="el" href="group__CUDA__PROFILER_g4d8edef6174fd90165e6ac838f320a5f.html#g4d8edef6174fd90165e6ac838f320a5f" title="Stop the profiling.">cuProfilerStop()</a>; <br> ...<br> }<br> <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>configFile</em> </td><td>- Name of the config file that lists the counters/options for profiling. </td></tr> <tr><td valign="top"></td><td valign="top"><em>outputFile</em> </td><td>- Name of the outputFile where the profiling results will be stored. </td></tr> <tr><td valign="top"></td><td valign="top"><em>outputMode</em> </td><td>- outputMode, can be CU_OUT_KEY_VALUE_PAIR or CU_OUT_CSV.</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaaa0eed720f8a87cd1c5fd1c453bc7a03d">CUDA_SUCCESS</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa90696c86fcee1f536a1ec7d25867feeb">CUDA_ERROR_INVALID_VALUE</a>, <a class="el" href="group__CUDA__TYPES_g0cdead942fd5028d157641eef6bdeeaa.html#gg0cdead942fd5028d157641eef6bdeeaa624eb27178556d6a93433a610b36c0f9">CUDA_ERROR_PROFILER_DISABLED</a> </dd></dl> <dl class="note" compact><dt><b>Note:</b></dt><dd>Note that this function may also return error codes from previous, asynchronous launches.</dd></dl> <dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__CUDA__PROFILER_g8a5314de2292c2efac83ac7fcfa9190e.html#g8a5314de2292c2efac83ac7fcfa9190e" title="Start the profiling.">cuProfilerStart</a>, <a class="el" href="group__CUDA__PROFILER_g4d8edef6174fd90165e6ac838f320a5f.html#g4d8edef6174fd90165e6ac838f320a5f" title="Stop the profiling.">cuProfilerStop</a> </dd></dl> </div> </div><p> </td> </tr> </table> </div> <hr size="1"><address style="text-align: right;"><small> Generated by Doxygen for NVIDIA CUDA Library <a href="http://www.nvidia.com/cuda"><img src="nvidia_logo.jpg" alt="NVIDIA" align="middle" border="0" height="80"></a></small></address> </body> </html>