Library/ManagedCuda/CudaEvent.cs
/// <summary>
/// Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). If
/// either event has not been recorded yet, this function throws <see cref="CUResult.ErrorNotReady"/>. If either event has been
/// recorded with a non-zero stream, the result is undefined.
/// </summary>
/// <param name="eventStart"></param>
/// <param name="eventEnd"></param>
/// <returns></returns>
Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). If
either event has not been recorded yet, this function throws . If either event has been
recorded with a non-zero stream, the result is undefined.
Computes the elapsed time between two events ( in milliseconds with a resolution of around 0 . 5 microseconds ) . If either event has not been recorded yet this function throws . If either event has been recorded with a non - zero stream the result is undefined .
public static float ElapsedTime(CudaEvent eventStart, CudaEvent eventEnd)
        {
            float time = 0;
            CUResult res = DriverAPINativeMethods.Events.cuEventElapsedTime(ref time, eventStart.Event, eventEnd.Event);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuEventElapsedTime", res));
            if (res != CUResult.Success) throw new CudaException(res);
            return time;
        }
public static float ElapsedTime ( CudaEvent eventStart , CudaEvent eventEnd ) { float time = 0 ; CUResult res = DriverAPINativeMethods . Events . cuEventElapsedTime ( ref time , eventStart . Event , eventEnd . Event ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; return time ; }
Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds).
Computes the elapsed time between two events ( in milliseconds with a resolution of around 0 . 5 microseconds ) .
None
eventStart
CudaEvent
None
eventEnd
CudaEvent
None