Struct ocl::builders::ProgramBuilder [] [src]

#[must_use = "builders do nothing unless \'::build\' is called"]
pub struct ProgramBuilder { /* fields omitted */ }

A builder for Program.

Methods

impl ProgramBuilder
[src]

Returns a new, empty, build configuration object.

Returns a newly built Program.

  • TODO: If the context is associated with more than one device, check that at least one of those devices has been specified. An empty device list will cause an OpenCL error in that case.

  • TODO: Check for duplicate devices in the final device list.

Adds a build option containing a compiler command line definition. Formatted as -D {name}={val}.

Example

...cmplr_def("MAX_ITERS", 500)...

Adds a build option containing a raw compiler command line parameter. Formatted as {} (exact text).

Example

...cmplr_opt("-g")...

Pushes pre-created build option to the list of options.

Adds the contents of a file to the program.

Adds raw text to the program source.

Specifies a list of devices to build this program on. The devices must be associated with the context passed to ::build later on.

Devices may be specified in any number of ways including simply passing a device or slice of devices. See the impl From section of DeviceSpecifier for more information.

Panics

Devices must not have already been specified.

Returns the devices specified to be associated the program.

Returns a concatenated string of command line options to be passed to the compiler when building this program.

Returns the final program source code as a list of strings.

Order of Inclusion

  1. Macro definitions and code strings specified by a BuildOpt::IncludeDefine or BuildOpt::IncludeRaw via ::bo
  2. Contents of files specified via ::src_file
  3. Contents of strings specified via ::src or a BuildOpt::IncludeRawEof via ::bo

Trait Implementations

impl Clone for ProgramBuilder
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for ProgramBuilder
[src]

Formats the value using the given formatter.