예제 #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
파일: Program.cs 프로젝트: xgalv/Cryptool2
        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
파일: OpenCL.cs 프로젝트: o70078/C-LifeGame
 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));
 }