Reputation: 7067
Referring to clGetEventProfilingInfo documentation, cl_event
resulted from clEnqueueNDRangeKernel could be:
when the command identified by event is enqueued in a command-queue by the host.
when the command identified by event that has been enqueued is submitted by the host to the device associated with the commandqueue.
when the command identified by event starts execution on the device.
when the command identified by event has finished execution on the device.
Assume visualizing the whole kernel profiling:
COMMAND_QUEUED -> COMMAND_SUBMIT -> COMMAND_START -> COMMAND_END
& the corresponding timeline:
Queueing -> Submitting -> Executing
Where:
Questions:
Is my previous equations true? if so, What's the real difference between queueing and submitting?
In other words, if I want to divide the whole process into COMMUNICATION (offloading) time and COMPUTATION (executing) time, What will be their equations?
Upvotes: 0
Views: 459
Reputation: 8410
Is my previous equations true?
Yes.
If so, What's the real difference between queueing and submitting? In other words, if I want to divide the whole process into COMMUNICATION (offloading) time and COMPUTATION (executing) time, What will be their equations?
Queueing:
Submitting:
If you are looking for a formula only "Submitting" and "Executing" are valid for calculating the current task overhead. Ignore queueing since it does not depend on your task:
Active% = Executing/(Executing+Submitting)
Overhead% = Submitting/(Executing+Submitting)
Upvotes: 0
Reputation: 6343
Your interpretation seems fairly true. QUEUED is when you called the OpenCL API (such as clEnqueueNDRangeKernel). SUBMIT is when the runtime gave the work to the device. START is when it started execution, END is when the execution finished. There are three states between these four times. The first state is idle on the host. The second state is idle on the device. The third state is executing on the device. If you wish to combine the first two into "communication" then add them together (or use COMMAND_START - COMMAND_QUEUED).
Upvotes: 1