pub struct OCLStreamExecutor { /* private fields */ }Expand description
Stream executor for OpenCL Programs
Implementations§
Source§impl OCLStreamExecutor
impl OCLStreamExecutor
Sourcepub fn new(pro_que: ProQue) -> Self
pub fn new(pro_que: ProQue) -> Self
Creates a new OpenCL Stream executor
use ocl::ProQue;
use ocl_stream::OCLStreamExecutor;
let pro_que = ProQue::builder().src("__kernel void bench_int() {}").build().unwrap();
let executor = OCLStreamExecutor::new(pro_que);Sourcepub fn set_concurrency(&mut self, num_tasks: usize)
pub fn set_concurrency(&mut self, num_tasks: usize)
Sets how many threads should be used to schedule kernels on the gpu. Using multiple threads reduces the idle time of the gpu. While one kernel is running, the next one can be prepared in a different thread. A value of 0 means that the number of cpu cores should be used.
Sourcepub fn execute_bounded<F, T>(&self, size: usize, func: F) -> OCLStream<T>where
F: Fn(ExecutorContext<T>) -> OCLStreamResult<()> + Send + Sync + 'static,
T: Send + Sync + 'static,
pub fn execute_bounded<F, T>(&self, size: usize, func: F) -> OCLStream<T>where
F: Fn(ExecutorContext<T>) -> OCLStreamResult<()> + Send + Sync + 'static,
T: Send + Sync + 'static,
Executes a closure in the ocl context with a bounded channel
Sourcepub fn execute_unbounded<F, T>(&self, func: F) -> OCLStream<T>where
F: Fn(ExecutorContext<T>) -> OCLStreamResult<()> + Send + Sync + 'static,
T: Send + Sync + 'static,
pub fn execute_unbounded<F, T>(&self, func: F) -> OCLStream<T>where
F: Fn(ExecutorContext<T>) -> OCLStreamResult<()> + Send + Sync + 'static,
T: Send + Sync + 'static,
Executes a closure in the ocl context with an unbounded channel for streaming
Creates a new shard buffer with a given length
Trait Implementations§
Source§impl Clone for OCLStreamExecutor
impl Clone for OCLStreamExecutor
Source§fn clone(&self) -> OCLStreamExecutor
fn clone(&self) -> OCLStreamExecutor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OCLStreamExecutor
impl RefUnwindSafe for OCLStreamExecutor
impl Send for OCLStreamExecutor
impl Sync for OCLStreamExecutor
impl Unpin for OCLStreamExecutor
impl UnwindSafe for OCLStreamExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more