struct.ProQueBuilder.html 16 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!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="../../light.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">&#9776;</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><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</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"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></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'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#247-254' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'><div class="docblock attributes">#[must_use = "builders do nothing unless \'::build\' is called"]
  2. </div>pub struct ProQueBuilder&lt;'b&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A builder for <code>ProQue</code>.</p>
  3. </div>
  4. <h2 id='methods' class='small-section-header'>
  5. Methods<a href='#methods' class='anchor'></a>
  6. </h2>
  7. <h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'b&gt; <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code><a href='#impl' class='anchor'></a></span></td><td><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></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.new' class='fnname'>new</a>() -&gt; <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a new <code>ProQueBuilder</code> with an empty / default configuration.</p>
  8. <p>The minimum amount of configuration possible before calling <code>::build</code> is to
  9. simply assign some source code using <code>::src</code>.</p>
  10. <p>For full configuration options, separately create a <code>Context</code> and
  11. <code>ProgramBuilder</code> (do not <code>::build</code> the <code>ProgramBuilder</code>, its device
  12. list must be set by this <code>ProQueBuilder</code> to assure consistency) then
  13. pass them as arguments to the <code>::context</code> and <code>::prog_bldr</code> methods
  14. respectively.</p>
  15. </div><h4 id='method.platform' class="method"><span id='platform.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.platform' class='fnname'>platform</a>(&amp;mut self, platform: <a class="struct" href="../../ocl/struct.Platform.html" title="struct ocl::Platform">Platform</a>) -&gt; &amp;mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the platform to be used and returns the builder.</p>
  16. <h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
  17. <p>If context is set, this will panic upon building. Only one or the other
  18. can be configured.</p>
  19. </div><h4 id='method.context' class="method"><span id='context.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.context' class='fnname'>context</a>(&amp;mut self, context: <a class="struct" href="../../ocl/struct.Context.html" title="struct ocl::Context">Context</a>) -&gt; &amp;mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the context and returns the <code>ProQueBuilder</code>.</p>
  20. <h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
  21. <p>If platform is set, this will panic upon building. Only one or the other
  22. can be configured.</p>
  23. </div><h4 id='method.device' class="method"><span id='device.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.device' class='fnname'>device</a>&lt;D:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="enum" href="../../ocl/builders/enum.DeviceSpecifier.html" title="enum ocl::builders::DeviceSpecifier">DeviceSpecifier</a>&gt;&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;device_spec: D<br>) -&gt; &amp;mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets a device or devices to be used and returns a <code>ProQueBuilder</code>
  24. reference.</p>
  25. <p>Must specify only a single device.</p>
  26. </div><h4 id='method.src' class="method"><span id='src.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.src' class='fnname'>src</a>&lt;S:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;&gt;(&amp;mut self, src: S) -&gt; &amp;mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds some source code to be compiled and returns the <code>ProQueBuilder</code>.</p>
  27. <p>Creates a <code>ProgramBuilder</code> if one has not already been added. Attempts
  28. to call <code>::program_builder</code> after calling this method will cause a panic.</p>
  29. <p>If you need a more complex build configuration or to add multiple
  30. source files. Pass an <em>unbuilt</em> <code>ProgramBuilder</code> to the
  31. <code>::program_builder</code> method (described below).</p>
  32. </div><h4 id='method.prog_bldr' class="method"><span id='prog_bldr.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.prog_bldr' class='fnname'>prog_bldr</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;program_builder: <a class="struct" href="../../ocl/builders/struct.ProgramBuilder.html" title="struct ocl::builders::ProgramBuilder">ProgramBuilder</a>&lt;'b&gt;<br>) -&gt; &amp;mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a pre-configured <code>ProgramBuilder</code> and returns the <code>ProQueBuilder</code>.</p>
  33. <h2 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h2>
  34. <p>This <code>ProQueBuilder</code> may not already contain a <code>ProgramBuilder</code>.</p>
  35. <p><code>program_builder</code> must not have any device indices configured (via its
  36. <code>::device_idxs</code> method). <code>ProQueBuilder</code> will only build programs for
  37. the device specified by <code>::device_idx</code> or the default device if none has
  38. been specified.</p>
  39. </div><h4 id='method.dims' class="method"><span id='dims.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.dims' class='fnname'>dims</a>&lt;D:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;<a class="enum" href="../../ocl/enum.SpatialDims.html" title="enum ocl::SpatialDims">SpatialDims</a>&gt;&gt;(&amp;mut self, dims: D) -&gt; &amp;mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the built-in dimensions.</p>
  40. <p>This is optional.</p>
  41. <p>Use if you want to be able to call the <code>::create_kernel</code> or
  42. <code>::create_buffer</code> methods on the <code>ProQue</code> created by this builder.
  43. Dimensions can alternatively be set after building by using the
  44. <code>ProQue::set_dims</code> method.</p>
  45. </div><h4 id='method.queue_properties' class="method"><span id='queue_properties.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.queue_properties' class='fnname'>queue_properties</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;props: <a class="struct" href="../../ocl/flags/struct.CommandQueueProperties.html" title="struct ocl::flags::CommandQueueProperties">CommandQueueProperties</a><br>) -&gt; &amp;mut <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the command queue properties.</p>
  46. <p>Optional.</p>
  47. </div><h4 id='method.build' class="method"><span id='build.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.build' class='fnname'>build</a>(&amp;self) -&gt; <a class="type" href="../../ocl/error/type.Result.html" title="type ocl::error::Result">OclResult</a>&lt;<a class="struct" href="../../ocl/struct.ProQue.html" title="struct ocl::ProQue">ProQue</a>&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a new <code>ProQue</code>.</p>
  48. <h2 id="errors" class="section-header"><a href="#errors">Errors</a></h2>
  49. <p>A <code>ProgramBuilder</code> or some source code must have been specified with
  50. <code>::prog_bldr</code> or <code>::src</code> before building.</p>
  51. </div></div>
  52. <h2 id='synthetic-implementations' class='small-section-header'>
  53. Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
  54. </h2>
  55. <div id='synthetic-implementations-list'>
  56. <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'b&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'b&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></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>&#9166;</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><p>Search multiple things at once by splitting your query with comma (e.g. <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../";window.currentCrate = "ocl";</script><script src="../../aliases.js"></script><script src="../../main.js"></script><script defer src="../../search-index.js"></script></body></html>