aclrtEventElapsedTime

Description

Computes the elapsed time between two events.

Restrictions

API call sequence: call aclrtCreateEvent or aclrtCreateEventWithFlag to create an event-> call aclrtRecordEvent to record the start event and end event in a stream-> call aclrtSynchronizeStream to wait until the stream tasks are complete-> call aclrtEventElapsedTime to compute the elapsed time between the two events.

Prototype

aclError aclrtEventElapsedTime(float *ms, aclrtEvent startEvent, aclrtEvent endEvent)

Parameters

Parameter

Input/Output

Description

ms

Output

Pointer to the elapsed time between the start and end events, in milliseconds.

startEvent

Input

Start event.

endEvent

Input

End event.

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.