index.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  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 `ocl` crate."><meta name="keywords" content="rust, rustlang, rust-lang, ocl"><title>ocl - 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 mod"><!--[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'>Crate ocl</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'ocl', ty: 'mod', relpath: '../'};</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'>Crate <a class="mod" href=''>ocl</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/lib.rs.html#1-200' title='goto source code'>[src]</a></span></h1><div class='docblock'><h1 id="--github" class="section-header"><a href="#--github"><a href="https://crates.io/crates/ocl"><img src="http://meritbadge.herokuapp.com/ocl" alt="" /></a> | <a href="https://github.com/cogciprocate/ocl">GitHub</a></a></h1>
  2. <p>Rust implementation of the <a href="https://www.khronos.org/registry/OpenCL/">OpenCL™ API</a>.</p>
  3. <p>Some versions of this documentation are built from development branches
  4. and may differ slightly between what is on crates.io and the master
  5. branch. See the <a href="https://github.com/cogciprocate/ocl">repo page</a> for links
  6. to both versions.</p>
  7. <p>Please report unclear documentation or places where examples would be
  8. appreciated by filing an <a href="https://github.com/cogciprocate/ocl/issues">issue</a>.</p>
  9. <h2 id="foundations" class="section-header"><a href="#foundations">Foundations</a></h2>
  10. <p>For lower level interfaces and to use OpenCL features that have not yet
  11. been implemented on the <code>standard</code> (high-level) interface types, see the
  12. <a href="https://github.com/cogciprocate/ocl-core"><code>ocl-core</code></a> and <a href="https://github.com/cogciprocate/cl-sys"><code>cl-sys</code></a> crates.</p>
  13. <h2 id="help-wanted" class="section-header"><a href="#help-wanted">Help Wanted</a></h2>
  14. <p>Please request or help complete any functionality you may need by filing
  15. an <a href="https://github.com/cogciprocate/ocl/issues">issue</a> or creating a <a href="https://github.com/cogciprocate/ocl/pulls">pull
  16. request</a>.</p>
  17. <p>Keep an eye out for places where examples would be useful and let us know!</p>
  18. <h2 id="feedback-appreciated" class="section-header"><a href="#feedback-appreciated">Feedback appreciated</a></h2>
  19. <p>Suggestions and nitpicks are most welcome. Don't hesitate to file an
  20. <a href="https://github.com/cogciprocate/ocl/issues">issue</a> just to offer constructive criticism.</p>
  21. <p><br/>
  22. <em>“<code>OpenCL</code> and the <code>OpenCL</code> logo are trademarks of Apple Inc. used by permission by Khronos.”</em></p>
  23. </div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
  24. <table><tr><td><code>pub extern crate <a class="mod" href="../ocl_core/index.html" title="mod ocl_core">ocl_core</a> as core;</code></td></tr><tr><td><code>pub use error::<a class="struct" href="../ocl/error/struct.Error.html" title="struct ocl::error::Error">Error</a>;</code></td></tr><tr><td><code>pub use error::<a class="type" href="../ocl/error/type.Result.html" title="type ocl::error::Result">Result</a>;</code></td></tr><tr><td><code>pub use core::<a class="mod" href="../cl_sys/index.html" title="mod cl_sys">ffi</a>;</code></td></tr><tr><td><code>pub use core::<a class="mod" href="../ocl_core/util/index.html" title="mod ocl_core::util">util</a>;</code></td></tr><tr><td><code>pub use core::<a class="trait" href="../ocl/traits/trait.OclPrm.html" title="trait ocl::traits::OclPrm">OclPrm</a>;</code></td></tr><tr><td><code>pub use core::<a class="trait" href="../ocl/traits/trait.OclScl.html" title="trait ocl::traits::OclScl">OclScl</a>;</code></td></tr><tr><td><code>pub use core::<a class="trait" href="../ocl/traits/trait.OclVec.html" title="trait ocl::traits::OclVec">OclVec</a>;</code></td></tr><tr><td><code>pub use core::<a class="struct" href="../ocl/flags/struct.DeviceType.html" title="struct ocl::flags::DeviceType">DeviceType</a>;</code></td></tr><tr><td><code>pub use core::<a class="struct" href="../ocl/flags/struct.CommandQueueProperties.html" title="struct ocl::flags::CommandQueueProperties">CommandQueueProperties</a>;</code></td></tr><tr><td><code>pub use core::<a class="struct" href="../ocl/flags/struct.MemFlags.html" title="struct ocl::flags::MemFlags">MemFlags</a>;</code></td></tr><tr><td><code>pub use core::<a class="struct" href="../ocl/flags/struct.MapFlags.html" title="struct ocl::flags::MapFlags">MapFlags</a>;</code></td></tr></table><h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
  25. <table>
  26. <tr class=' module-item'>
  27. <td><a class="mod" href="async/index.html"
  28. title='mod ocl::async'>async</a></td>
  29. <td class='docblock-short'>
  30. <p>Types related to futures and asynchrony.</p>
  31. </td>
  32. </tr>
  33. <tr class=' module-item'>
  34. <td><a class="mod" href="builders/index.html"
  35. title='mod ocl::builders'>builders</a></td>
  36. <td class='docblock-short'>
  37. <p>Builders and associated settings-related types.</p>
  38. </td>
  39. </tr>
  40. <tr class=' module-item'>
  41. <td><a class="mod" href="enums/index.html"
  42. title='mod ocl::enums'>enums</a></td>
  43. <td class='docblock-short'>
  44. <p>Enumerators for settings and information requests.</p>
  45. </td>
  46. </tr>
  47. <tr class=' module-item'>
  48. <td><a class="mod" href="error/index.html"
  49. title='mod ocl::error'>error</a></td>
  50. <td class='docblock-short'>
  51. <p>Standard error type for ocl futures.</p>
  52. </td>
  53. </tr>
  54. <tr class=' module-item'>
  55. <td><a class="mod" href="flags/index.html"
  56. title='mod ocl::flags'>flags</a></td>
  57. <td class='docblock-short'>
  58. <p>Bitflags for various parameter types.</p>
  59. </td>
  60. </tr>
  61. <tr class=' module-item'>
  62. <td><a class="mod" href="prm/index.html"
  63. title='mod ocl::prm'>prm</a></td>
  64. <td class='docblock-short'>
  65. <p>OpenCL scalar and vector primitive types.</p>
  66. </td>
  67. </tr>
  68. <tr class=' module-item'>
  69. <td><a class="mod" href="traits/index.html"
  70. title='mod ocl::traits'>traits</a></td>
  71. <td class='docblock-short'>
  72. <p>Commonly used traits.</p>
  73. </td>
  74. </tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
  75. <table>
  76. <tr class=' module-item'>
  77. <td><a class="struct" href="struct.Buffer.html"
  78. title='struct ocl::Buffer'>Buffer</a></td>
  79. <td class='docblock-short'>
  80. <p>A chunk of memory physically located on a device, such as a GPU.</p>
  81. </td>
  82. </tr>
  83. <tr class=' module-item'>
  84. <td><a class="struct" href="struct.Context.html"
  85. title='struct ocl::Context'>Context</a></td>
  86. <td class='docblock-short'>
  87. <p>A context for a particular platform and set of device types.</p>
  88. </td>
  89. </tr>
  90. <tr class=' module-item'>
  91. <td><a class="struct" href="struct.Device.html"
  92. title='struct ocl::Device'>Device</a></td>
  93. <td class='docblock-short'>
  94. <p>An individual device identifier (an OpenCL device_id).</p>
  95. </td>
  96. </tr>
  97. <tr class=' module-item'>
  98. <td><a class="struct" href="struct.Event.html"
  99. title='struct ocl::Event'>Event</a></td>
  100. <td class='docblock-short'>
  101. <p>An event representing a command or user created event.</p>
  102. </td>
  103. </tr>
  104. <tr class=' module-item'>
  105. <td><a class="struct" href="struct.EventArray.html"
  106. title='struct ocl::EventArray'>EventArray</a></td>
  107. <td class='docblock-short'>
  108. <p>A list of events for coordinating enqueued commands.</p>
  109. </td>
  110. </tr>
  111. <tr class=' module-item'>
  112. <td><a class="struct" href="struct.EventList.html"
  113. title='struct ocl::EventList'>EventList</a></td>
  114. <td class='docblock-short'>
  115. <p>A list of events for coordinating enqueued commands.</p>
  116. </td>
  117. </tr>
  118. <tr class=' module-item'>
  119. <td><a class="struct" href="struct.Extensions.html"
  120. title='struct ocl::Extensions'>Extensions</a></td>
  121. <td class='docblock-short'>
  122. <p>Extensions of a platform.</p>
  123. </td>
  124. </tr>
  125. <tr class=' module-item'>
  126. <td><a class="struct" href="struct.FutureMemMap.html"
  127. title='struct ocl::FutureMemMap'>FutureMemMap</a></td>
  128. <td class='docblock-short'>
  129. <p>A future which resolves to a <code>MemMap</code> as soon as its creating command
  130. completes.</p>
  131. </td>
  132. </tr>
  133. <tr class=' module-item'>
  134. <td><a class="struct" href="struct.Image.html"
  135. title='struct ocl::Image'>Image</a></td>
  136. <td class='docblock-short'>
  137. <p>A section of device memory which represents one or many images.</p>
  138. </td>
  139. </tr>
  140. <tr class=' module-item'>
  141. <td><a class="struct" href="struct.Kernel.html"
  142. title='struct ocl::Kernel'>Kernel</a></td>
  143. <td class='docblock-short'>
  144. <p>A kernel which represents a 'procedure'.</p>
  145. </td>
  146. </tr>
  147. <tr class=' module-item'>
  148. <td><a class="struct" href="struct.MemMap.html"
  149. title='struct ocl::MemMap'>MemMap</a></td>
  150. <td class='docblock-short'>
  151. <p>A view of memory mapped by <code>clEnqueueMap{...}</code>.</p>
  152. </td>
  153. </tr>
  154. <tr class=' module-item'>
  155. <td><a class="struct" href="struct.Platform.html"
  156. title='struct ocl::Platform'>Platform</a></td>
  157. <td class='docblock-short'>
  158. <p>A platform identifier.</p>
  159. </td>
  160. </tr>
  161. <tr class=' module-item'>
  162. <td><a class="struct" href="struct.ProQue.html"
  163. title='struct ocl::ProQue'>ProQue</a></td>
  164. <td class='docblock-short'>
  165. <p>An all-in-one chimera of the <code>Program</code>, <code>Queue</code>, <code>Context</code> and
  166. (optionally) <code>SpatialDims</code> types.</p>
  167. </td>
  168. </tr>
  169. <tr class=' module-item'>
  170. <td><a class="struct" href="struct.Program.html"
  171. title='struct ocl::Program'>Program</a></td>
  172. <td class='docblock-short'>
  173. <p>A program from which kernels can be created from.</p>
  174. </td>
  175. </tr>
  176. <tr class=' module-item'>
  177. <td><a class="struct" href="struct.Queue.html"
  178. title='struct ocl::Queue'>Queue</a></td>
  179. <td class='docblock-short'>
  180. <p>A command queue which manages all actions taken on kernels, buffers, and
  181. images.</p>
  182. </td>
  183. </tr>
  184. <tr class=' module-item'>
  185. <td><a class="struct" href="struct.ReadGuard.html"
  186. title='struct ocl::ReadGuard'>ReadGuard</a></td>
  187. <td class='docblock-short'>
  188. <p>Allows access to the data contained within a lock just like a mutex guard.</p>
  189. </td>
  190. </tr>
  191. <tr class=' module-item'>
  192. <td><a class="struct" href="struct.RwVec.html"
  193. title='struct ocl::RwVec'>RwVec</a></td>
  194. <td class='docblock-short'>
  195. <p>A locking <code>Vec</code> which interoperates with OpenCL events and Rust futures to
  196. provide exclusive access to data.</p>
  197. </td>
  198. </tr>
  199. <tr class=' module-item'>
  200. <td><a class="struct" href="struct.Sampler.html"
  201. title='struct ocl::Sampler'>Sampler</a></td>
  202. <td class='docblock-short'>
  203. <p>An image sampler used to process images.</p>
  204. </td>
  205. </tr>
  206. <tr class=' module-item'>
  207. <td><a class="struct" href="struct.WriteGuard.html"
  208. title='struct ocl::WriteGuard'>WriteGuard</a></td>
  209. <td class='docblock-short'>
  210. <p>Allows access to the data contained within just like a mutex guard.</p>
  211. </td>
  212. </tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
  213. <table>
  214. <tr class=' module-item'>
  215. <td><a class="enum" href="enum.BufferCmdError.html"
  216. title='enum ocl::BufferCmdError'>BufferCmdError</a></td>
  217. <td class='docblock-short'>
  218. <p>A buffer command error.</p>
  219. </td>
  220. </tr>
  221. <tr class=' module-item'>
  222. <td><a class="enum" href="enum.SpatialDims.html"
  223. title='enum ocl::SpatialDims'>SpatialDims</a></td>
  224. <td class='docblock-short'>
  225. <p>Specifies a size or offset in up to three dimensions.</p>
  226. </td>
  227. </tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
  228. <table>
  229. <tr class=' module-item'>
  230. <td><a class="type" href="type.FutureReadGuard.html"
  231. title='type ocl::FutureReadGuard'>FutureReadGuard</a></td>
  232. <td class='docblock-short'>
  233. </td>
  234. </tr>
  235. <tr class=' module-item'>
  236. <td><a class="type" href="type.FutureWriteGuard.html"
  237. title='type ocl::FutureWriteGuard'>FutureWriteGuard</a></td>
  238. <td class='docblock-short'>
  239. </td>
  240. </tr></table></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>