Ejemplo n.º 1
0
        private static Int64 GetInfo(Event e, CLProfilingInfo info)
        {
            Byte[] bytes = new Byte[8];

            SizeT paramValueSizeRet = SizeT.Zero;

            GCHandle bytesHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
            {
                OpenCLError.Validate(OpenCLDriver.clGetEventProfilingInfo(e.CLEvent, info, new SizeT(bytes.LongLength), bytesHandle.AddrOfPinnedObject(), ref paramValueSizeRet));
            }
            bytesHandle.Free();

            return BitConverter.ToInt64(bytes, 0);
        }
Ejemplo n.º 2
0
 public static Int64 QueuedTick(Event e)
 {
     return GetInfo(e, CLProfilingInfo.Queued);
 }
Ejemplo n.º 3
0
 public static Int64 SubmitTick(Event e)
 {
     return GetInfo(e, CLProfilingInfo.Submit);
 }
Ejemplo n.º 4
0
 public static Int64 EndTick(Event e)
 {
     return GetInfo(e, CLProfilingInfo.End);
 }
Ejemplo n.º 5
0
 public static TimeSpan DurationTimespan(Event e)
 {
     return TimeSpan.FromSeconds(DurationSeconds(e));
 }
Ejemplo n.º 6
0
 public static Int64 DurationTicks(Event e)
 {
     return EndTick(e) - StartTick(e);
 }
Ejemplo n.º 7
0
 public static Double DurationSeconds(Event e)
 {
     return DurationTicks(e) * 1.0E-9;
 }
Ejemplo n.º 8
0
 public static Double DurationMilliseconds(Event e)
 {
     return DurationTicks(e) * 1.0E-6;
 }