[−][src]Struct opencl3::program::Program
An OpenCL program object.
Implements the Drop trait to call release_program when the object is dropped.
Implementations
impl Program
[src]
pub fn create_from_source(
context: cl_context,
srcs: &[&CStr]
) -> Result<Program, cl_int>
[src]
context: cl_context,
srcs: &[&CStr]
) -> Result<Program, cl_int>
Create a Program for a context and load source code into that object.
context
- a valid OpenCL context.srcs
- a slice of CStrs containing the source code character strings.
returns a Result containing the new Program or the error code from the OpenCL C API function.
pub fn create_from_binary(
context: cl_context,
devices: &[cl_device_id],
binaries: &[&[u8]]
) -> Result<Program, cl_int>
[src]
context: cl_context,
devices: &[cl_device_id],
binaries: &[&[u8]]
) -> Result<Program, cl_int>
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: cl_context,
devices: &[cl_device_id],
kernel_names: &CStr
) -> Result<Program, cl_int>
[src]
context: cl_context,
devices: &[cl_device_id],
kernel_names: &CStr
) -> Result<Program, cl_int>
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.
pub fn build(
&self,
devices: &[cl_device_id],
options: &CStr
) -> Result<(), cl_int>
[src]
&self,
devices: &[cl_device_id],
options: &CStr
) -> Result<(), cl_int>
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.
pub fn compile(
&self,
devices: &[cl_device_id],
options: &CStr,
input_headers: &[cl_program],
header_include_names: &[*const c_char]
) -> Result<(), cl_int>
[src]
&self,
devices: &[cl_device_id],
options: &CStr,
input_headers: &[cl_program],
header_include_names: &[*const c_char]
) -> Result<(), cl_int>
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.
pub fn link(
&mut self,
devices: &[cl_device_id],
options: &CStr,
input_programs: &[cl_program]
) -> Result<(), cl_int>
[src]
&mut self,
devices: &[cl_device_id],
options: &CStr,
input_programs: &[cl_program]
) -> Result<(), cl_int>
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.
pub fn create_kernel(&self, kernel_name: &CStr) -> Result<cl_kernel, cl_int>
[src]
Create an OpenCL kernel object for a Program with a successfully built executable.
kernel_name
- a kernel function name in the program.
returns a Result containing the new cl_kernel or the error code from the OpenCL C API function.
pub fn create_kernels_in_program(&self) -> Result<Vec<cl_kernel>, cl_int>
[src]
Create OpenCL kernel objects for all kernel functions in a program.
program
- a valid OpenCL program.
returns a Result containing the new cl_kernels in a Vec or the error code from the OpenCL C API function.
pub fn get_reference_count(&self) -> Result<cl_uint, cl_int>
[src]
pub fn get_context(&self) -> Result<intptr_t, cl_int>
[src]
pub fn get_num_devices(&self) -> Result<cl_uint, cl_int>
[src]
pub fn get_devices(&self) -> Result<Vec<intptr_t>, cl_int>
[src]
pub fn get_source(&self) -> Result<CString, cl_int>
[src]
pub fn get_binary_sizes(&self) -> Result<Vec<size_t>, cl_int>
[src]
pub fn get_binaries(&self) -> Result<Vec<Vec<cl_uchar>>, cl_int>
[src]
pub fn get_num_kernels(&self) -> Result<cl_uint, cl_int>
[src]
pub fn get_kernel_names(&self) -> Result<CString, cl_int>
[src]
pub fn get_program_il(&self) -> Result<CString, cl_int>
[src]
pub fn get_build_status(&self, device: cl_device_id) -> Result<cl_int, cl_int>
[src]
pub fn get_build_options(&self, device: cl_device_id) -> Result<CString, cl_int>
[src]
pub fn get_build_log(&self, device: cl_device_id) -> Result<CString, cl_int>
[src]
pub fn get_build_binary_type(
&self,
device: cl_device_id
) -> Result<cl_uint, cl_int>
[src]
&self,
device: cl_device_id
) -> Result<cl_uint, cl_int>
pub fn get_build_global_variable_total_size(
&self,
device: cl_device_id
) -> Result<size_t, cl_int>
[src]
&self,
device: cl_device_id
) -> Result<size_t, cl_int>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Program
[src]
impl !Send for Program
[src]
impl !Sync for Program
[src]
impl Unpin for Program
[src]
impl UnwindSafe for Program
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,