onednn_src/
lib.rs

1// lib.rs
2//
3// Copyright (c) 2025 Junpei Kawamoto
4//
5// This software is released under the MIT License.
6//
7// http://opensource.org/licenses/mit-license.php
8
9//! This crate provides the source build of
10//! [oneAPI Deep Neural Network Library (oneDNN)](https://!github.com/uxlfoundation/oneDNN) for Rust projects.
11//!
12//! ## Usage
13//!
14//! Add this crate to your `Cargo.toml`:
15//!
16//! ```toml
17//! [dependencies]
18//! onednn-src = "0.1.2"
19//! ```
20//!
21//! Then, add the extern declaration to your `main.rs` or `lib.rs` to ensure the libraries are properly linked:
22//!
23//! ```rust
24//! extern crate onednn_src;
25//! ```
26//!
27//! This crate also exports the `DEP_DNNL_ROOT` environment variable,
28//! which points to the root directory of the compiled oneDNN library.
29//! You can use this in your `build.rs` to locate the library.
30//!
31//! ## Features
32//!
33//! - `graph`: Enables the graph component.
34//! - `training`: Enables training functionality.
35//! - `inference`: Enables inference functionality.
36//! - `experimental`: Enables [experimental features](https://!uxlfoundation.github.io/oneDNN/dev_guide_experimental.html#doxid-dev-guide-experimental)
37//! - `verbose`: Enables [verbose mode](https://!uxlfoundation.github.io/oneDNN/dev_guide_verbose.html#doxid-dev-guide-verbose)
38//!
39//! By default, the `training` feature is enabled.
40//! The `training` and `inference` features are mutually exclusive.
41//! If neither is specified, `training` will be used.
42
43#![no_std]