<!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: cudaEventSynchronize</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="qindex" href="group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5">cudaEventRecord</a></td></tr> <tr><td class="navtab"><a class="qindexHL" href="group__CUDART__EVENT_g08241bcf5c5cb686b1882a8492f1e2d9.html#g08241bcf5c5cb686b1882a8492f1e2d9">cudaEventSynchronize</a></td></tr> </table> </div> </td> <td valign="top"> <a class="anchor" name="g08241bcf5c5cb686b1882a8492f1e2d9"></a><!-- doxytag: member="cuda_runtime_api.h::cudaEventSynchronize" ref="g08241bcf5c5cb686b1882a8492f1e2d9" args="(cudaEvent_t event)" --> <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> cudaEventSynchronize </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> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p> Wait until the completion of all device work preceding the most recent call to <a class="el" href="group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5" title="Records an event.">cudaEventRecord()</a> (in the appropriate compute streams, as specified by the arguments to <a class="el" href="group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5" title="Records an event.">cudaEventRecord()</a>).<p> If <a class="el" href="group__CUDART__EVENT_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5" title="Records an event.">cudaEventRecord()</a> has not been called on <code>event</code>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591">cudaSuccess</a> is returned immediately.<p> Waiting for an event that was created with the <a class="el" href="group__CUDART__TYPES_g26509a522be9d449aa7c8c279612452d.html#g26509a522be9d449aa7c8c279612452d">cudaEventBlockingSync</a> flag will cause the calling CPU thread to block until the event has been completed by the device. If the <a class="el" href="group__CUDART__TYPES_g26509a522be9d449aa7c8c279612452d.html#g26509a522be9d449aa7c8c279612452d">cudaEventBlockingSync</a> flag has not been set, then the CPU thread will busy-wait until the event has been completed by the device.<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 wait for</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#gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c">cudaErrorInitializationError</a>, <a class="el" href="group__CUDART__TYPES_g3f51e3575c2178246db0a94a430e0038.html#gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c">cudaErrorInvalidValue</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_ga324d5ce3fbf46899b15e5e42ff9cfa5.html#ga324d5ce3fbf46899b15e5e42ff9cfa5" title="Records an event.">cudaEventRecord</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_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> </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>