<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `ProQueBuilder` struct in crate `ocl`."> <meta name="keywords" content="rust, rustlang, rust-lang, ProQueBuilder"> <title>ocl::builders::ProQueBuilder - Rust</title> <link rel="stylesheet" type="text/css" href="../../normalize.css"> <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"> <link rel="stylesheet" type="text/css" href="../../dark.css"> <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle"> <script src="../../storage.js"></script> </head> <body class="rustdoc struct"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <div class="sidebar-menu">☰</div> <p class='location'>Struct ProQueBuilder</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.platform">platform</a><a href="#method.context">context</a><a href="#method.device">device</a><a href="#method.src">src</a><a href="#method.prog_bldr">prog_bldr</a><a href="#method.dims">dims</a><a href="#method.queue_properties">queue_properties</a><a href="#method.build">build</a></div></div><p class='location'><a href='../index.html'>ocl</a>::<wbr><a href='index.html'>builders</a></p><script>window.sidebarCurrent = {name: 'ProQueBuilder', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div> </nav> <div class="theme-picker"> <button id="theme-picker" aria-label="Pick another theme!"> <img src="../../brush.svg" width="18" alt="Pick another theme!"> </button> <div id="theme-choices"></div> </div> <script src="../../theme.js"></script> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content"> <h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>ocl</a>::<wbr><a href='index.html'>builders</a>::<wbr><a class="struct" href=''>ProQueBuilder</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>−</span>] </a> </span><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#247-254' title='goto source code'>[src]</a></span></h1> <pre class='rust struct'><div class="docblock attributes">#[must_use = "builders do nothing unless \'::build\' is called"] </div>pub struct ProQueBuilder<'b> { /* fields omitted */ }</pre><div class='docblock'><p>A builder for <code>ProQue</code>.</p> </div> <h2 id='methods' class='small-section-header'> Methods<a href='#methods' class='anchor'></a> </h2> <h3 id='impl' class='impl'><span class='in-band'><code>impl<'b> <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#256-475' title='goto source code'>[src]</a></span></h3> <div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>pub fn <a href='#method.new' class='fnname'>new</a>() -> <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#268-277' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Returns a new <code>ProQueBuilder</code> with an empty / default configuration.</p> <p>The minimum amount of configuration possible before calling <code>::build</code> is to simply assign some source code using <code>::src</code>.</p> <p>For full configuration options, separately create a <code>Context</code> and <code>ProgramBuilder</code> (do not <code>::build</code> the <code>ProgramBuilder</code>, its device list must be set by this <code>ProQueBuilder</code> to assure consistency) then pass them as arguments to the <code>::context</code> and <code>::prog_bldr</code> methods respectively.</p> </div><h4 id='method.platform' class="method"><span id='platform.v' class='invisible'><code>pub fn <a href='#method.platform' class='fnname'>platform</a>(&mut self, platform: <a class="struct" href="../../ocl/struct.Platform.html" title="struct ocl::Platform">Platform</a>) -> &mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#285-288' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Sets the platform to be used and returns the builder.</p> <h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1> <p>If context is set, this will panic upon building. Only one or the other can be configured.</p> </div><h4 id='method.context' class="method"><span id='context.v' class='invisible'><code>pub fn <a href='#method.context' class='fnname'>context</a>(&mut self, context: <a class="struct" href="../../ocl/struct.Context.html" title="struct ocl::Context">Context</a>) -> &mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#296-299' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Sets the context and returns the <code>ProQueBuilder</code>.</p> <h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1> <p>If platform is set, this will panic upon building. Only one or the other can be configured.</p> </div><h4 id='method.device' class="method"><span id='device.v' class='invisible'><code>pub fn <a href='#method.device' class='fnname'>device</a><D: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="../../ocl/builders/enum.DeviceSpecifier.html" title="enum ocl::builders::DeviceSpecifier">DeviceSpecifier</a>>>(<br> &mut self, <br> device_spec: D<br>) -> &mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#306-312' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Sets a device or devices to be used and returns a <code>ProQueBuilder</code> reference.</p> <p>Must specify only a single device.</p> </div><h4 id='method.src' class="method"><span id='src.v' class='invisible'><code>pub fn <a href='#method.src' class='fnname'>src</a><S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>(&mut self, src: S) -> &mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#322-333' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Adds some source code to be compiled and returns the <code>ProQueBuilder</code>.</p> <p>Creates a <code>ProgramBuilder</code> if one has not already been added. Attempts to call <code>::program_builder</code> after calling this method will cause a panic.</p> <p>If you need a more complex build configuration or to add multiple source files. Pass an <em>unbuilt</em> <code>ProgramBuilder</code> to the <code>::program_builder</code> method (described below).</p> </div><h4 id='method.prog_bldr' class="method"><span id='prog_bldr.v' class='invisible'><code>pub fn <a href='#method.prog_bldr' class='fnname'>prog_bldr</a>(<br> &mut self, <br> program_builder: <a class="struct" href="../../ocl/builders/struct.ProgramBuilder.html" title="struct ocl::builders::ProgramBuilder">ProgramBuilder</a><'b><br>) -> &mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#345-356' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Adds a pre-configured <code>ProgramBuilder</code> and returns the <code>ProQueBuilder</code>.</p> <h2 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h2> <p>This <code>ProQueBuilder</code> may not already contain a <code>ProgramBuilder</code>.</p> <p><code>program_builder</code> must not have any device indices configured (via its <code>::device_idxs</code> method). <code>ProQueBuilder</code> will only build programs for the device specified by <code>::device_idx</code> or the default device if none has been specified.</p> </div><h4 id='method.dims' class="method"><span id='dims.v' class='invisible'><code>pub fn <a href='#method.dims' class='fnname'>dims</a><D: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="enum" href="../../ocl/enum.SpatialDims.html" title="enum ocl::SpatialDims">SpatialDims</a>>>(&mut self, dims: D) -> &mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#367-370' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Sets the built-in dimensions.</p> <p>This is optional.</p> <p>Use if you want to be able to call the <code>::create_kernel</code> or <code>::create_buffer</code> methods on the <code>ProQue</code> created by this builder. Dimensions can alternatively be set after building by using the <code>ProQue::set_dims</code> method.</p> </div><h4 id='method.queue_properties' class="method"><span id='queue_properties.v' class='invisible'><code>pub fn <a href='#method.queue_properties' class='fnname'>queue_properties</a>(<br> &mut self, <br> props: <a class="struct" href="../../ocl/flags/struct.CommandQueueProperties.html" title="struct ocl::flags::CommandQueueProperties">CommandQueueProperties</a><br>) -> &mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a><'b></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#376-379' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Sets the command queue properties.</p> <p>Optional.</p> </div><h4 id='method.build' class="method"><span id='build.v' class='invisible'><code>pub fn <a href='#method.build' class='fnname'>build</a>(&self) -> <a class="type" href="../../ocl/error/type.Result.html" title="type ocl::error::Result">OclResult</a><<a class="struct" href="../../ocl/struct.ProQue.html" title="struct ocl::ProQue">ProQue</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#389-474' title='goto source code'>[src]</a></span></h4> <div class='docblock'><p>Returns a new <code>ProQue</code>.</p> <h2 id="errors" class="section-header"><a href="#errors">Errors</a></h2> <p>A <code>ProgramBuilder</code> or some source code must have been specified with <code>::prog_bldr</code> or <code>::src</code> before building.</p> </div></div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt><kbd>?</kbd></dt> <dd>Show this help dialog</dd> <dt><kbd>S</kbd></dt> <dd>Focus the search field</dd> <dt><kbd>↑</kbd></dt> <dd>Move up in search results</dd> <dt><kbd>↓</kbd></dt> <dd>Move down in search results</dd> <dt><kbd>↹</kbd></dt> <dd>Switch tab</dd> <dt><kbd>⏎</kbd></dt> <dd>Go to active search result</dd> <dt><kbd>+</kbd></dt> <dd>Expand all sections</dd> <dt><kbd>-</kbd></dt> <dd>Collapse all sections</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code> or <code>* -> vec</code>) </p> </div> </div> </aside> <script> window.rootPath = "../../"; window.currentCrate = "ocl"; </script> <script src="../../main.js"></script> <script defer src="../../search-index.js"></script> </body> </html>