index.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  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 `ocl` crate.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, ocl">
  9. <title>ocl - 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 mod">
  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'>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>
  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'>Crate <a class="mod" href=''>ocl</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/lib.rs.html#1-200' title='goto source code'>[src]</a></span></h1>
  50. <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>
  51. <p>Rust implementation of the <a href="https://www.khronos.org/registry/OpenCL/">OpenCL™ API</a>.</p>
  52. <p>Some versions of this documentation are built from development branches
  53. and may differ slightly between what is on crates.io and the master
  54. branch. See the <a href="https://github.com/cogciprocate/ocl">repo page</a> for links
  55. to both versions.</p>
  56. <p>Please report unclear documentation or places where examples would be
  57. appreciated by filing an <a href="https://github.com/cogciprocate/ocl/issues">issue</a>.</p>
  58. <h2 id="foundations" class="section-header"><a href="#foundations">Foundations</a></h2>
  59. <p>For lower level interfaces and to use OpenCL features that have not yet
  60. been implemented on the <code>standard</code> (high-level) interface types, see the
  61. <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>
  62. <h2 id="help-wanted" class="section-header"><a href="#help-wanted">Help Wanted</a></h2>
  63. <p>Please request or help complete any functionality you may need by filing
  64. an <a href="https://github.com/cogciprocate/ocl/issues">issue</a> or creating a <a href="https://github.com/cogciprocate/ocl/pulls">pull
  65. request</a>.</p>
  66. <p>Keep an eye out for places where examples would be useful and let us know!</p>
  67. <h2 id="feedback-appreciated" class="section-header"><a href="#feedback-appreciated">Feedback appreciated</a></h2>
  68. <p>Suggestions and nitpicks are most welcome. Don't hesitate to file an
  69. <a href="https://github.com/cogciprocate/ocl/issues">issue</a> just to offer constructive criticism.</p>
  70. <p><br/>
  71. <em>“<code>OpenCL</code> and the <code>OpenCL</code> logo are trademarks of Apple Inc. used by permission by Khronos.”</em></p>
  72. </div><h2 id='reexports' class='section-header'><a href="#reexports">Re-exports</a></h2>
  73. <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>
  74. <table>
  75. <tr class=' module-item'>
  76. <td><a class="mod" href="async/index.html"
  77. title='mod ocl::async'>async</a></td>
  78. <td class='docblock-short'>
  79. <p>Types related to futures and asynchrony.</p>
  80. </td>
  81. </tr>
  82. <tr class=' module-item'>
  83. <td><a class="mod" href="builders/index.html"
  84. title='mod ocl::builders'>builders</a></td>
  85. <td class='docblock-short'>
  86. <p>Builders and associated settings-related types.</p>
  87. </td>
  88. </tr>
  89. <tr class=' module-item'>
  90. <td><a class="mod" href="enums/index.html"
  91. title='mod ocl::enums'>enums</a></td>
  92. <td class='docblock-short'>
  93. <p>Enumerators for settings and information requests.</p>
  94. </td>
  95. </tr>
  96. <tr class=' module-item'>
  97. <td><a class="mod" href="error/index.html"
  98. title='mod ocl::error'>error</a></td>
  99. <td class='docblock-short'>
  100. <p>Standard error type for ocl futures.</p>
  101. </td>
  102. </tr>
  103. <tr class=' module-item'>
  104. <td><a class="mod" href="flags/index.html"
  105. title='mod ocl::flags'>flags</a></td>
  106. <td class='docblock-short'>
  107. <p>Bitflags for various parameter types.</p>
  108. </td>
  109. </tr>
  110. <tr class=' module-item'>
  111. <td><a class="mod" href="prm/index.html"
  112. title='mod ocl::prm'>prm</a></td>
  113. <td class='docblock-short'>
  114. <p>OpenCL scalar and vector primitive types.</p>
  115. </td>
  116. </tr>
  117. <tr class=' module-item'>
  118. <td><a class="mod" href="traits/index.html"
  119. title='mod ocl::traits'>traits</a></td>
  120. <td class='docblock-short'>
  121. <p>Commonly used traits.</p>
  122. </td>
  123. </tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
  124. <table>
  125. <tr class=' module-item'>
  126. <td><a class="struct" href="struct.Buffer.html"
  127. title='struct ocl::Buffer'>Buffer</a></td>
  128. <td class='docblock-short'>
  129. <p>A chunk of memory physically located on a device, such as a GPU.</p>
  130. </td>
  131. </tr>
  132. <tr class=' module-item'>
  133. <td><a class="struct" href="struct.Context.html"
  134. title='struct ocl::Context'>Context</a></td>
  135. <td class='docblock-short'>
  136. <p>A context for a particular platform and set of device types.</p>
  137. </td>
  138. </tr>
  139. <tr class=' module-item'>
  140. <td><a class="struct" href="struct.Device.html"
  141. title='struct ocl::Device'>Device</a></td>
  142. <td class='docblock-short'>
  143. <p>An individual device identifier (an OpenCL device_id).</p>
  144. </td>
  145. </tr>
  146. <tr class=' module-item'>
  147. <td><a class="struct" href="struct.Event.html"
  148. title='struct ocl::Event'>Event</a></td>
  149. <td class='docblock-short'>
  150. <p>An event representing a command or user created event.</p>
  151. </td>
  152. </tr>
  153. <tr class=' module-item'>
  154. <td><a class="struct" href="struct.EventArray.html"
  155. title='struct ocl::EventArray'>EventArray</a></td>
  156. <td class='docblock-short'>
  157. <p>A list of events for coordinating enqueued commands.</p>
  158. </td>
  159. </tr>
  160. <tr class=' module-item'>
  161. <td><a class="struct" href="struct.EventList.html"
  162. title='struct ocl::EventList'>EventList</a></td>
  163. <td class='docblock-short'>
  164. <p>A list of events for coordinating enqueued commands.</p>
  165. </td>
  166. </tr>
  167. <tr class=' module-item'>
  168. <td><a class="struct" href="struct.Extensions.html"
  169. title='struct ocl::Extensions'>Extensions</a></td>
  170. <td class='docblock-short'>
  171. <p>Extensions of a platform.</p>
  172. </td>
  173. </tr>
  174. <tr class=' module-item'>
  175. <td><a class="struct" href="struct.FutureMemMap.html"
  176. title='struct ocl::FutureMemMap'>FutureMemMap</a></td>
  177. <td class='docblock-short'>
  178. <p>A future which resolves to a <code>MemMap</code> as soon as its creating command
  179. completes.</p>
  180. </td>
  181. </tr>
  182. <tr class=' module-item'>
  183. <td><a class="struct" href="struct.Image.html"
  184. title='struct ocl::Image'>Image</a></td>
  185. <td class='docblock-short'>
  186. <p>A section of device memory which represents one or many images.</p>
  187. </td>
  188. </tr>
  189. <tr class=' module-item'>
  190. <td><a class="struct" href="struct.Kernel.html"
  191. title='struct ocl::Kernel'>Kernel</a></td>
  192. <td class='docblock-short'>
  193. <p>A kernel which represents a 'procedure'.</p>
  194. </td>
  195. </tr>
  196. <tr class=' module-item'>
  197. <td><a class="struct" href="struct.MemMap.html"
  198. title='struct ocl::MemMap'>MemMap</a></td>
  199. <td class='docblock-short'>
  200. <p>A view of memory mapped by <code>clEnqueueMap{...}</code>.</p>
  201. </td>
  202. </tr>
  203. <tr class=' module-item'>
  204. <td><a class="struct" href="struct.Platform.html"
  205. title='struct ocl::Platform'>Platform</a></td>
  206. <td class='docblock-short'>
  207. <p>A platform identifier.</p>
  208. </td>
  209. </tr>
  210. <tr class=' module-item'>
  211. <td><a class="struct" href="struct.ProQue.html"
  212. title='struct ocl::ProQue'>ProQue</a></td>
  213. <td class='docblock-short'>
  214. <p>An all-in-one chimera of the <code>Program</code>, <code>Queue</code>, <code>Context</code> and
  215. (optionally) <code>SpatialDims</code> types.</p>
  216. </td>
  217. </tr>
  218. <tr class=' module-item'>
  219. <td><a class="struct" href="struct.Program.html"
  220. title='struct ocl::Program'>Program</a></td>
  221. <td class='docblock-short'>
  222. <p>A program from which kernels can be created from.</p>
  223. </td>
  224. </tr>
  225. <tr class=' module-item'>
  226. <td><a class="struct" href="struct.Queue.html"
  227. title='struct ocl::Queue'>Queue</a></td>
  228. <td class='docblock-short'>
  229. <p>A command queue which manages all actions taken on kernels, buffers, and
  230. images.</p>
  231. </td>
  232. </tr>
  233. <tr class=' module-item'>
  234. <td><a class="struct" href="struct.ReadGuard.html"
  235. title='struct ocl::ReadGuard'>ReadGuard</a></td>
  236. <td class='docblock-short'>
  237. <p>Allows access to the data contained within a lock just like a mutex guard.</p>
  238. </td>
  239. </tr>
  240. <tr class=' module-item'>
  241. <td><a class="struct" href="struct.RwVec.html"
  242. title='struct ocl::RwVec'>RwVec</a></td>
  243. <td class='docblock-short'>
  244. <p>A locking <code>Vec</code> which interoperates with OpenCL events and Rust futures to
  245. provide exclusive access to data.</p>
  246. </td>
  247. </tr>
  248. <tr class=' module-item'>
  249. <td><a class="struct" href="struct.Sampler.html"
  250. title='struct ocl::Sampler'>Sampler</a></td>
  251. <td class='docblock-short'>
  252. <p>An image sampler used to process images.</p>
  253. </td>
  254. </tr>
  255. <tr class=' module-item'>
  256. <td><a class="struct" href="struct.WriteGuard.html"
  257. title='struct ocl::WriteGuard'>WriteGuard</a></td>
  258. <td class='docblock-short'>
  259. <p>Allows access to the data contained within just like a mutex guard.</p>
  260. </td>
  261. </tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
  262. <table>
  263. <tr class=' module-item'>
  264. <td><a class="enum" href="enum.BufferCmdError.html"
  265. title='enum ocl::BufferCmdError'>BufferCmdError</a></td>
  266. <td class='docblock-short'>
  267. <p>A buffer command error.</p>
  268. </td>
  269. </tr>
  270. <tr class=' module-item'>
  271. <td><a class="enum" href="enum.SpatialDims.html"
  272. title='enum ocl::SpatialDims'>SpatialDims</a></td>
  273. <td class='docblock-short'>
  274. <p>Specifies a size or offset in up to three dimensions.</p>
  275. </td>
  276. </tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
  277. <table>
  278. <tr class=' module-item'>
  279. <td><a class="type" href="type.FutureReadGuard.html"
  280. title='type ocl::FutureReadGuard'>FutureReadGuard</a></td>
  281. <td class='docblock-short'>
  282. </td>
  283. </tr>
  284. <tr class=' module-item'>
  285. <td><a class="type" href="type.FutureWriteGuard.html"
  286. title='type ocl::FutureWriteGuard'>FutureWriteGuard</a></td>
  287. <td class='docblock-short'>
  288. </td>
  289. </tr></table></section>
  290. <section id='search' class="content hidden"></section>
  291. <section class="footer"></section>
  292. <aside id="help" class="hidden">
  293. <div>
  294. <h1 class="hidden">Help</h1>
  295. <div class="shortcuts">
  296. <h2>Keyboard Shortcuts</h2>
  297. <dl>
  298. <dt><kbd>?</kbd></dt>
  299. <dd>Show this help dialog</dd>
  300. <dt><kbd>S</kbd></dt>
  301. <dd>Focus the search field</dd>
  302. <dt><kbd>↑</kbd></dt>
  303. <dd>Move up in search results</dd>
  304. <dt><kbd>↓</kbd></dt>
  305. <dd>Move down in search results</dd>
  306. <dt><kbd>↹</kbd></dt>
  307. <dd>Switch tab</dd>
  308. <dt><kbd>&#9166;</kbd></dt>
  309. <dd>Go to active search result</dd>
  310. <dt><kbd>+</kbd></dt>
  311. <dd>Expand all sections</dd>
  312. <dt><kbd>-</kbd></dt>
  313. <dd>Collapse all sections</dd>
  314. </dl>
  315. </div>
  316. <div class="infos">
  317. <h2>Search Tricks</h2>
  318. <p>
  319. Prefix searches with a type followed by a colon (e.g.
  320. <code>fn:</code>) to restrict the search to a given type.
  321. </p>
  322. <p>
  323. Accepted types are: <code>fn</code>, <code>mod</code>,
  324. <code>struct</code>, <code>enum</code>,
  325. <code>trait</code>, <code>type</code>, <code>macro</code>,
  326. and <code>const</code>.
  327. </p>
  328. <p>
  329. Search functions by type signature (e.g.
  330. <code>vec -> usize</code> or <code>* -> vec</code>)
  331. </p>
  332. </div>
  333. </div>
  334. </aside>
  335. <script>
  336. window.rootPath = "../";
  337. window.currentCrate = "ocl";
  338. </script>
  339. <script src="../main.js"></script>
  340. <script defer src="../search-index.js"></script>
  341. </body>
  342. </html>