1#![doc = include_str!("../README.md")]
2#[cfg(feature = "serde")]
3#[cfg_attr(feature = "serde", macro_use)]
4extern crate serde;
5
6pub mod common;
7pub mod config;
8pub mod ctypes;
9mod predictor;
10mod tensor;
11pub mod utils;
12
13use libloading::{library_filename, Library};
14use once_cell::sync::Lazy;
15pub use predictor::Predictor;
16pub use tensor::Tensor;
17
18static LIBRARY: Lazy<Library> = Lazy::new(|| unsafe {
19 Library::new(library_filename("paddle_inference_c")).expect("can't not load paddle_inference_c")
20});
21
22#[macro_export]
38macro_rules! call {
39 ($name: ident ( $( $args: expr ),* )) => {
40 unsafe {
41 <$name as $crate::ctypes::Function>::get()( $($args),* )
42 }
43 };
44}