1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#![doc = include_str!("../README.md")]
pub mod common;
pub mod config;
pub mod ctypes;
mod predictor;
mod tensor;
pub mod utils;
use libloading::{library_filename, Library};
use once_cell::sync::Lazy;
pub use predictor::Predictor;
pub use tensor::Tensor;
static LIBRARY: Lazy<Library> = Lazy::new(|| unsafe {
Library::new(library_filename("paddle_inference_c")).expect("can't not load paddle_inference_c")
});
#[macro_export]
macro_rules! call {
($name: ident ( $( $args: expr ),* )) => {
unsafe {
use crate::ctypes::Function;
<$name>::get()( $($args),* )
}
};
}