open_cl_low_level/
lib.rs

1/// The opencl-low-level crate is the lowest level crate of opencl that provides
2/// functions that take common rust data structures (slice, vec, non-cl
3/// primitives) as arguments for OpenCL's FFI.
4///
5/// The *true* lowest level crate for opencl is opencl-sys, but that package is
6/// almost entirely a product of rust-bindgen.
7///
8/// Given the direct use of FFI in opencl-low-level and the fact that
9/// mismanagement of the lifetimes of the pointer objects returned by many
10/// OpenCL functions can easily lead to undefined behavior, there is a VERY
11/// LARGE CAVEAT for using opencl-low-level functions and data structure
12/// directly: KNOW WHAT YOU ARE DOING AND USE AT YOUR OWN RISK.
13///
14/// The pointers for OpenCL are all safe to send between threads, but neither
15/// OpenCL nor the opencl-low-level library (this lib) provide synchronization
16/// mechanism to protect Session from concurrent mutable access.
17
18/// Additionally, nearly all structs, functions, method, and traits in
19/// opencl-low-level are unsafe. The reasoning behind the, quite frankly,
20/// extreme amount of unsafe code in the low-level crate is the danger of
21/// working with raw pointers, manually managed atomic reference counting,
22/// pointer object lifetime interdependency, dangling pointers, buffer overflows,
23/// segmentation faults, shaky knees, sweaty palms, and self doubt...
24
25#[macro_use]
26extern crate lazy_static;
27#[macro_use]
28extern crate failure;
29#[macro_use]
30extern crate bitflags;
31
32extern crate num_complex;
33
34pub extern crate open_cl_sys as ffi;
35
36#[macro_use]
37pub mod ll_testing;
38#[macro_use]
39pub mod macros;
40#[macro_use]
41pub mod cl_number_type;
42pub mod cl_retain_release;
43pub mod cl_object;
44pub mod cl_bitflags;
45pub mod cl_enums;
46pub mod cl_helpers;
47pub mod cl_input;
48pub mod cl_number;
49pub mod cl_pointer;
50pub mod error;
51pub mod output;
52pub mod status_code;
53pub mod strings;
54pub mod utils;
55pub mod vec_or_slice;
56pub mod object_wrapper;
57
58pub mod command_queue;
59pub mod context;
60pub mod context_builder;
61pub mod device;
62
63pub mod dims;
64pub mod event;
65pub mod kernel;
66pub mod mem;
67pub mod platform;
68pub mod program;
69pub mod session;
70pub mod waitlist;
71pub mod work;
72
73pub use cl_number_type::*;
74pub use cl_retain_release::RetainRelease;
75pub use cl_object::{ClObject, CheckValidClObject};
76pub use cl_pointer::ClPointer;
77pub use error::Error;
78pub use output::{build_output, Output};
79pub use status_code::StatusCodeError;
80pub use vec_or_slice::{MutVecOrSlice, VecOrSlice};
81pub use object_wrapper::ObjectWrapper;
82
83pub use cl_bitflags::*;
84pub use cl_enums::*;
85pub use cl_input::*;
86pub use cl_number::ClNumber;
87
88pub use context::*;
89pub use context_builder::*;
90pub use device::*;
91pub use platform::*;
92
93pub use command_queue::*;
94pub use dims::*;
95pub use event::*;
96pub use kernel::*;
97pub use mem::*;
98pub use program::*;
99pub use session::*;
100pub use waitlist::*;
101pub use work::*;