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);
// 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); } }
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); } }
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); } }
public void Build(Device[] devices, ProgramNotify notify, IntPtr userData) { Build(devices, null, notify, userData); }
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);
public ProgramNotifyData(ProgramNotify callback, object data) { this.callback = callback; this.data = data; this.handle = GCHandle.Alloc(this); }
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); }
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); }
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)); }