示例#1
0
文件: Profiler.cs 项目: lu4/ManOCL
        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));
        }