private OpenCLProgram LoadProgram(string resourceName) { var source = GetProgramSourceFromResource(Assembly.GetExecutingAssembly(), resourceName); var program = new OpenCLProgram(Context, source); try { var optionsList = new[] { "-cl-fast-relaxed-math", "-cl-mad-enable", "-cl-no-signed-zeros", "-cl-strict-aliasing", "-Werror" }; var options = string.Join(" ", optionsList); program.Build(new List <OpenCLDevice> { CommandQueue.Device }, options, null, IntPtr.Zero); } catch (BuildProgramFailureOpenCLException) { var buildLog = program.GetBuildLog(CommandQueue.Device); throw new ApplicationException($"Error building program \"{resourceName}\":{Environment.NewLine}{buildLog}"); } return(program); }
private static OpenCLProgram LoadProgram(OpenCLContext context, OpenCLDevice device, string resourceName) { var source = GetProgramSourceFromResource(Assembly.GetExecutingAssembly(), resourceName); var program = new OpenCLProgram(context, source); try { program.Build(new List <OpenCLDevice> { device }, string.Empty, null, IntPtr.Zero); } catch (BuildProgramFailureOpenCLException) { var buildLog = program.GetBuildLog(device); throw new ApplicationException($"Error building program \"{resourceName}\":{Environment.NewLine}{buildLog}"); } return(program); }
public StartingPointGenerator(InputTuple input, int rAsPower, int wordsPerNumber, Pollard_Rho pRho, OpenCLProgram program, OpenCLBuffer <uint> startingPointsBuffer) { this.modulus = input.Modulus; this.generator = input.Generator; this.order = input.Order; this.element = input.Element; this.rAsPower = rAsPower; this.wordsPerNumber = wordsPerNumber; this.pRho = pRho; this.kernel = new OpenCLKernel(program, "add_new_starting_points"); this.newStartingPointsBuffer = new OpenCLBuffer <uint>(program, new uint[4 * DLPSolver.NUM_GPU_THREADS * wordsPerNumber]); this.startingPointPool = new uint[4 * DLPSolver.NUM_GPU_THREADS * wordsPerNumber]; kernel.SetArgument(0, startingPointsBuffer); kernel.SetArgument(1, newStartingPointsBuffer); }
public static extern OpenCLKernel clCreateKernel(OpenCLProgram program, String kernel_name, Error error);
public static extern Error clCreateKernelsInProgram(OpenCLProgram program, Int32 num_kernels, [Out] OpenCLKernel[] kernels, Int32 num_kernels_ret);
public static Error clRetainProgram(OpenCLProgram program) { Console.WriteLine("Calling Error clRetainProgram(OpenCLProgram program)"); return default(Error); }
public static extern Error clBuildProgram(OpenCLProgram program, Int32 num_devices, [In] OpenCLDevice[] device_list, String options, NotifyFunction func, IntPtr user_data);
public static Error clGetProgramBuildInfo(OpenCLProgram program, OpenCLDevice device, ProgramBuildInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret) { param_value_size_ret = default(IntPtr); Console.WriteLine("Calling Error clGetProgramBuildInfo(OpenCLProgram program, OpenCLDevice device, ProgramBuildInfo param_name, IntPtr param_value_size, IntPtr param_value, out IntPtr param_value_size_ret)"); return default(Error); }
public static Error clGetProgramInfo(OpenCLProgram program, ProgramInfo param_name, IntPtr param_value_size, IntPtr param_value, IntPtr param_value_size_ret) { Console.WriteLine("Calling Error clGetProgramInfo(OpenCLProgram program, ProgramInfo param_name, IntPtr param_value_size, IntPtr param_value, IntPtr param_value_size_ret)"); return default(Error); }
public static Error clCreateKernelsInProgram(OpenCLProgram program, Int32 num_kernels, [Out] OpenCLKernel[] kernels, Int32 num_kernels_ret) { Console.WriteLine("Calling Error clCreateKernelsInProgram(OpenCLProgram program, Int32 num_kernels, [Out] OpenCLKernel[] kernels, Int32 num_kernels_ret)"); return default(Error); }
public static Error clBuildProgram(OpenCLProgram program, Int32 num_devices, [In] OpenCLDevice[] device_list, String options, NotifyFunction func, IntPtr user_data) { Console.WriteLine("Calling Error clBuildProgram(OpenCLProgram program, Int32 num_devices, [In] OpenCLDevice[] device_list, String options, NotifyFunction func, IntPtr user_data)"); return default(Error); }
public static extern Error clRetainProgram(OpenCLProgram program);
public static extern Error clReleaseProgram(OpenCLProgram program);
public static OpenCLKernel clCreateKernel(OpenCLProgram program, String kernel_name, Error error) { Console.WriteLine("Calling OpenCLKernel clCreateKernel(OpenCLProgram program, String kernel_name, Error error)"); return default(OpenCLKernel); }
public static extern Error clGetProgramInfo(OpenCLProgram program, ProgramInfo param_name, IntPtr param_value_size, IntPtr param_value, IntPtr param_value_size_ret);
public static extern Error clGetProgramBuildInfo(OpenCLProgram program, OpenCLDevice device, ProgramBuildInfo param_name, IntPtr param_value_size, IntPtr param_value, IntPtr param_value_size_ret);