Struct ocl::builders::ProQueBuilder
source · pub struct ProQueBuilder<'b> { /* private fields */ }
Expand description
A builder for ProQue
.
Implementations§
source§impl<'b> ProQueBuilder<'b>
impl<'b> ProQueBuilder<'b>
sourcepub fn new() -> ProQueBuilder<'b>
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.
sourcepub fn platform(&mut self, platform: Platform) -> &mut ProQueBuilder<'b>
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.
sourcepub fn context(&mut self, context: Context) -> &mut ProQueBuilder<'b>
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.
sourcepub fn device<D: Into<DeviceSpecifier>>(
&mut self,
device_spec: D
) -> &mut ProQueBuilder<'b>
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.
sourcepub fn src<S: Into<String>>(&mut self, src: S) -> &mut ProQueBuilder<'b>
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).
sourcepub fn prog_bldr(
&mut self,
program_builder: ProgramBuilder<'b>
) -> &mut ProQueBuilder<'b>
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.
sourcepub fn dims<D: Into<SpatialDims>>(&mut self, dims: D) -> &mut ProQueBuilder<'b>
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.
sourcepub fn queue_properties(
&mut self,
props: CommandQueueProperties
) -> &mut ProQueBuilder<'b>
pub fn queue_properties( &mut self, props: CommandQueueProperties ) -> &mut ProQueBuilder<'b>
Sets the command queue properties.
Optional.