struct.KernelBuilder.html 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  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 `KernelBuilder` struct in crate `ocl`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, KernelBuilder">
  9. <title>ocl::builders::KernelBuilder - 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 KernelBuilder</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.program">program</a><a href="#method.name">name</a><a href="#method.queue">queue</a><a href="#method.gwo">gwo</a><a href="#method.gws">gws</a><a href="#method.lws">lws</a><a href="#method.global_work_offset">global_work_offset</a><a href="#method.global_work_size">global_work_size</a><a href="#method.local_work_size">local_work_size</a><a href="#method.arg">arg</a><a href="#method.arg_buf">arg_buf</a><a href="#method.arg_img">arg_img</a><a href="#method.arg_smp">arg_smp</a><a href="#method.arg_scl">arg_scl</a><a href="#method.arg_vec">arg_vec</a><a href="#method.arg_loc">arg_loc</a><a href="#method.arg_sampler">arg_sampler</a><a href="#method.arg_local">arg_local</a><a href="#method.arg_named">arg_named</a><a href="#method.arg_buf_named">arg_buf_named</a><a href="#method.arg_img_named">arg_img_named</a><a href="#method.arg_smp_named">arg_smp_named</a><a href="#method.arg_scl_named">arg_scl_named</a><a href="#method.arg_vec_named">arg_vec_named</a><a href="#method.arg_sampler_named">arg_sampler_named</a><a href="#method.disable_mem_arg_retention">disable_mem_arg_retention</a><a href="#method.disable_arg_type_check">disable_arg_type_check</a><a href="#method.build">build</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div></div><p class='location'><a href='../index.html'>ocl</a>::<wbr><a href='index.html'>builders</a></p><script>window.sidebarCurrent = {name: 'KernelBuilder', 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=''>KernelBuilder</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/kernel.rs.html#926-937' title='goto source code'>[src]</a></span></h1>
  50. <pre class='rust struct'>pub struct KernelBuilder&lt;'b&gt; { /* fields omitted */ }</pre><div class='docblock'><p>A kernel builder.</p>
  51. <h3 id="examples" class="section-header"><a href="#examples">Examples</a></h3>
  52. <div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><pre class="rust rust-example-rendered ignore">
  53. <span class="comment">// Create a kernel:</span>
  54. <span class="kw">let</span> <span class="ident">kernel</span> <span class="op">=</span> <span class="ident">Kernel</span>::<span class="ident">builder</span>()
  55. .<span class="ident">program</span>(<span class="kw-2">&amp;</span><span class="ident">program</span>)
  56. .<span class="ident">name</span>(<span class="string">&quot;process&quot;</span>)
  57. .<span class="ident">queue</span>(<span class="ident">queue</span>.<span class="ident">clone</span>())
  58. .<span class="ident">global_work_size</span>(<span class="kw-2">&amp;</span><span class="ident">gws_patch_count</span>)
  59. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span>(<span class="ident">patch_size</span> <span class="kw">as</span> <span class="ident">i32</span>))
  60. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  61. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">destination_buffer</span>)
  62. .<span class="ident">build</span>()<span class="question-mark">?</span>;</pre>
  63. <p>Re-use and clone:</p>
  64. <div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><pre class="rust rust-example-rendered ignore">
  65. <span class="comment">// Create a builder for re-use:</span>
  66. <span class="kw">let</span> <span class="ident">builder</span> <span class="op">=</span> <span class="ident">Kernel</span>::<span class="ident">builder</span>()
  67. .<span class="ident">program</span>(<span class="kw-2">&amp;</span><span class="ident">program</span>)
  68. .<span class="ident">name</span>(<span class="string">&quot;process&quot;</span>)
  69. .<span class="ident">queue</span>(<span class="ident">queue</span>.<span class="ident">clone</span>())
  70. .<span class="ident">global_work_size</span>([<span class="number">512</span>, <span class="number">64</span>, <span class="number">64</span>])
  71. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span>(<span class="ident">patch_size</span> <span class="kw">as</span> <span class="ident">i32</span>))
  72. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  73. .<span class="ident">arg_named</span>(<span class="string">&quot;dest&quot;</span>, <span class="kw-2">&amp;</span><span class="ident">destination_buffer</span>);
  74. <span class="comment">// Create multiple kernels using the same builder:</span>
  75. <span class="kw">let</span> <span class="ident">kernel_0</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">build</span>()<span class="question-mark">?</span>;
  76. <span class="kw">let</span> <span class="ident">kernel_1</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">build</span>()<span class="question-mark">?</span>;
  77. <span class="comment">// Clone the builder:</span>
  78. <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">builder_clone</span> <span class="op">=</span> <span class="ident">builder</span>.<span class="ident">clone</span>();
  79. <span class="comment">// Modify a default parameter:</span>
  80. <span class="ident">builder_clone</span>.<span class="ident">global_work_size</span>([<span class="number">1024</span>, <span class="number">128</span>, <span class="number">128</span>]);
  81. <span class="comment">// Create another kernel using the cloned builder:</span>
  82. <span class="kw">let</span> <span class="ident">kernel_2</span> <span class="op">=</span> <span class="ident">builder_clone</span>.<span class="ident">build</span>()<span class="question-mark">?</span>;
  83. <span class="comment">// Modify one of the arguments using the created kernel directly</span>
  84. <span class="comment">// (arguments cannot be modified using the builder):</span>
  85. <span class="ident">kernel_2</span>.<span class="ident">set_arg</span>(<span class="string">&quot;dest&quot;</span>, <span class="kw-2">&amp;</span><span class="ident">alternate_destination_buffer</span>)<span class="question-mark">?</span>;
  86. <span class="comment">// Arguments can also be referred to by index:</span>
  87. <span class="ident">kernel_2</span>.<span class="ident">set_arg</span>(<span class="number">1</span>, <span class="kw-2">&amp;</span><span class="ident">alternate_source_buffer</span>)<span class="question-mark">?</span>;</pre>
  88. </div>
  89. <h2 id='methods' class='small-section-header'>
  90. Methods<a href='#methods' class='anchor'></a>
  91. </h2>
  92. <h3 id='impl' class='impl'><span class='in-band'><code>impl&lt;'b&gt; <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</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/kernel.rs.html#939-1448' title='goto source code'>[src]</a></span></h3>
  93. <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.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#941-954' title='goto source code'>[src]</a></span></h4>
  94. <div class='docblock'><p>Returns a new kernel builder.</p>
  95. </div><h4 id='method.program' class="method"><span id='program.v' class='invisible'><code>pub fn <a href='#method.program' class='fnname'>program</a>&lt;'s&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;program: &amp;'b <a class="struct" href="../../ocl/struct.Program.html" title="struct ocl::Program">Program</a><br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#957-960' title='goto source code'>[src]</a></span></h4>
  96. <div class='docblock'><p>Specifies a program object with a successfully built executable.</p>
  97. </div><h4 id='method.name' class="method"><span id='name.v' class='invisible'><code>pub fn <a href='#method.name' class='fnname'>name</a>&lt;'s, S&gt;(&amp;'s mut self, name: S) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <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;,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#964-968' title='goto source code'>[src]</a></span></h4>
  98. <div class='docblock'><p>Specifies a function name in the program declared with the <code>__kernel</code>
  99. qualifier (e.g. <code>__kernel void add_values(...</code>).</p>
  100. </div><h4 id='method.queue' class="method"><span id='queue.v' class='invisible'><code>pub fn <a href='#method.queue' class='fnname'>queue</a>&lt;'s&gt;(&amp;'s mut self, queue: <a class="struct" href="../../ocl/struct.Queue.html" title="struct ocl::Queue">Queue</a>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#976-979' title='goto source code'>[src]</a></span></h4>
  101. <div class='docblock'><p>Sets the default queue to be used by all subsequent enqueue commands
  102. unless otherwise changed (with <code>::set_default_queue</code>) or overridden
  103. (by <code>::cmd().queue(...)...</code>).</p>
  104. <p>The queue must be associated with a device associated with the
  105. kernel's program.</p>
  106. </div><h4 id='method.gwo' class="method"><span id='gwo.v' class='invisible'><code>pub fn <a href='#method.gwo' class='fnname'>gwo</a>&lt;'s, 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;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;gwo: D<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#986-989' title='goto source code'>[src]</a></span></h4>
  107. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18.0<p>: Use <code>::global_work_offset</code> instead.</p>
  108. </div></div><div class='docblock'><p>Sets the default global work offset.</p>
  109. <p>Used when enqueuing kernel commands. Superseded if specified while
  110. building a queue command with <code>::cmd</code>.</p>
  111. </div><h4 id='method.gws' class="method"><span id='gws.v' class='invisible'><code>pub fn <a href='#method.gws' class='fnname'>gws</a>&lt;'s, 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;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;gws: D<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#996-999' title='goto source code'>[src]</a></span></h4>
  112. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18.0<p>: Use <code>::global_work_size</code> instead.</p>
  113. </div></div><div class='docblock'><p>Sets the default global work size.</p>
  114. <p>Used when enqueuing kernel commands. Superseded if specified while
  115. building a queue command with <code>::cmd</code>.</p>
  116. </div><h4 id='method.lws' class="method"><span id='lws.v' class='invisible'><code>pub fn <a href='#method.lws' class='fnname'>lws</a>&lt;'s, 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;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;lws: D<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1006-1009' title='goto source code'>[src]</a></span></h4>
  117. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18.0<p>: Use <code>::local_work_size</code> instead.</p>
  118. </div></div><div class='docblock'><p>Sets the default local work size.</p>
  119. <p>Used when enqueuing kernel commands. Superseded if specified while
  120. building a queue command with <code>::cmd</code>.</p>
  121. </div><h4 id='method.global_work_offset' class="method"><span id='global_work_offset.v' class='invisible'><code>pub fn <a href='#method.global_work_offset' class='fnname'>global_work_offset</a>&lt;'s, 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;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;gwo: D<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1015-1018' title='goto source code'>[src]</a></span></h4>
  122. <div class='docblock'><p>Sets the default global work offset.</p>
  123. <p>Used when enqueuing kernel commands. Superseded if specified while
  124. building a queue command with <code>::cmd</code>.</p>
  125. </div><h4 id='method.global_work_size' class="method"><span id='global_work_size.v' class='invisible'><code>pub fn <a href='#method.global_work_size' class='fnname'>global_work_size</a>&lt;'s, 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;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;gws: D<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1024-1027' title='goto source code'>[src]</a></span></h4>
  126. <div class='docblock'><p>Sets the default global work size.</p>
  127. <p>Used when enqueuing kernel commands. Superseded if specified while
  128. building a queue command with <code>::cmd</code>.</p>
  129. </div><h4 id='method.local_work_size' class="method"><span id='local_work_size.v' class='invisible'><code>pub fn <a href='#method.local_work_size' class='fnname'>local_work_size</a>&lt;'s, 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;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;lws: D<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1033-1036' title='goto source code'>[src]</a></span></h4>
  130. <div class='docblock'><p>Sets the default local work size.</p>
  131. <p>Used when enqueuing kernel commands. Superseded if specified while
  132. building a queue command with <code>::cmd</code>.</p>
  133. </div><h4 id='method.arg' class="method"><span id='arg.v' class='invisible'><code>pub fn <a href='#method.arg' class='fnname'>arg</a>&lt;'s, T, A&gt;(&amp;'s mut self, arg: A) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;ArgValConverter&lt;'b, T&gt;&gt;,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1132-1137' title='goto source code'>[src]</a></span></h4>
  134. <div class='docblock'><p>Adds a new <code>Buffer</code>, <code>Image</code>, scalar, or vector argument to the
  135. kernel.</p>
  136. <p>The argument is added to the bottom of the argument order.</p>
  137. <h3 id="example" class="section-header"><a href="#example">Example</a></h3>
  138. <div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><pre class="rust rust-example-rendered ignore">
  139. <span class="kw">let</span> <span class="ident">kern</span> <span class="op">=</span> <span class="ident">ocl_pq</span>.<span class="ident">kernel_builder</span>(<span class="string">&quot;multiply_by_scalar&quot;</span>)
  140. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="number">100.0f32</span>)
  141. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  142. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">result_buffer</span>)
  143. .<span class="ident">build</span>()<span class="question-mark">?</span>;</pre>
  144. </div><h4 id='method.arg_buf' class="method"><span id='arg_buf.v' class='invisible'><code>pub fn <a href='#method.arg_buf' class='fnname'>arg_buf</a>&lt;'s, T, M&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;buffer: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'b </a>M<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;M: 'b + <a class="trait" href="../../ocl_core/types/abs/trait.AsMem.html" title="trait ocl_core::types::abs::AsMem">AsMem</a>&lt;T&gt; + <a class="trait" href="../../ocl_core/types/abs/trait.MemCmdAll.html" title="trait ocl_core::types::abs::MemCmdAll">MemCmdAll</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1144-1148' title='goto source code'>[src]</a></span></h4>
  145. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  146. </div></div><div class='docblock'><p>Adds a new argument to the kernel specifying the buffer object represented
  147. by 'buffer'.</p>
  148. <p>The argument is added to the bottom of the argument order.</p>
  149. </div><h4 id='method.arg_img' class="method"><span id='arg_img.v' class='invisible'><code>pub fn <a href='#method.arg_img' class='fnname'>arg_img</a>&lt;'s, T, M&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;image: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'b </a>M<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;M: 'b + <a class="trait" href="../../ocl_core/types/abs/trait.AsMem.html" title="trait ocl_core::types::abs::AsMem">AsMem</a>&lt;T&gt; + <a class="trait" href="../../ocl_core/types/abs/trait.MemCmdAll.html" title="trait ocl_core::types::abs::MemCmdAll">MemCmdAll</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1155-1159' title='goto source code'>[src]</a></span></h4>
  150. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  151. </div></div><div class='docblock'><p>Adds a new argument to the kernel specifying the image object represented
  152. by 'image'.</p>
  153. <p>The argument is added to the bottom of the argument order.</p>
  154. </div><h4 id='method.arg_smp' class="method"><span id='arg_smp.v' class='invisible'><code>pub fn <a href='#method.arg_smp' class='fnname'>arg_smp</a>&lt;'s&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;sampler: &amp;'b <a class="struct" href="../../ocl/struct.Sampler.html" title="struct ocl::Sampler">Sampler</a><br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1165-1168' title='goto source code'>[src]</a></span></h4>
  155. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_sampler instead.</p>
  156. </div></div><div class='docblock'><p>Adds a new argument to the kernel specifying the sampler object represented
  157. by 'sampler'. Argument is added to the bottom of the argument
  158. order.</p>
  159. </div><h4 id='method.arg_scl' class="method"><span id='arg_scl.v' class='invisible'><code>pub fn <a href='#method.arg_scl' class='fnname'>arg_scl</a>&lt;'s, T&gt;(&amp;'s mut self, scalar: T) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1174-1178' title='goto source code'>[src]</a></span></h4>
  160. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  161. </div></div><div class='docblock'><p>Adds a new argument specifying the value: <code>scalar</code>.</p>
  162. <p>The argument is added to the bottom of the argument order.</p>
  163. </div><h4 id='method.arg_vec' class="method"><span id='arg_vec.v' class='invisible'><code>pub fn <a href='#method.arg_vec' class='fnname'>arg_vec</a>&lt;'s, T&gt;(&amp;'s mut self, vector: T) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1184-1188' title='goto source code'>[src]</a></span></h4>
  164. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  165. </div></div><div class='docblock'><p>Adds a new argument specifying the value: <code>vector</code>.</p>
  166. <p>The argument is added to the bottom of the argument order.</p>
  167. </div><h4 id='method.arg_loc' class="method"><span id='arg_loc.v' class='invisible'><code>pub fn <a href='#method.arg_loc' class='fnname'>arg_loc</a>&lt;'s, T&gt;(&amp;'s mut self, length: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1198-1202' title='goto source code'>[src]</a></span></h4>
  168. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_local instead.</p>
  169. </div></div><div class='docblock'><p>Adds a new argument specifying the allocation of a local variable of size
  170. <code>length * sizeof(T)</code> bytes (builder_style).</p>
  171. <p>The argument is added to the bottom of the argument order.</p>
  172. <p>Local variables are used to share data between work items in the same
  173. workgroup.</p>
  174. </div><h4 id='method.arg_sampler' class="method"><span id='arg_sampler.v' class='invisible'><code>pub fn <a href='#method.arg_sampler' class='fnname'>arg_sampler</a>&lt;'s&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;sampler: &amp;'b <a class="struct" href="../../ocl/struct.Sampler.html" title="struct ocl::Sampler">Sampler</a><br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1207-1210' title='goto source code'>[src]</a></span></h4>
  175. <div class='docblock'><p>Adds a new argument to the kernel specifying the sampler object represented
  176. by 'sampler'. Argument is added to the bottom of the argument
  177. order.</p>
  178. </div><h4 id='method.arg_local' class="method"><span id='arg_local.v' class='invisible'><code>pub fn <a href='#method.arg_local' class='fnname'>arg_local</a>&lt;'s, T&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;length: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1219-1223' title='goto source code'>[src]</a></span></h4>
  179. <div class='docblock'><p>Adds a new argument specifying the allocation of a local variable of size
  180. <code>length * sizeof(T)</code> bytes (builder_style).</p>
  181. <p>The argument is added to the bottom of the argument order.</p>
  182. <p>Local variables are used to share data between work items in the same
  183. workgroup.</p>
  184. </div><h4 id='method.arg_named' class="method"><span id='arg_named.v' class='invisible'><code>pub fn <a href='#method.arg_named' class='fnname'>arg_named</a>&lt;'s, T, A&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;arg: A<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;A: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;ArgValConverter&lt;'b, T&gt;&gt;,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1252-1258' title='goto source code'>[src]</a></span></h4>
  185. <div class='docblock'><p>Adds a new <em>named</em> <code>Buffer</code>, <code>Image</code>, scalar, or vector argument to the
  186. kernel.</p>
  187. <p>The argument is added to the bottom of the argument order.</p>
  188. <p>To set a <code>Buffer</code> or <code>Image</code> argument to <code>None</code> (null), you must use a
  189. type annotation (e.g. <code>None::&lt;&amp;Buffer&lt;f32&gt;&gt;</code>). Scalar and vector
  190. arguments may not be null; use zero (e.g. <code>&amp;0</code>) instead.</p>
  191. <p>Named arguments can be modified later using <code>::set_arg()</code>.</p>
  192. <h3 id="example-1" class="section-header"><a href="#example-1">Example</a></h3>
  193. <div class='information'><div class='tooltip ignore'>ⓘ<span class='tooltiptext'>This example is not tested</span></div></div><pre class="rust rust-example-rendered ignore">
  194. <span class="comment">// Create a kernel with arguments corresponding to those in the kernel.</span>
  195. <span class="comment">// One argument will be &#39;named&#39;:</span>
  196. <span class="kw">let</span> <span class="ident">kern</span> <span class="op">=</span> <span class="ident">ocl_pq</span>.<span class="ident">kernel_builder</span>(<span class="string">&quot;multiply_by_scalar&quot;</span>)
  197. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">COEFF</span>)
  198. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  199. .<span class="ident">arg_named</span>(<span class="string">&quot;result&quot;</span>, <span class="prelude-val">None</span>::<span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">Buffer</span><span class="op">&lt;</span><span class="ident">f32</span><span class="op">&gt;&gt;</span>)
  200. .<span class="ident">build</span>()<span class="question-mark">?</span>;
  201. <span class="comment">// Set our named argument. The Option&lt;_&gt; wrapper is, well... optional:</span>
  202. <span class="ident">kern</span>.<span class="ident">set_arg</span>(<span class="string">&quot;result&quot;</span>, <span class="kw-2">&amp;</span><span class="ident">result_buffer</span>)<span class="question-mark">?</span>;
  203. <span class="comment">// We can also set arguments (named or not) by index:</span>
  204. <span class="ident">kern</span>.<span class="ident">set_arg</span>(<span class="number">2</span>, <span class="kw-2">&amp;</span><span class="ident">result_buffer</span>)<span class="question-mark">?</span>;</pre>
  205. </div><h4 id='method.arg_buf_named' class="method"><span id='arg_buf_named.v' class='invisible'><code>pub fn <a href='#method.arg_buf_named' class='fnname'>arg_buf_named</a>&lt;'s, T, M&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;buffer_opt: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'b </a>M&gt;<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;M: 'b + <a class="trait" href="../../ocl_core/types/abs/trait.AsMem.html" title="trait ocl_core::types::abs::AsMem">AsMem</a>&lt;T&gt; + <a class="trait" href="../../ocl_core/types/abs/trait.MemCmdAll.html" title="trait ocl_core::types::abs::MemCmdAll">MemCmdAll</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1267-1272' title='goto source code'>[src]</a></span></h4>
  206. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  207. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the buffer object represented by
  208. 'buffer'.</p>
  209. <p>The argument is added to the bottom of the argument order.</p>
  210. <p>Named arguments can be easily modified later using <code>::set_arg_buf_named()</code>.</p>
  211. </div><h4 id='method.arg_img_named' class="method"><span id='arg_img_named.v' class='invisible'><code>pub fn <a href='#method.arg_img_named' class='fnname'>arg_img_named</a>&lt;'s, T, M&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;image_opt: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;'b </a>M&gt;<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;M: 'b + <a class="trait" href="../../ocl_core/types/abs/trait.AsMem.html" title="trait ocl_core::types::abs::AsMem">AsMem</a>&lt;T&gt; + <a class="trait" href="../../ocl_core/types/abs/trait.MemCmdAll.html" title="trait ocl_core::types::abs::MemCmdAll">MemCmdAll</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1281-1286' title='goto source code'>[src]</a></span></h4>
  212. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  213. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the image object represented by
  214. 'image'.</p>
  215. <p>The argument is added to the bottom of the argument order.</p>
  216. <p>Named arguments can be easily modified later using <code>::set_arg_img_named()</code>.</p>
  217. </div><h4 id='method.arg_smp_named' class="method"><span id='arg_smp_named.v' class='invisible'><code>pub fn <a href='#method.arg_smp_named' class='fnname'>arg_smp_named</a>&lt;'s&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sampler_opt: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;'b <a class="struct" href="../../ocl/struct.Sampler.html" title="struct ocl::Sampler">Sampler</a>&gt;<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1295-1299' title='goto source code'>[src]</a></span></h4>
  218. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_sampler_named instead.</p>
  219. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the sampler object represented by
  220. 'sampler'.</p>
  221. <p>The argument is added to the bottom of the argument order.</p>
  222. <p>Named arguments can be easily modified later using <code>::set_arg_smp_named()</code>.</p>
  223. </div><h4 id='method.arg_scl_named' class="method"><span id='arg_scl_named.v' class='invisible'><code>pub fn <a href='#method.arg_scl_named' class='fnname'>arg_scl_named</a>&lt;'s, T&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;scalar: T<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1309-1314' title='goto source code'>[src]</a></span></h4>
  224. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  225. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the value: <code>scalar</code>.</p>
  226. <p>The argument is added to the bottom of the argument order.</p>
  227. <p>Scalar arguments may not be null, use zero (e.g. <code>&amp;0</code>) instead.</p>
  228. <p>Named arguments can be easily modified later using <code>::set_arg_scl_named()</code>.</p>
  229. </div><h4 id='method.arg_vec_named' class="method"><span id='arg_vec_named.v' class='invisible'><code>pub fn <a href='#method.arg_vec_named' class='fnname'>arg_vec_named</a>&lt;'s, T&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;vector: T<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>,&nbsp;</span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1324-1329' title='goto source code'>[src]</a></span></h4>
  230. <div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  231. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the value: <code>vector</code>.</p>
  232. <p>The argument is added to the bottom of the argument order.</p>
  233. <p>Vector arguments may not be null, use zero (e.g. <code>&amp;0</code>) instead.</p>
  234. <p>Named arguments can be easily modified later using <code>::set_arg_vec_named()</code>.</p>
  235. </div><h4 id='method.arg_sampler_named' class="method"><span id='arg_sampler_named.v' class='invisible'><code>pub fn <a href='#method.arg_sampler_named' class='fnname'>arg_sampler_named</a>&lt;'s&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;name: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;sampler_opt: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;'b <a class="struct" href="../../ocl/struct.Sampler.html" title="struct ocl::Sampler">Sampler</a>&gt;<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1337-1341' title='goto source code'>[src]</a></span></h4>
  236. <div class='docblock'><p>Adds a new <em>named</em> argument specifying the sampler object represented by
  237. 'sampler'.</p>
  238. <p>The argument is added to the bottom of the argument order.</p>
  239. <p>Named arguments can be easily modified later using <code>::set_arg_smp_named()</code>.</p>
  240. </div><h4 id='method.disable_mem_arg_retention' class="method"><span id='disable_mem_arg_retention.v' class='invisible'><code>pub unsafe fn <a href='#method.disable_mem_arg_retention' class='fnname'>disable_mem_arg_retention</a>&lt;'s&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1353-1356' title='goto source code'>[src]</a></span></h4>
  241. <div class='docblock'><p>Specifies whether or not to store a copy of memory objects (<code>Buffer</code>
  242. and <code>Image</code>).</p>
  243. <h3 id="safety" class="section-header"><a href="#safety">Safety</a></h3>
  244. <p>Disabling memory object argument retention can lead to a misleading
  245. error message or a difficult to debug segfault (depending on the
  246. platform) <em>if</em> a memory object is dropped before a kernel referring to
  247. it is enqueued. Only disable this if you are certain all of the memory
  248. objects set as kernel arguments will outlive the <code>Kernel</code> itself.</p>
  249. </div><h4 id='method.disable_arg_type_check' class="method"><span id='disable_arg_type_check.v' class='invisible'><code>pub unsafe fn <a href='#method.disable_arg_type_check' class='fnname'>disable_arg_type_check</a>&lt;'s&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;'s mut self<br>) -&gt; &amp;'s mut <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1366-1369' title='goto source code'>[src]</a></span></h4>
  250. <div class='docblock'><p>Disables argument type checking when setting arguments.</p>
  251. <p>Because the performance cost of argument type checking is negligible,
  252. disabling is not recommended.</p>
  253. <p>Argument type checking will automatically be disabled if any of the
  254. devices in use do not support OpenCL version 1.2 or higher or if
  255. argument information is not available on the associated platform.</p>
  256. </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.Kernel.html" title="struct ocl::Kernel">Kernel</a>&gt;</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#1372-1447' title='goto source code'>[src]</a></span></h4>
  257. <div class='docblock'><p>Builds and returns a new <code>Kernel</code></p>
  258. </div></div>
  259. <h2 id='implementations' class='small-section-header'>
  260. Trait Implementations<a href='#implementations' class='anchor'></a>
  261. </h2>
  262. <h3 id='impl-Debug' class='impl'><span class='in-band'><code>impl&lt;'b&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../ocl/builders/struct.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#925' title='goto source code'>[src]</a></span></h3>
  263. <div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/ocl/standard/kernel.rs.html#925' title='goto source code'>[src]</a></span></h4>
  264. <div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
  265. </div></div></section>
  266. <section id='search' class="content hidden"></section>
  267. <section class="footer"></section>
  268. <aside id="help" class="hidden">
  269. <div>
  270. <h1 class="hidden">Help</h1>
  271. <div class="shortcuts">
  272. <h2>Keyboard Shortcuts</h2>
  273. <dl>
  274. <dt><kbd>?</kbd></dt>
  275. <dd>Show this help dialog</dd>
  276. <dt><kbd>S</kbd></dt>
  277. <dd>Focus the search field</dd>
  278. <dt><kbd>↑</kbd></dt>
  279. <dd>Move up in search results</dd>
  280. <dt><kbd>↓</kbd></dt>
  281. <dd>Move down in search results</dd>
  282. <dt><kbd>↹</kbd></dt>
  283. <dd>Switch tab</dd>
  284. <dt><kbd>&#9166;</kbd></dt>
  285. <dd>Go to active search result</dd>
  286. <dt><kbd>+</kbd></dt>
  287. <dd>Expand all sections</dd>
  288. <dt><kbd>-</kbd></dt>
  289. <dd>Collapse all sections</dd>
  290. </dl>
  291. </div>
  292. <div class="infos">
  293. <h2>Search Tricks</h2>
  294. <p>
  295. Prefix searches with a type followed by a colon (e.g.
  296. <code>fn:</code>) to restrict the search to a given type.
  297. </p>
  298. <p>
  299. Accepted types are: <code>fn</code>, <code>mod</code>,
  300. <code>struct</code>, <code>enum</code>,
  301. <code>trait</code>, <code>type</code>, <code>macro</code>,
  302. and <code>const</code>.
  303. </p>
  304. <p>
  305. Search functions by type signature (e.g.
  306. <code>vec -> usize</code> or <code>* -> vec</code>)
  307. </p>
  308. </div>
  309. </div>
  310. </aside>
  311. <script>
  312. window.rootPath = "../../";
  313. window.currentCrate = "ocl";
  314. </script>
  315. <script src="../../main.js"></script>
  316. <script defer src="../../search-index.js"></script>
  317. </body>
  318. </html>