struct.ProQueBuilder.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="rustdoc">
  7. <meta name="description" content="API documentation for the Rust `ProQueBuilder` struct in crate `ocl`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, ProQueBuilder">
  9. <title>ocl::builders::ProQueBuilder - Rust</title>
  10. <link rel="stylesheet" type="text/css" href="../../normalize.css">
  11. <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
  12. <link rel="stylesheet" type="text/css" href="../../dark.css">
  13. <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
  14. <script src="../../storage.js"></script>
  15. </head>
  16. <body class="rustdoc struct">
  17. <!--[if lte IE 8]>
  18. <div class="warning">
  19. This old browser is unsupported and will most likely display funky
  20. things.
  21. </div>
  22. <![endif]-->
  23. <nav class="sidebar">
  24. <div class="sidebar-menu">&#9776;</div>
  25. <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>
  26. </nav>
  27. <div class="theme-picker">
  28. <button id="theme-picker" aria-label="Pick another theme!">
  29. <img src="../../brush.svg" width="18" alt="Pick another theme!">
  30. </button>
  31. <div id="theme-choices"></div>
  32. </div>
  33. <script src="../../theme.js"></script>
  34. <nav class="sub">
  35. <form class="search-form js-only">
  36. <div class="search-container">
  37. <input class="search-input" name="search"
  38. autocomplete="off"
  39. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  40. type="search">
  41. </div>
  42. </form>
  43. </nav>
  44. <section id='main' class="content">
  45. <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'>
  46. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  47. [<span class='inner'>&#x2212;</span>]
  48. </a>
  49. </span><a class='srclink' href='../../src/ocl/standard/pro_que.rs.html#247-254' title='goto source code'>[src]</a></span></h1>
  50. <pre class='rust struct'><div class="docblock attributes">#[must_use = "builders do nothing unless \'::build\' is called"]
  51. </div>pub struct ProQueBuilder&lt;'b&gt; { /* fields omitted */ }</pre><div class='docblock'><p>A builder for <code>ProQue</code>.</p>
  52. </div>
  53. <h2 id='methods' class='small-section-header'>
  54. Methods<a href='#methods' class='anchor'></a>
  55. </h2>
  56. <h3 id='impl' class='impl'><span class='in-band'><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><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>
  57. <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>() -&gt; <a class="struct" href="../../ocl/builders/struct.ProQueBuilder.html" title="struct ocl::builders::ProQueBuilder">ProQueBuilder</a>&lt;'b&gt;</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>
  58. <div class='docblock'><p>Returns a new <code>ProQueBuilder</code> with an empty / default configuration.</p>
  59. <p>The minimum amount of configuration possible before calling <code>::build</code> is to
  60. simply assign some source code using <code>::src</code>.</p>
  61. <p>For full configuration options, separately create a <code>Context</code> and
  62. <code>ProgramBuilder</code> (do not <code>::build</code> the <code>ProgramBuilder</code>, its device
  63. list must be set by this <code>ProQueBuilder</code> to assure consistency) then
  64. pass them as arguments to the <code>::context</code> and <code>::prog_bldr</code> methods
  65. respectively.</p>
  66. </div><h4 id='method.platform' class="method"><span id='platform.v' class='invisible'><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><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>
  67. <div class='docblock'><p>Sets the platform to be used and returns the builder.</p>
  68. <h1 id="panics" class="section-header"><a href="#panics">Panics</a></h1>
  69. <p>If context is set, this will panic upon building. Only one or the other
  70. can be configured.</p>
  71. </div><h4 id='method.context' class="method"><span id='context.v' class='invisible'><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><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>
  72. <div class='docblock'><p>Sets the context and returns the <code>ProQueBuilder</code>.</p>
  73. <h1 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h1>
  74. <p>If platform is set, this will panic upon building. Only one or the other
  75. can be configured.</p>
  76. </div><h4 id='method.device' class="method"><span id='device.v' class='invisible'><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><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>
  77. <div class='docblock'><p>Sets a device or devices to be used and returns a <code>ProQueBuilder</code>
  78. reference.</p>
  79. <p>Must specify only a single device.</p>
  80. </div><h4 id='method.src' class="method"><span id='src.v' class='invisible'><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><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>
  81. <div class='docblock'><p>Adds some source code to be compiled and returns the <code>ProQueBuilder</code>.</p>
  82. <p>Creates a <code>ProgramBuilder</code> if one has not already been added. Attempts
  83. to call <code>::program_builder</code> after calling this method will cause a panic.</p>
  84. <p>If you need a more complex build configuration or to add multiple
  85. source files. Pass an <em>unbuilt</em> <code>ProgramBuilder</code> to the
  86. <code>::program_builder</code> method (described below).</p>
  87. </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>&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><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>
  88. <div class='docblock'><p>Adds a pre-configured <code>ProgramBuilder</code> and returns the <code>ProQueBuilder</code>.</p>
  89. <h2 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h2>
  90. <p>This <code>ProQueBuilder</code> may not already contain a <code>ProgramBuilder</code>.</p>
  91. <p><code>program_builder</code> must not have any device indices configured (via its
  92. <code>::device_idxs</code> method). <code>ProQueBuilder</code> will only build programs for
  93. the device specified by <code>::device_idx</code> or the default device if none has
  94. been specified.</p>
  95. </div><h4 id='method.dims' class="method"><span id='dims.v' class='invisible'><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><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>
  96. <div class='docblock'><p>Sets the built-in dimensions.</p>
  97. <p>This is optional.</p>
  98. <p>Use if you want to be able to call the <code>::create_kernel</code> or
  99. <code>::create_buffer</code> methods on the <code>ProQue</code> created by this builder.
  100. Dimensions can alternatively be set after building by using the
  101. <code>ProQue::set_dims</code> method.</p>
  102. </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>&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><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>
  103. <div class='docblock'><p>Sets the command queue properties.</p>
  104. <p>Optional.</p>
  105. </div><h4 id='method.build' class="method"><span id='build.v' class='invisible'><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><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>
  106. <div class='docblock'><p>Returns a new <code>ProQue</code>.</p>
  107. <h2 id="errors" class="section-header"><a href="#errors">Errors</a></h2>
  108. <p>A <code>ProgramBuilder</code> or some source code must have been specified with
  109. <code>::prog_bldr</code> or <code>::src</code> before building.</p>
  110. </div></div></section>
  111. <section id='search' class="content hidden"></section>
  112. <section class="footer"></section>
  113. <aside id="help" class="hidden">
  114. <div>
  115. <h1 class="hidden">Help</h1>
  116. <div class="shortcuts">
  117. <h2>Keyboard Shortcuts</h2>
  118. <dl>
  119. <dt><kbd>?</kbd></dt>
  120. <dd>Show this help dialog</dd>
  121. <dt><kbd>S</kbd></dt>
  122. <dd>Focus the search field</dd>
  123. <dt><kbd>↑</kbd></dt>
  124. <dd>Move up in search results</dd>
  125. <dt><kbd>↓</kbd></dt>
  126. <dd>Move down in search results</dd>
  127. <dt><kbd>↹</kbd></dt>
  128. <dd>Switch tab</dd>
  129. <dt><kbd>&#9166;</kbd></dt>
  130. <dd>Go to active search result</dd>
  131. <dt><kbd>+</kbd></dt>
  132. <dd>Expand all sections</dd>
  133. <dt><kbd>-</kbd></dt>
  134. <dd>Collapse all sections</dd>
  135. </dl>
  136. </div>
  137. <div class="infos">
  138. <h2>Search Tricks</h2>
  139. <p>
  140. Prefix searches with a type followed by a colon (e.g.
  141. <code>fn:</code>) to restrict the search to a given type.
  142. </p>
  143. <p>
  144. Accepted types are: <code>fn</code>, <code>mod</code>,
  145. <code>struct</code>, <code>enum</code>,
  146. <code>trait</code>, <code>type</code>, <code>macro</code>,
  147. and <code>const</code>.
  148. </p>
  149. <p>
  150. Search functions by type signature (e.g.
  151. <code>vec -> usize</code> or <code>* -> vec</code>)
  152. </p>
  153. </div>
  154. </div>
  155. </aside>
  156. <script>
  157. window.rootPath = "../../";
  158. window.currentCrate = "ocl";
  159. </script>
  160. <script src="../../main.js"></script>
  161. <script defer src="../../search-index.js"></script>
  162. </body>
  163. </html>