Struct rust_gpu_tools::opencl::Program [−][src]
pub struct Program { /* fields omitted */ }
Implementations
Returns a kernel.
The global_work_size
does not follow the OpenCL definition. It is not the total
number of threads. Instead it follows CUDA’s definition and is the number of
local_work_size
sized thread groups. So the total number of threads is
global_work_size * local_work_size
.
pub fn read_into_buffer<T>(
&self,
buffer: &Buffer<T>,
offset: usize,
data: &mut [T]
) -> GPUResult<()>
Run some code in the context of the program
On CUDA it sets the correct contexts and synchronizes the stream before returning. On OpenCL it’s only executing the closure without any other side-effects.