Struct ocl::builders::ProQueBuilder

source ·
pub struct ProQueBuilder<'b> { /* private fields */ }
Expand description

A builder for ProQue.

Implementations§

source§

impl<'b> ProQueBuilder<'b>

source

pub fn new() -> ProQueBuilder<'b>

Returns a new ProQueBuilder with an empty / default configuration.

The minimum amount of configuration possible before calling ::build is to simply assign some source code using ::src.

For full configuration options, separately create a Context and ProgramBuilder (do not ::build the ProgramBuilder, its device list must be set by this ProQueBuilder to assure consistency) then pass them as arguments to the ::context and ::prog_bldr methods respectively.

source

pub fn platform(&mut self, platform: Platform) -> &mut ProQueBuilder<'b>

Sets the platform to be used and returns the builder.

§Panics

If context is set, this will panic upon building. Only one or the other can be configured.

source

pub fn context(&mut self, context: Context) -> &mut ProQueBuilder<'b>

Sets the context and returns the ProQueBuilder.

§Panics

If platform is set, this will panic upon building. Only one or the other can be configured.

source

pub fn device<D: Into<DeviceSpecifier>>( &mut self, device_spec: D ) -> &mut ProQueBuilder<'b>

Sets a device or devices to be used and returns a ProQueBuilder reference.

Must specify only a single device.

source

pub fn src<S: Into<String>>(&mut self, src: S) -> &mut ProQueBuilder<'b>

Adds some source code to be compiled and returns the ProQueBuilder.

Creates a ProgramBuilder if one has not already been added. Attempts to call ::program_builder after calling this method will cause a panic.

If you need a more complex build configuration or to add multiple source files. Pass an unbuilt ProgramBuilder to the ::program_builder method (described below).

source

pub fn prog_bldr( &mut self, program_builder: ProgramBuilder<'b> ) -> &mut ProQueBuilder<'b>

Adds a pre-configured ProgramBuilder and returns the ProQueBuilder.

§Panics

This ProQueBuilder may not already contain a ProgramBuilder.

program_builder must not have any device indices configured (via its ::device_idxs method). ProQueBuilder will only build programs for the device specified by ::device_idx or the default device if none has been specified.

source

pub fn dims<D: Into<SpatialDims>>(&mut self, dims: D) -> &mut ProQueBuilder<'b>

Sets the built-in dimensions.

This is optional.

Use if you want to be able to call the ::create_kernel or ::create_buffer methods on the ProQue created by this builder. Dimensions can alternatively be set after building by using the ProQue::set_dims method.

source

pub fn queue_properties( &mut self, props: CommandQueueProperties ) -> &mut ProQueBuilder<'b>

Sets the command queue properties.

Optional.

source

pub fn build(&self) -> OclResult<ProQue>

Returns a new ProQue.

§Errors

A ProgramBuilder or some source code must have been specified with ::prog_bldr or ::src before building.

Auto Trait Implementations§

§

impl<'b> Freeze for ProQueBuilder<'b>

§

impl<'b> RefUnwindSafe for ProQueBuilder<'b>

§

impl<'b> Send for ProQueBuilder<'b>

§

impl<'b> Sync for ProQueBuilder<'b>

§

impl<'b> Unpin for ProQueBuilder<'b>

§

impl<'b> UnwindSafe for ProQueBuilder<'b>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.