struct.KernelBuilder.html 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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 `KernelBuilder` struct in crate `ocl`."><meta name="keywords" content="rust, rustlang, rust-lang, KernelBuilder"><title>ocl::builders::KernelBuilder - 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 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><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: 'KernelBuilder', 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=''>KernelBuilder</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/kernel.rs.html#926-937' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct KernelBuilder&lt;'b&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>A kernel builder.</p>
  2. <h3 id="examples" class="section-header"><a href="#examples">Examples</a></h3>
  3. <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">
  4. <span class="comment">// Create a kernel:</span>
  5. <span class="kw">let</span> <span class="ident">kernel</span> <span class="op">=</span> <span class="ident">Kernel</span>::<span class="ident">builder</span>()
  6. .<span class="ident">program</span>(<span class="kw-2">&amp;</span><span class="ident">program</span>)
  7. .<span class="ident">name</span>(<span class="string">&quot;process&quot;</span>)
  8. .<span class="ident">queue</span>(<span class="ident">queue</span>.<span class="ident">clone</span>())
  9. .<span class="ident">global_work_size</span>(<span class="kw-2">&amp;</span><span class="ident">gws_patch_count</span>)
  10. .<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>))
  11. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  12. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">destination_buffer</span>)
  13. .<span class="ident">build</span>()<span class="question-mark">?</span>;</pre>
  14. <p>Re-use and clone:</p>
  15. <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">
  16. <span class="comment">// Create a builder for re-use:</span>
  17. <span class="kw">let</span> <span class="ident">builder</span> <span class="op">=</span> <span class="ident">Kernel</span>::<span class="ident">builder</span>()
  18. .<span class="ident">program</span>(<span class="kw-2">&amp;</span><span class="ident">program</span>)
  19. .<span class="ident">name</span>(<span class="string">&quot;process&quot;</span>)
  20. .<span class="ident">queue</span>(<span class="ident">queue</span>.<span class="ident">clone</span>())
  21. .<span class="ident">global_work_size</span>([<span class="number">512</span>, <span class="number">64</span>, <span class="number">64</span>])
  22. .<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>))
  23. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  24. .<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>);
  25. <span class="comment">// Create multiple kernels using the same builder:</span>
  26. <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>;
  27. <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>;
  28. <span class="comment">// Clone the builder:</span>
  29. <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>();
  30. <span class="comment">// Modify a default parameter:</span>
  31. <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>]);
  32. <span class="comment">// Create another kernel using the cloned builder:</span>
  33. <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>;
  34. <span class="comment">// Modify one of the arguments using the created kernel directly</span>
  35. <span class="comment">// (arguments cannot be modified using the builder):</span>
  36. <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>;
  37. <span class="comment">// Arguments can also be referred to by index:</span>
  38. <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>
  39. </div>
  40. <h2 id='methods' class='small-section-header'>
  41. Methods<a href='#methods' class='anchor'></a>
  42. </h2>
  43. <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.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</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/kernel.rs.html#939-1448' 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.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</a>&lt;'b&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a new kernel builder.</p>
  44. </div><h4 id='method.program' class="method"><span id='program.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Specifies a program object with a successfully built executable.</p>
  45. </div><h4 id='method.name' class="method"><span id='name.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Specifies a function name in the program declared with the <code>__kernel</code>
  46. qualifier (e.g. <code>__kernel void add_values(...</code>).</p>
  47. </div><h4 id='method.queue' class="method"><span id='queue.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the default queue to be used by all subsequent enqueue commands
  48. unless otherwise changed (with <code>::set_default_queue</code>) or overridden
  49. (by <code>::cmd().queue(...)...</code>).</p>
  50. <p>The queue must be associated with a device associated with the
  51. kernel's program.</p>
  52. </div><h4 id='method.gwo' class="method"><span id='gwo.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18.0<p>: Use <code>::global_work_offset</code> instead.</p>
  53. </div></div><div class='docblock'><p>Sets the default global work offset.</p>
  54. <p>Used when enqueuing kernel commands. Superseded if specified while
  55. building a queue command with <code>::cmd</code>.</p>
  56. </div><h4 id='method.gws' class="method"><span id='gws.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18.0<p>: Use <code>::global_work_size</code> instead.</p>
  57. </div></div><div class='docblock'><p>Sets the default global work size.</p>
  58. <p>Used when enqueuing kernel commands. Superseded if specified while
  59. building a queue command with <code>::cmd</code>.</p>
  60. </div><h4 id='method.lws' class="method"><span id='lws.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18.0<p>: Use <code>::local_work_size</code> instead.</p>
  61. </div></div><div class='docblock'><p>Sets the default local work size.</p>
  62. <p>Used when enqueuing kernel commands. Superseded if specified while
  63. building a queue command with <code>::cmd</code>.</p>
  64. </div><h4 id='method.global_work_offset' class="method"><span id='global_work_offset.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the default global work offset.</p>
  65. <p>Used when enqueuing kernel commands. Superseded if specified while
  66. building a queue command with <code>::cmd</code>.</p>
  67. </div><h4 id='method.global_work_size' class="method"><span id='global_work_size.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the default global work size.</p>
  68. <p>Used when enqueuing kernel commands. Superseded if specified while
  69. building a queue command with <code>::cmd</code>.</p>
  70. </div><h4 id='method.local_work_size' class="method"><span id='local_work_size.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Sets the default local work size.</p>
  71. <p>Used when enqueuing kernel commands. Superseded if specified while
  72. building a queue command with <code>::cmd</code>.</p>
  73. </div><h4 id='method.arg' class="method"><span id='arg.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a new <code>Buffer</code>, <code>Image</code>, scalar, or vector argument to the
  74. kernel.</p>
  75. <p>The argument is added to the bottom of the argument order.</p>
  76. <h3 id="example" class="section-header"><a href="#example">Example</a></h3>
  77. <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">
  78. <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>)
  79. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="number">100.0f32</span>)
  80. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  81. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">result_buffer</span>)
  82. .<span class="ident">build</span>()<span class="question-mark">?</span>;</pre>
  83. </div><h4 id='method.arg_buf' class="method"><span id='arg_buf.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  84. </div></div><div class='docblock'><p>Adds a new argument to the kernel specifying the buffer object represented
  85. by 'buffer'.</p>
  86. <p>The argument is added to the bottom of the argument order.</p>
  87. </div><h4 id='method.arg_img' class="method"><span id='arg_img.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  88. </div></div><div class='docblock'><p>Adds a new argument to the kernel specifying the image object represented
  89. by 'image'.</p>
  90. <p>The argument is added to the bottom of the argument order.</p>
  91. </div><h4 id='method.arg_smp' class="method"><span id='arg_smp.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_sampler instead.</p>
  92. </div></div><div class='docblock'><p>Adds a new argument to the kernel specifying the sampler object represented
  93. by 'sampler'. Argument is added to the bottom of the argument
  94. order.</p>
  95. </div><h4 id='method.arg_scl' class="method"><span id='arg_scl.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  96. </div></div><div class='docblock'><p>Adds a new argument specifying the value: <code>scalar</code>.</p>
  97. <p>The argument is added to the bottom of the argument order.</p>
  98. </div><h4 id='method.arg_vec' class="method"><span id='arg_vec.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg instead.</p>
  99. </div></div><div class='docblock'><p>Adds a new argument specifying the value: <code>vector</code>.</p>
  100. <p>The argument is added to the bottom of the argument order.</p>
  101. </div><h4 id='method.arg_loc' class="method"><span id='arg_loc.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_local instead.</p>
  102. </div></div><div class='docblock'><p>Adds a new argument specifying the allocation of a local variable of size
  103. <code>length * sizeof(T)</code> bytes (builder_style).</p>
  104. <p>The argument is added to the bottom of the argument order.</p>
  105. <p>Local variables are used to share data between work items in the same
  106. workgroup.</p>
  107. </div><h4 id='method.arg_sampler' class="method"><span id='arg_sampler.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a new argument to the kernel specifying the sampler object represented
  108. by 'sampler'. Argument is added to the bottom of the argument
  109. order.</p>
  110. </div><h4 id='method.arg_local' class="method"><span id='arg_local.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a new argument specifying the allocation of a local variable of size
  111. <code>length * sizeof(T)</code> bytes (builder_style).</p>
  112. <p>The argument is added to the bottom of the argument order.</p>
  113. <p>Local variables are used to share data between work items in the same
  114. workgroup.</p>
  115. </div><h4 id='method.arg_named' class="method"><span id='arg_named.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a new <em>named</em> <code>Buffer</code>, <code>Image</code>, scalar, or vector argument to the
  116. kernel.</p>
  117. <p>The argument is added to the bottom of the argument order.</p>
  118. <p>To set a <code>Buffer</code> or <code>Image</code> argument to <code>None</code> (null), you must use a
  119. type annotation (e.g. <code>None::&lt;&amp;Buffer&lt;f32&gt;&gt;</code>). Scalar and vector
  120. arguments may not be null; use zero (e.g. <code>&amp;0</code>) instead.</p>
  121. <p>Named arguments can be modified later using <code>::set_arg()</code>.</p>
  122. <h3 id="example-1" class="section-header"><a href="#example-1">Example</a></h3>
  123. <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">
  124. <span class="comment">// Create a kernel with arguments corresponding to those in the kernel.</span>
  125. <span class="comment">// One argument will be &#39;named&#39;:</span>
  126. <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>)
  127. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">COEFF</span>)
  128. .<span class="ident">arg</span>(<span class="kw-2">&amp;</span><span class="ident">source_buffer</span>)
  129. .<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>)
  130. .<span class="ident">build</span>()<span class="question-mark">?</span>;
  131. <span class="comment">// Set our named argument. The Option&lt;_&gt; wrapper is, well... optional:</span>
  132. <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>;
  133. <span class="comment">// We can also set arguments (named or not) by index:</span>
  134. <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>
  135. </div><h4 id='method.arg_buf_named' class="method"><span id='arg_buf_named.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  136. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the buffer object represented by
  137. 'buffer'.</p>
  138. <p>The argument is added to the bottom of the argument order.</p>
  139. <p>Named arguments can be easily modified later using <code>::set_arg_buf_named()</code>.</p>
  140. </div><h4 id='method.arg_img_named' class="method"><span id='arg_img_named.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  141. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the image object represented by
  142. 'image'.</p>
  143. <p>The argument is added to the bottom of the argument order.</p>
  144. <p>Named arguments can be easily modified later using <code>::set_arg_img_named()</code>.</p>
  145. </div><h4 id='method.arg_smp_named' class="method"><span id='arg_smp_named.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_sampler_named instead.</p>
  146. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the sampler object represented by
  147. 'sampler'.</p>
  148. <p>The argument is added to the bottom of the argument order.</p>
  149. <p>Named arguments can be easily modified later using <code>::set_arg_smp_named()</code>.</p>
  150. </div><h4 id='method.arg_scl_named' class="method"><span id='arg_scl_named.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  151. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the value: <code>scalar</code>.</p>
  152. <p>The argument is added to the bottom of the argument order.</p>
  153. <p>Scalar arguments may not be null, use zero (e.g. <code>&amp;0</code>) instead.</p>
  154. <p>Named arguments can be easily modified later using <code>::set_arg_scl_named()</code>.</p>
  155. </div><h4 id='method.arg_vec_named' class="method"><span id='arg_vec_named.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='stability'><div class='stab deprecated'>Deprecated since 0.18<p>: Use ::arg_named instead.</p>
  156. </div></div><div class='docblock'><p>Adds a new <em>named</em> argument specifying the value: <code>vector</code>.</p>
  157. <p>The argument is added to the bottom of the argument order.</p>
  158. <p>Vector arguments may not be null, use zero (e.g. <code>&amp;0</code>) instead.</p>
  159. <p>Named arguments can be easily modified later using <code>::set_arg_vec_named()</code>.</p>
  160. </div><h4 id='method.arg_sampler_named' class="method"><span id='arg_sampler_named.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds a new <em>named</em> argument specifying the sampler object represented by
  161. 'sampler'.</p>
  162. <p>The argument is added to the bottom of the argument order.</p>
  163. <p>Named arguments can be easily modified later using <code>::set_arg_smp_named()</code>.</p>
  164. </div><h4 id='method.disable_mem_arg_retention' class="method"><span id='disable_mem_arg_retention.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Specifies whether or not to store a copy of memory objects (<code>Buffer</code>
  165. and <code>Image</code>).</p>
  166. <h3 id="safety" class="section-header"><a href="#safety">Safety</a></h3>
  167. <p>Disabling memory object argument retention can lead to a misleading
  168. error message or a difficult to debug segfault (depending on the
  169. platform) <em>if</em> a memory object is dropped before a kernel referring to
  170. it is enqueued. Only disable this if you are certain all of the memory
  171. objects set as kernel arguments will outlive the <code>Kernel</code> itself.</p>
  172. </div><h4 id='method.disable_arg_type_check' class="method"><span id='disable_arg_type_check.v' class='invisible'><table class='table-display'><tbody><tr><td><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></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Disables argument type checking when setting arguments.</p>
  173. <p>Because the performance cost of argument type checking is negligible,
  174. disabling is not recommended.</p>
  175. <p>Argument type checking will automatically be disabled if any of the
  176. devices in use do not support OpenCL version 1.2 or higher or if
  177. argument information is not available on the associated platform.</p>
  178. </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.Kernel.html" title="struct ocl::Kernel">Kernel</a>&gt;</code></span></td><td><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></td></tr></tbody></table></span></h4><div class='docblock'><p>Builds and returns a new <code>Kernel</code></p>
  179. </div></div>
  180. <h2 id='implementations' class='small-section-header'>
  181. Trait Implementations<a href='#implementations' class='anchor'></a>
  182. </h2>
  183. <div id='implementations-list'><h3 id='impl-Debug' 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/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></td><td><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></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &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></td><td><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></td></tr></tbody></table></span></h4><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>
  184. </div></div></div>
  185. <h2 id='synthetic-implementations' class='small-section-header'>
  186. Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
  187. </h2>
  188. <div id='synthetic-implementations-list'>
  189. <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.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</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.KernelBuilder.html" title="struct ocl::builders::KernelBuilder">KernelBuilder</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>