Tutorial 10. Event-Driven Synchronization
In example linear_up_walker , since the output surface is created in user-provided system memory, there is no need to call ReadSurface to access those data after enqueue. However, we still need to know when the GPU task is finished, and the output is complete. An event-driven synchronization method is used here
unsigned long time_out = -1; cm_result_check(sync_event->WaitForTaskFinished(time_out)); // Destroys a CmTask object. // CmTask will be destroyed when CmDevice is destroyed.