Skip to main content

tvm_ffi/
lib.rs

1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements.  See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership.  The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License.  You may obtain a copy of the License at
9 *
10 *   http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied.  See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19pub mod any;
20pub mod collections;
21pub mod derive;
22pub mod device;
23pub mod dtype;
24pub mod error;
25pub mod extra;
26pub mod function;
27pub mod function_internal;
28pub mod macros;
29#[doc(hidden)]
30pub mod match_any_internal;
31pub mod object;
32pub mod optional;
33pub mod string;
34pub mod type_traits;
35pub use tvm_ffi_sys;
36
37pub use crate::any::{Any, AnyView};
38pub use crate::collections::array::Array;
39pub use crate::collections::map::Map;
40pub use crate::collections::shape::Shape;
41pub use crate::collections::tensor::{CPUNDAlloc, NDAllocator, Tensor};
42pub use crate::device::{current_stream, with_stream};
43pub use crate::dtype::DLDataTypeExt;
44pub use crate::error::{Error, ErrorKind, Result};
45pub use crate::error::{
46    ATTRIBUTE_ERROR, INDEX_ERROR, KEY_ERROR, RUNTIME_ERROR, TYPE_ERROR, VALUE_ERROR,
47};
48pub use crate::extra::module::Module;
49pub use crate::function::Function;
50pub use crate::object::ObjectRefCast;
51pub use crate::object::{Object, ObjectArc, ObjectCore, ObjectCoreWithExtraItems, ObjectRefCore};
52pub use crate::optional::Optional;
53pub use crate::string::{Bytes, String};
54pub use crate::type_traits::AnyCompatible;
55pub use tvm_ffi_macros::match_any;
56
57pub use tvm_ffi_sys::TVMFFITypeIndex as TypeIndex;
58pub use tvm_ffi_sys::{
59    DLDataType, DLDataTypeCode, DLDevice, DLDeviceType, TVMFFIAny, TVMFFIObject, TVMFFIStreamHandle,
60};