示例#1
0
		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);
		}
示例#2
0
		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;
		}
示例#3
0
		public BuildStatus GetBuildStatus (Device device)
		{
			return (BuildStatus)Native.QueryInfoInt32 (QueryType.ProgramBuild, _handle, device.Handle, ProgramBuildInfo.Status);
		}
示例#4
0
		public string GetBuildOptions (Device device)
		{
			return Native.QueryInfoString (QueryType.ProgramBuild, _handle, device.Handle, ProgramBuildInfo.Options);
		}
示例#5
0
		public ulong GetLocalMemorySize (Device device)
		{
			return Native.QueryInfoUInt64 (QueryType.KernelWorkGroup, _handle, device.Handle, KernelWorkGroupInfo.LocalMemSize);
		}
示例#6
0
		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;
		}
示例#7
0
		public int GetWorkGroupSize (Device device)
		{
			return Native.QueryInfoSize (QueryType.KernelWorkGroup, _handle, device.Handle, KernelWorkGroupInfo.WorkGroupSize).ToInt32 ();
		}