示例#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();
                }
            }
        }
示例#2
0
 internal static extern CLError clCreateKernelsInProgram(CLProgram program, int num_kernels, [Out] CLKernel[] kernels, ref int num_kernels_ret);
示例#3
0
 internal static extern CLKernel clCreateKernel(CLProgram program, string kernel_name, ref CLError errcode_ret);
示例#4
0
 internal static extern CLError clBuildProgram(CLProgram program, int num_devices, [In] CLDeviceID[] device_list, string options, NotifyFunction func, IntPtr user_data);
示例#5
0
 internal static extern CLError clRetainProgram(CLProgram program);
示例#6
0
 internal static extern CLError clReleaseProgram(CLProgram program);
示例#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);
示例#8
0
 internal static extern CLError clCreateKernelsInProgram(CLProgram program, int num_kernels, [Out] CLKernel[] kernels, ref int num_kernels_ret);
示例#9
0
 internal static extern CLKernel clCreateKernel(CLProgram program, string kernel_name, ref CLError errcode_ret);
示例#10
0
 internal static extern CLError clRetainProgram(CLProgram program);
示例#11
0
 internal static extern CLError clReleaseProgram(CLProgram program);
示例#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);
示例#13
0
 internal static extern CLError clBuildProgram(CLProgram program, int num_devices, [In] CLDeviceID[] device_list, string options, NotifyFunction func, IntPtr user_data);