lib.rs 1.6 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

20 21 22
//! This crate contains the refactored basic components required
//! for `runtime` and `frontend` TVM crates.

23
#![feature(box_syntax, type_alias_enum_variants, trait_alias)]
24 25

#[macro_use]
26
extern crate failure;
27 28 29 30 31

/// Unified ffi module for both runtime and frontend crates.
pub mod ffi {
    #![allow(non_camel_case_types, non_snake_case, non_upper_case_globals, unused)]

32
    use std::os::raw::{c_char, c_int, c_void};
33

34
    include!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/c_runtime_api.rs"));
35

36 37
    pub type BackendPackedCFunc =
        extern "C" fn(args: *const TVMValue, type_codes: *const c_int, num_args: c_int) -> c_int;
38 39
}

40
pub mod array;
41
pub mod errors;
42 43
#[macro_use]
pub mod packed_func;
44 45 46
pub mod value;

pub use errors::*;
47
pub use ffi::{TVMByteArray, TVMContext, TVMType};
48
pub use packed_func::{TVMArgValue, TVMRetValue};