コード例 #1
0
ファイル: Program.cs プロジェクト: kazuki/opencl.net
		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
ファイル: Device.cs プロジェクト: kazuki/opencl.net
		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
ファイル: Program.cs プロジェクト: kazuki/opencl.net
		public BuildStatus GetBuildStatus (Device device)
		{
			return (BuildStatus)Native.QueryInfoInt32 (QueryType.ProgramBuild, _handle, device.Handle, ProgramBuildInfo.Status);
		}
コード例 #4
0
ファイル: Program.cs プロジェクト: kazuki/opencl.net
		public string GetBuildOptions (Device device)
		{
			return Native.QueryInfoString (QueryType.ProgramBuild, _handle, device.Handle, ProgramBuildInfo.Options);
		}
コード例 #5
0
ファイル: Kernel.cs プロジェクト: kazuki/opencl.net
		public ulong GetLocalMemorySize (Device device)
		{
			return Native.QueryInfoUInt64 (QueryType.KernelWorkGroup, _handle, device.Handle, KernelWorkGroupInfo.LocalMemSize);
		}
コード例 #6
0
ファイル: Kernel.cs プロジェクト: kazuki/opencl.net
		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
ファイル: Kernel.cs プロジェクト: kazuki/opencl.net
		public int GetWorkGroupSize (Device device)
		{
			return Native.QueryInfoSize (QueryType.KernelWorkGroup, _handle, device.Handle, KernelWorkGroupInfo.WorkGroupSize).ToInt32 ();
		}