Struct opencl3::program::Program [−][src]
pub struct Program { /* fields omitted */ }
Expand description
An OpenCL program object.
Stores the names of the OpenCL kernels in the program.
Implements the Drop trait to call release_program when the object is dropped.
Implementations
Get the underlying OpenCL cl_program.
Get the names of the OpenCL kernels in the Program, in a string separated by semicolons.
Create a Program for a context and load source code into that object.
context
- a valid OpenCL context.sources
- an array of strs containing the source code strings.
returns a Result containing the new Program or the error code from the OpenCL C API function.
Create a Program for a context and load a source code string into that object.
context
- a valid OpenCL context.src
- a str containing a source code string.
returns a Result containing the new Program or the error code from the OpenCL C API function.
Create a Program for a context and load binary bits into that object.
context
- a valid OpenCL context.devices
- a slice of devices that are in context.binaries
- a slice of program binaries slices.
returns a Result containing the new Program or the error code from the OpenCL C API function.
pub fn create_from_builtin_kernels(
context: &Context,
devices: &[cl_device_id],
kernel_names: &str
) -> Result<Program>
pub fn create_from_builtin_kernels(
context: &Context,
devices: &[cl_device_id],
kernel_names: &str
) -> Result<Program>
Create a Program for a context and loads the information related to the built-in kernels into that object.
context
- a valid OpenCL context.devices
- a slice of devices that are in context.kernel_names
- a semi-colon separated list of built-in kernel names.
returns a Result containing the new Program or the error code from the OpenCL C API function.
Build (compile & link) a Program.
devices
- a slice of devices that are in context.options
- the build options in a null-terminated string.pfn_notify
- an optional function pointer to a notification routine.user_data
- passed as an argument when pfn_notify is called, or ptr::null_mut().
returns a null Result or the error code from the OpenCL C API function.
Create and build an OpenCL Program from an array of source code strings with the given options.
context
- a valid OpenCL context.sources
- an array of strs containing the source code strings.options
- the build options in a null-terminated string.
returns a Result containing the new Program, the name of the error code from the OpenCL C API function or the build log, if the build failed.
Create and build an OpenCL Program from source code with the given options.
context
- a valid OpenCL context.src
- a str containing a source code string.options
- the build options in a null-terminated string.
returns a Result containing the new Program, the name of the error code from the OpenCL C API function or the build log, if the build failed.
Create and build an OpenCL Program from binaries with the given options.
context
- a valid OpenCL context.binaries
- a slice of program binaries slices.options
- the build options in a null-terminated string.
returns a Result containing the new Program or the error code from the OpenCL C API function.
Compile a program’s source for the devices the OpenCL context associated with the program.
devices
- a slice of devices that are in context.options
- the compilation options in a null-terminated string.input_headers
- a slice of programs that describe headers in the input_headers.header_include_names
- an array that has a one to one correspondence with input_headers.
returns a null Result or the error code from the OpenCL C API function.
Link a set of compiled program objects and libraries for the devices in the OpenCL context associated with the program.
devices
- a slice of devices that are in context.options
- the link options in a null-terminated string.input_programs
- a slice of programs that describe headers in the input_headers.
returns a null Result or the error code from the OpenCL C API function.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Program
impl UnwindSafe for Program