paddle_sys/lib.rs
1/*!
2Rust bindings for the Paddle Inference, the core inference engine for [PaddlePaddle].
3
4Based on PaddlePaddle 2.0.0-rc1.
5
6This library is intended to provide a low-level wrapper for functions, datatypes,
7and others in the Paddle Inference C language API. You may use it in
8applications that need to interact with Paddle Inference directly in Rust.
9
10## Bindings
11
12We use the [bindgen] tool to generate wrappers over the Paddle Inference C language
13header file and the [libloading] tool to load the pre-compiled library. So before you
14run your application, please ensure you have a pre-compiled library with the correct
15version and set the environment variables to let the linker could find it. An example
16of Linux is shown below.
17
18
19```
20export LD_LIBRARY_PATH=/path/to/paddle_lib:$LD_LIBRARY_PATH
21```
22
23## External Information
24
25The usage for this library is mostly like the stuff you do with Paddle Inference in C
26language. But it's in Rust, meaning that you would use some unsafe features and manage
27pointers and malloced memories. I sincerely hope that if there are developers who
28stand out to develop a safe wrapper based on this library. Let's make PaddlePaddle
29more prosperous!
30
31Demos are available on [paddle-sys-demo]. Any advice is welcomed.
32
33[PaddlePaddle]: https://github.com/PaddlePaddle/Paddle
34[bindgen]: https://github.com/rust-lang/rust-bindgen
35[libloading]: https://github.com/nagisa/rust_libloading
36[paddle-sys-demo]: https://github.com/KernelErr/paddle-sys-demo
37*/
38
39pub mod bindings;