Example #1
0
 public extern static int clGetKernelWorkGroupInfo(
     IntPtr kernel,
     IntPtr device,
     KernelWorkGroupInfo param_name,
     IntPtr param_value_size,
     byte[] param_value,
     out IntPtr param_value_size_ret
     );
Example #2
0
 internal static extern ErrorCode clGetKernelWorkGroupInfo(IntPtr kernel, IntPtr device, KernelWorkGroupInfo paramName, IntPtr paramValueSize, IntPtr paramValue, out IntPtr paramValueSizeRet);
Example #3
0
 internal extern static unsafe ErrorCode GetKernelWorkGroupInfo(IntPtr kernel, IntPtr device, KernelWorkGroupInfo param_name, IntPtr param_value_size, IntPtr param_value, [Out] IntPtr *param_value_size_ret);
Example #4
0
 internal extern static unsafe int GetKernelWorkGroupInfo(IntPtr kernel, IntPtr device, KernelWorkGroupInfo param_name, IntPtr param_value_size, IntPtr param_value, [OutAttribute] IntPtr *param_value_size_ret);
Example #5
0
 public static InfoBuffer GetKernelWorkGroupInfo(Kernel kernel, Device device, KernelWorkGroupInfo paramName, out ErrorCode error)
 {
     return(GetInfo(GetKernelWorkGroupInfo, kernel, device, paramName, out error));
 }
Example #6
0
 public static InfoBuffer GetKernelWorkGroupInfo(Kernel kernel, Device device, KernelWorkGroupInfo paramName, out ErrorCode error)
 {
     return GetInfo(GetKernelWorkGroupInfo, kernel, device, paramName, out error);
 }
Example #7
0
 internal extern static unsafe int GetKernelWorkGroupInfo(IntPtr kernel, IntPtr device, KernelWorkGroupInfo param_name, IntPtr param_value_size, IntPtr param_value, [OutAttribute] IntPtr* param_value_size_ret);
        public static ulong[] GetKernelWorkGroupInfo(KernelSafeHandle kernel, ClDeviceID device, KernelWorkGroupInfo kernelWorkGroupInfo)
        {
            if (kernel == null)
            {
                throw new ArgumentNullException("kernel");
            }

            int size    = 0;
            int arrayCt = 0;

            switch (kernelWorkGroupInfo)
            {
            case KernelWorkGroupInfo.GlobalWorkSize:
                size    = UIntPtr.Size;
                arrayCt = 3;
                break;

            case KernelWorkGroupInfo.WorkGroupSize:
                size    = UIntPtr.Size;
                arrayCt = 1;
                break;

            case KernelWorkGroupInfo.CompileWorkGroupSize:
                size    = UIntPtr.Size;
                arrayCt = 3;
                break;

            case KernelWorkGroupInfo.LocalMemorySize:
                size    = sizeof(ulong);
                arrayCt = 1;
                break;

            case KernelWorkGroupInfo.PreferredWorkGroupSizeMultiple:
                size    = UIntPtr.Size;
                arrayCt = 1;
                break;

            case KernelWorkGroupInfo.PrivateMemorySize:
                size    = sizeof(ulong);
                arrayCt = 1;
                break;
            }
            int fixedSize = size * arrayCt;

#if DEBUG
            UIntPtr requiredSize;
            ErrorHandler.ThrowOnFailure(clGetKernelWorkGroupInfo(kernel, device, (int)kernelWorkGroupInfo, UIntPtr.Zero, IntPtr.Zero, out requiredSize));
            if (requiredSize.ToUInt64() != (ulong)fixedSize)
            {
                throw new ArgumentException("The parameter definition includes a fixed size that does not match the required size according to the runtime.");
            }
#endif

            IntPtr memory = IntPtr.Zero;
            try
            {
                memory = Marshal.AllocHGlobal(fixedSize);
                UIntPtr actualSize;
                ErrorHandler.ThrowOnFailure(clGetKernelWorkGroupInfo(kernel, device, (int)kernelWorkGroupInfo, (UIntPtr)fixedSize, memory, out actualSize));
                IntPtr[] array = new IntPtr[(int)((long)actualSize.ToUInt64() / IntPtr.Size)];
                Marshal.Copy(memory, array, 0, array.Length);

                ulong[] outArray = new ulong[arrayCt];
                for (int i = 0; i < arrayCt; i++)
                {
                    outArray[i] = (ulong)array[i];
                }

                return(outArray);
            }
            finally
            {
                Marshal.FreeHGlobal(memory);
            }
        }
Example #9
0
 public static Error clGetKernelWorkGroupInfo(OpenCLKernel kernel, OpenCLDevice device, KernelWorkGroupInfo param_name, IntPtr param_value_size, IntPtr param_value, IntPtr param_value_size_ret)
 {
     Console.WriteLine("Calling Error clGetKernelWorkGroupInfo(OpenCLKernel kernel, OpenCLDevice device, KernelWorkGroupInfo param_name, IntPtr param_value_size, IntPtr param_value, IntPtr param_value_size_ret)");
     return default(Error);
 }
Example #10
0
 public static extern Error clGetKernelWorkGroupInfo(OpenCLKernel kernel, OpenCLDevice device, KernelWorkGroupInfo param_name, IntPtr param_value_size, IntPtr param_value, IntPtr param_value_size_ret);
Example #11
0
		public extern static int clGetKernelWorkGroupInfo (
			IntPtr kernel,
			IntPtr device,
			KernelWorkGroupInfo param_name,
			IntPtr param_value_size,
			byte[] param_value,
			out IntPtr param_value_size_ret
		);