Esempio n. 1
0
 private static extern ContextSafeHandle clCreateContext(
     [In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] properties,
     uint numDevices,
     [In, MarshalAs(UnmanagedType.LPArray)] ClDeviceID[] devices,
     CreateContextCallback pfnNotify,
     IntPtr userData,
     out ErrorCode errorCode);
Esempio n. 2
0
        public static ContextSafeHandle CreateContextFromType(DeviceType deviceType, CreateContextCallback pfnNotify, IntPtr userData)
        {
            ErrorCode         errorCode = ErrorCode.Success;
            ContextSafeHandle result    = clCreateContextFromType(null, deviceType, pfnNotify, userData, out errorCode);

            ErrorHandler.ThrowOnFailure(errorCode);
            return(result);
        }
Esempio n. 3
0
        public static ContextSafeHandle CreateContext(ClDeviceID[] devices, CreateContextCallback pfnNotify, IntPtr userData)
        {
            ErrorCode         errorCode = ErrorCode.Success;
            ContextSafeHandle result    = clCreateContext(null, (uint)devices.Length, devices, pfnNotify, userData, out errorCode);

            ErrorHandler.ThrowOnFailure(errorCode);
            return(result);
        }
Esempio n. 4
0
        public static ContextSafeHandle CreateContextFromType(ClPlatformID platform, DeviceType deviceType, CreateContextCallback pfnNotify, IntPtr userData)
        {
            IntPtr[] properties = { ContextProperties.Platform, platform.Handle, IntPtr.Zero };

            ErrorCode         errorCode = ErrorCode.Success;
            ContextSafeHandle result    = clCreateContextFromType(properties, deviceType, pfnNotify, userData, out errorCode);

            ErrorHandler.ThrowOnFailure(errorCode);
            return(result);
        }
Esempio n. 5
0
 private static extern ContextSafeHandle clCreateContextFromType(
     [In, MarshalAs(UnmanagedType.LPArray)] IntPtr[] properties,
     DeviceType deviceType,
     CreateContextCallback pfnNotify,
     IntPtr userData,
     out ErrorCode errorCode);