aclrtEventElapsedTime

Description

Computes the elapsed time between two events. This API is synchronous.

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.

start

Input

Start event.

end

Input

End event.

Returns

0 on success; else, failure.