[][src]Struct ocl_stream::executor::OCLStreamExecutor

pub struct OCLStreamExecutor { /* fields omitted */ }

Stream executor for OpenCL Programs

Implementations

impl OCLStreamExecutor[src]

pub fn new(pro_que: ProQue) -> Self[src]

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);

pub fn set_concurrency(&mut self, mut num_tasks: usize)[src]

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.

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, 
[src]

Executes a closure in the ocl context with a bounded channel

pub fn pro_que(&self) -> &ProQue[src]

Returns the inner pro_que object

pub fn execute_unbounded<F, T>(&self, func: F) -> OCLStream<T> where
    F: Fn(ExecutorContext<T>) -> OCLStreamResult<()> + Send + Sync + 'static,
    T: Send + Sync + 'static, 
[src]

Executes a closure in the ocl context with an unbounded channel for streaming

pub fn create_shared_buffer<T>(&self, len: usize) -> Result<SharedBuffer<T>> where
    T: OclPrm, 
[src]

Creates a new shard buffer with a given length

Trait Implementations

impl Clone for OCLStreamExecutor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.