Struct ocl::ProQue
[−]
[src]
pub struct ProQue { /* fields omitted */ }An all-in-one chimera of the Program, Queue, Context and
(optionally) SpatialDims types.
Handy when you only need a single context, program, and queue for your project or when using a unique context and program on each device.
All ProQue functionality is also provided separately by the Context, Queue,
Program, and SpatialDims types.
Creation
There are two ways to create a ProQue:
- [Recommended] Use
ProQue::builderorProQueBuilder::new(). - Call
::newand pass pre-created components.
Destruction
Now handled automatically. Freely use, store, clone, discard, share among threads... put some on your toast... whatever.
Methods
impl ProQue[src]
fn builder() -> ProQueBuilder
Returns a new ProQueBuilder.
This is the recommended way to create a new ProQue.
Calling ProQueBuilder::build() will return a new ProQue.
fn new<D: Into<SpatialDims>>(
context: Context,
queue: Queue,
program: Program,
dims: Option<D>
) -> ProQue
context: Context,
queue: Queue,
program: Program,
dims: Option<D>
) -> ProQue
Creates a new ProQue from individual parts.
Use ::builder instead unless you know what you're doing. Creating
from components associated with different devices or contexts will
cause errors later on.
fn create_kernel(&self, name: &str) -> OclResult<Kernel>
Creates a kernel with pre-assigned dimensions.
fn create_buffer<T: OclPrm>(&self) -> OclResult<Buffer<T>>
Returns a new buffer.
The default dimensions and queue from this ProQue will be used.
The buffer will be filled with zeros upon creation, blocking the current thread until completion.
Use Buffer::builder() (or BufferBuilder::new()) for access to the
full range of buffer creation options.
Errors
This ProQue must have been pre-configured with default dimensions.
If not, set them with ::set_dims, or just create a buffer using
Buffer::builder() instead.
fn set_dims<S: Into<SpatialDims>>(&mut self, dims: S)
Sets the default dimensions used when creating buffers and kernels.
fn max_wg_size(&self) -> OclResult<usize>
Returns the maximum workgroup size supported by the device associated
with this ProQue.
[UNSTABLE]: Evaluate usefulness.
fn queue(&self) -> &Queue
Returns a reference to the queue associated with this ProQue.
fn context(&self) -> &Context
Returns the contained context.
fn program(&self) -> &Program
Returns the current program build.
fn dims(&self) -> &SpatialDims
Returns the current dims or panics.
[UNSTABLE]: Evaluate which 'dims' method to keep. Leaning towards this version at the moment.
fn dims_result(&self) -> OclResult<&SpatialDims>
Returns the current dims or an error.
[UNSTABLE]: Evaluate which 'dims' method to keep. Leaning towards the above, panicing version at the moment.
Methods from Deref<Target = Queue>
fn flush(&self) -> OclResult<()>
Issues all previously queued OpenCL commands to the device.
fn finish(&self) -> OclResult<()>
Blocks until all commands in this queue have completed before returning.
fn enqueue_marker<Ewl>(&self, ewait: Option<Ewl>) -> OclResult<Event> where
Ewl: ClWaitListPtr,
Ewl: ClWaitListPtr,
Enqueues a marker command which waits for either a list of events to complete, or all previously enqueued commands to complete.
fn core_as_ref(&self) -> &CommandQueueCore
: Use ::core instead.
Returns a reference to the core pointer wrapper, usable by functions in
the core module.
fn core(&self) -> &CommandQueueCore
Returns a reference to the core pointer wrapper, usable by functions in
the core module.
fn context(&self) -> Context
Returns a copy of the Context associated with this queue.
fn device(&self) -> Device
Returns the OpenCL device associated with this queue.
fn device_version(&self) -> OpenclVersion
Returns the cached device version.
fn info(&self, info_kind: CommandQueueInfo) -> CommandQueueInfoResult
Returns info about this queue.
Trait Implementations
impl Clone for ProQue[src]
fn clone(&self) -> ProQue
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Debug for ProQue[src]
impl MemLen for ProQue[src]
fn to_len(&self) -> usize
Returns the exact number of elements of a volume of memory (equivalent to Vec::len()). Read more
fn to_len_padded(&self, incr: usize) -> usize
Returns the length of a volume of memory padded to the next multiple of incr. Read more
fn to_lens(&self) -> [usize; 3]
Returns the exact lengths of each dimension of a volume of memory.
impl WorkDims for ProQue[src]
fn dim_count(&self) -> u32
Returns the number of dimensions defined.
fn to_work_size(&self) -> Option<[usize; 3]>
Returns an array representing the amount of work to be done by a kernel. Read more
fn to_work_offset(&self) -> Option<[usize; 3]>
Returns an array representing the offset of a work item or memory location. Read more