Struct fil_ocl::builders::ProQueBuilder[][src]

#[must_use = "builders do nothing unless '::build' is called"]pub struct ProQueBuilder<'b> { /* fields omitted */ }

A builder for ProQue.

Implementations

impl<'b> ProQueBuilder<'b>[src]

pub fn new() -> ProQueBuilder<'b>[src]

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.

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

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.

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

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.

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

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

Must specify only a single device.

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

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

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

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.

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

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.

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

Sets the command queue properties.

Optional.

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

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

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, 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.