<!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: cudaEventRecord</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__CUDART__EVENT.html">Event Management</a> </div> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td valign="top"> <div class="navtab"> <table> <tr><td class="navtab"><a class="qindex" href="group__CUDART__EVENT_g320ab51604f3a7a082795202e7eaf774.html#g320ab51604f3a7a082795202e7eaf774">cudaEventCreate</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__EVENT_g358607fbf0169c75b5f9dad38edba956.html#g358607fbf0169c75b5f9dad38edba956">cudaEventCreateWithFlags</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__EVENT_g513a33d6c552db36be7edc5b3e9e0765.html#g513a33d6c552db36be7edc5b3e9e0765">cudaEventDestroy</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__EVENT_g14c387cc57ce2e328f6669854e6020a5.html#g14c387cc57ce2e328f6669854e6020a5">cudaEventElapsedTime</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__EVENT_gf8e4ddb569b1da032c060f0c54da698f.html#gf8e4ddb569b1da032c060f0c54da698f">cudaEventQuery</a></td></tr> <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5">cudaEventRecord</a></td></tr> <tr><td class="navtab"><a class="qindex" href="group__CUDART__EVENT_g08241bcf5c5cb686b1882a8492f1e2d9.html#g08241bcf5c5cb686b1882a8492f1e2d9">cudaEventSynchronize</a></td></tr> </table> </div> </td> <td valign="top"> <a class="anchor" name="ga324d5ce3fbf46899b15e5e42ff9cfa5"></a><!-- doxytag: member="cuda_runtime_api.h::cudaEventRecord" ref="ga324d5ce3fbf46899b15e5e42ff9cfa5" args="(cudaEvent_t event, cudaStream_t stream=0)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CUDART__TYPES_gf599e5b8b829ce7db0f5216928f6ecb6.html#gf599e5b8b829ce7db0f5216928f6ecb6">cudaError_t</a> cudaEventRecord </td> <td>(</td> <td class="paramtype"><a class="el" href="group__CUDART__TYPES_gea2f543a9fc0e52fe4ae712920fd1247.html#gea2f543a9fc0e52fe4ae712920fd1247">cudaEvent_t</a> </td> <td class="paramname"> <em>event</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__CUDART__TYPES_ge15d9c8b7a240312b533d6122558085a.html#ge15d9c8b7a240312b533d6122558085a">cudaStream_t</a> </td> <td class="paramname"> <em>stream</em> = <code>0</code></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Records an event. If <code>stream</code> is non-zero, the event is recorded after all preceding operations in <code>stream</code> have been completed; otherwise, it is recorded after all preceding operations in the CUDA context have been completed. Since operation is asynchronous, <a class="el" href="group__CUDART__EVENT_gf8e4ddb569b1da032c060f0c54da698f.html#gf8e4ddb569b1da032c060f0c54da698f" title="Queries an event's status.">cudaEventQuery()</a> and/or <a class="el" href="group__CUDART__EVENT_g08241bcf5c5cb686b1882a8492f1e2d9.html#g08241bcf5c5cb686b1882a8492f1e2d9" title="Waits for an event to complete.">cudaEventSynchronize()</a> must be used to determine when the event has actually been recorded.<p> If <a class="el" href="group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5" title="Records an event.">cudaEventRecord()</a> has previously been called on <code>event</code>, then this call will overwrite any existing state in <code>event</code>. Any subsequent calls which examine the status of <code>event</code> will only examine the completion of this most recent call to <a class="el" href="group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5" title="Records an event.">cudaEventRecord()</a>.<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>event</em> </td><td>- Event to record </td></tr> <tr><td valign="top"></td><td valign="top"><em>stream</em> </td><td>- Stream in which to record event</td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591">cudaSuccess</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c">cudaErrorInitializationError</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273">cudaErrorInvalidResourceHandle</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038099def426efea2b2366d8d7ad09f974a">cudaErrorLaunchFailure</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__CUDART__EVENT_g320ab51604f3a7a082795202e7eaf774.html#g320ab51604f3a7a082795202e7eaf774">cudaEventCreate (C API)</a>, <a class="el" href="group__CUDART__EVENT_g358607fbf0169c75b5f9dad38edba956.html#g358607fbf0169c75b5f9dad38edba956" title="Creates an event object with the specified flags.">cudaEventCreateWithFlags</a>, <a class="el" href="group__CUDART__EVENT_gf8e4ddb569b1da032c060f0c54da698f.html#gf8e4ddb569b1da032c060f0c54da698f" title="Queries an event's status.">cudaEventQuery</a>, <a class="el" href="group__CUDART__EVENT_g08241bcf5c5cb686b1882a8492f1e2d9.html#g08241bcf5c5cb686b1882a8492f1e2d9" title="Waits for an event to complete.">cudaEventSynchronize</a>, <a class="el" href="group__CUDART__EVENT_g513a33d6c552db36be7edc5b3e9e0765.html#g513a33d6c552db36be7edc5b3e9e0765" title="Destroys an event object.">cudaEventDestroy</a>, <a class="el" href="group__CUDART__EVENT_g14c387cc57ce2e328f6669854e6020a5.html#g14c387cc57ce2e328f6669854e6020a5" title="Computes the elapsed time between events.">cudaEventElapsedTime</a>, <a class="el" href="group__CUDART__STREAM_gfe68d207dc965685d92d3f03d77b0876.html#gfe68d207dc965685d92d3f03d77b0876" title="Make a compute stream wait on an event.">cudaStreamWaitEvent</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>