且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何通过一个clFinish分析顺序启动的多个OpenCL内核?

更新时间:2022-04-14 15:16:21

每个clEnqueueNDRangeKernel都将创建自己的cl_event:调用的最后一个arg是指向cl_event的指针;如果最后一个arg不为0,则将创建一个新事件.

Each clEnqueueNDRangeKernel will create its own cl_event: the last arg of the call is a pointer to a cl_event; if this last arg is not 0, a new event will be created.

命令完成后,可以查询关联的事件的开始/结束分析信息.使用后必须释放此事件(调用clReleaseEvent).

After a command has completed, the associated event can be queried the start/end profiling info. This event must be released after use (call clReleaseEvent).

clFinish阻塞,直到所有入队命令完成.

clFinish blocks until all enqueued commands are completed.

您只需一个呼叫clFinish,然后您就可以查询所有事件的分析信息.

You need only one call to clFinish, and then you can query profiling info for all events.