public void Build (Device[] devices, string options) { IntPtr[] device_list = new IntPtr[devices.Length]; for (int i = 0; i < device_list.Length; i++) device_list[i] = devices[i].Handle; int errcode = Native.clBuildProgram (_handle, (uint)devices.Length, device_list, options, IntPtr.Zero, IntPtr.Zero); OpenCLException.Check (errcode); }
public static Device CreateDevice (IntPtr handle) { Device device; lock (_cache) { if (!_cache.TryGetValue (handle, out device)) { device = new Device (handle); _cache.Add (handle, device); } } return device; }
public BuildStatus GetBuildStatus (Device device) { return (BuildStatus)Native.QueryInfoInt32 (QueryType.ProgramBuild, _handle, device.Handle, ProgramBuildInfo.Status); }
public string GetBuildOptions (Device device) { return Native.QueryInfoString (QueryType.ProgramBuild, _handle, device.Handle, ProgramBuildInfo.Options); }
public ulong GetLocalMemorySize (Device device) { return Native.QueryInfoUInt64 (QueryType.KernelWorkGroup, _handle, device.Handle, KernelWorkGroupInfo.LocalMemSize); }
public int[] GetCompileWorkGroupSize (Device device) { IntPtr[] temp = Native.QueryInfoIntPtrArray (QueryType.KernelWorkGroup, _handle, device.Handle, KernelWorkGroupInfo.CompileWorkGroupSize); int[] ret = new int[temp.Length]; for (int i = 0; i < temp.Length; i ++) ret[i] = temp[i].ToInt32 (); return ret; }
public int GetWorkGroupSize (Device device) { return Native.QueryInfoSize (QueryType.KernelWorkGroup, _handle, device.Handle, KernelWorkGroupInfo.WorkGroupSize).ToInt32 (); }