Exemplo n.º 1
0
        internal static void ValidateBuild(CLProgram openclProgram, Device device, CLError error)
        {
            if (CLError.None != error)
            {
                SizeT bufferSize = SizeT.Zero;

                OpenCLError.Validate(OpenCLDriver.clGetProgramBuildInfo(openclProgram, device.CLDeviceID, CLProgramBuildInfo.Log, SizeT.Zero, IntPtr.Zero, ref bufferSize));

                byte[] buffer = new byte[(Int64)bufferSize];

                GCHandle bufferHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned);

                try
                {
                    OpenCLError.Validate(OpenCLDriver.clGetProgramBuildInfo(openclProgram, device.CLDeviceID, CLProgramBuildInfo.Log, new SizeT(buffer.LongLength), bufferHandle.AddrOfPinnedObject(), ref bufferSize));

                    Int32 count = Array.IndexOf<byte>(buffer, 0);

                    throw new OpenCLBuildError(error, System.Text.Encoding.ASCII.GetString(buffer, 0, count < 0 ? buffer.Length : count).Trim());
                }
                finally
                {
                    bufferHandle.Free();
                }
            }
        }
Exemplo n.º 2
0
 internal static extern CLError clCreateKernelsInProgram(CLProgram program, int num_kernels, [Out] CLKernel[] kernels, ref int num_kernels_ret);
Exemplo n.º 3
0
 internal static extern CLKernel clCreateKernel(CLProgram program, string kernel_name, ref CLError errcode_ret);
Exemplo n.º 4
0
 internal static extern CLError clBuildProgram(CLProgram program, int num_devices, [In] CLDeviceID[] device_list, string options, NotifyFunction func, IntPtr user_data);
Exemplo n.º 5
0
 internal static extern CLError clRetainProgram(CLProgram program);
Exemplo n.º 6
0
 internal static extern CLError clReleaseProgram(CLProgram program);
Exemplo n.º 7
0
 internal static extern CLError clGetProgramInfo(CLProgram program, CLProgramInfo param_name, SizeT param_value_size, IntPtr param_value, ref SizeT param_value_size_ret);
Exemplo n.º 8
0
 internal static extern CLError clCreateKernelsInProgram(CLProgram program, int num_kernels, [Out] CLKernel[] kernels, ref int num_kernels_ret);
Exemplo n.º 9
0
 internal static extern CLKernel clCreateKernel(CLProgram program, string kernel_name, ref CLError errcode_ret);
Exemplo n.º 10
0
 internal static extern CLError clRetainProgram(CLProgram program);
Exemplo n.º 11
0
 internal static extern CLError clReleaseProgram(CLProgram program);
Exemplo n.º 12
0
 internal static extern CLError clGetProgramInfo(CLProgram program, CLProgramInfo param_name, SizeT param_value_size, IntPtr param_value, ref SizeT param_value_size_ret);
Exemplo n.º 13
0
 internal static extern CLError clBuildProgram(CLProgram program, int num_devices, [In] CLDeviceID[] device_list, string options, NotifyFunction func, IntPtr user_data);