示例#1
0
 internal static extern cl_int clBuildProgram(
     cl_program program,
     cl_uint num_devices,
     [In] cl_device_id[] device_list,
     String options,
     ProgramNotify pfn_notify,
     IntPtr user_data);
示例#2
0
 // Program methods
 public void BuildProgram(Device[] deviceList, string options, ProgramNotify callback, object userData)
 {
     var dev = Device.ToIntPtr(deviceList);
     var pfn = (ProgramNotifyData)null;
     var pcb = (ProgramNotifyInternal)null;
     var ptr = IntPtr.Zero;
     if (callback != null) {
         pfn = new ProgramNotifyData(callback, userData);
         pcb = ProgramNotifyData.Callback;
         ptr = GCHandle.ToIntPtr(pfn.Handle);
     }
     var err = NativeMethods.clBuildProgram(this.handle, (uint)dev.Length, dev, options, pcb, ptr);
     if (err != ErrorCode.Success) {
         throw new OpenClException(err);
     }
 }
示例#3
0
        public void Build(Device[] devices, String options, ProgramNotify notify, IntPtr userData)
        {
            var deviceLength = 0;

            if (devices != null)
            {
                deviceLength = devices.Length;
            }

            var deviceIDs = InteropTools.ConvertDevicesToDeviceIDs(devices);
            var result    = OpenCL.BuildProgram(this.ProgramID,
                                                (UInt32)deviceLength,
                                                deviceIDs,
                                                options,
                                                notify,
                                                userData);

            if (result != ErrorCode.SUCCESS)
            {
                throw new OpenCLBuildException(this, result);
            }
        }
示例#4
0
        public void Build(Device[] devices, string options, ProgramNotify notify, IntPtr userData)
        {
            ErrorCode result;

            IntPtr[] deviceIDs;
            int      deviceLength = 0;

            if (devices != null)
            {
                deviceLength = devices.Length;
            }

            deviceIDs = InteropTools.ConvertDevicesToDeviceIDs(devices);
            result    = (ErrorCode)OpenCL.BuildProgram(ProgramID,
                                                       (uint)deviceLength,
                                                       deviceIDs,
                                                       options,
                                                       notify,
                                                       userData);
            if (result != ErrorCode.SUCCESS)
            {
                throw new OpenCLBuildException(this, result);
            }
        }
示例#5
0
 public void Build(Device[] devices, ProgramNotify notify, IntPtr userData)
 {
     Build(devices, null, notify, userData);
 }
示例#6
0
 public static extern uint clBuildProgram(IntPtr program,
                                          uint numDevices,
                                          [In][MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.SysUInt, SizeParamIndex = 1)] IntPtr[] deviceList,
                                          [In][MarshalAs(UnmanagedType.LPStr)] string options,
                                          ProgramNotify pfnNotify,
                                          IntPtr userData);
示例#7
0
 public ProgramNotifyData(ProgramNotify callback, object data)
 {
     this.callback = callback;
     this.data     = data;
     this.handle   = GCHandle.Alloc(this);
 }
示例#8
0
 public static ErrorCode BuildProgram(IntPtr program, uint num_devices, IntPtr[] device_list, string options, ProgramNotify pfn_notify, IntPtr user_data)
 {
     return (ErrorCode)OpenCLAPI.clBuildProgram(program, num_devices, device_list, options, pfn_notify, user_data);
 }
示例#9
0
        public void Build(Device[] devices, string options, ProgramNotify notify, IntPtr userData)
        {
            ErrorCode result;
            IntPtr[] deviceIDs;
            int deviceLength = 0;

            if (devices != null)
                deviceLength = devices.Length;

            deviceIDs = InteropTools.ConvertDevicesToDeviceIDs(devices);
            result = (ErrorCode)OpenCL.BuildProgram(ProgramID,
                (uint)deviceLength,
                deviceIDs,
                options,
                notify,
                userData);
            if (result != ErrorCode.SUCCESS)
                throw new OpenCLBuildException(this, result);
        }
示例#10
0
 public void Build(Device[] devices, ProgramNotify notify, IntPtr userData)
 {
     Build(devices, null, notify, userData);
 }
示例#11
0
 public static ErrorCode BuildProgram(IntPtr program, uint num_devices, IntPtr[] device_list, string options, ProgramNotify pfn_notify, IntPtr user_data)
 {
     return((ErrorCode)OpenCLAPI.clBuildProgram(program, num_devices, device_list, options, pfn_notify, user_data));
 }