Skip to content

Commit

Permalink
feat: Add all features to cargo.toml
Browse files Browse the repository at this point in the history
chore: cargo fmt and clippy fixes
chore: Cleanup some extra files
  • Loading branch information
uttarayan21 committed Nov 13, 2024
1 parent 827a7f2 commit 00131e1
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 12 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,3 @@ harness = false
[profile.rwd]
debug = true
inherits = "release"

[build-dependencies]
cc = "1.1.36"
9 changes: 6 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@
stableToolchainWithLLvmTools = pkgs.rust-bin.stable.latest.default.override {
extensions = ["rust-src" "llvm-tools"];
};
stableToolchainWithRustAnalyzer = pkgs.rust-bin.stable.latest.default.override {
extensions = ["rust-src" "rust-analyzer"];
};
stableToolchainWithRustAnalyzer = pkgs.rust-bin.stable.latest.default.override ({
extensions = ["rust-src" "rust-analyzer"];
}
// (lib.optionalAttrs pkgs.stdenv.isDarwin {
targets = ["aarch64-apple-darwin" "x86_64-apple-darwin"];
}));
craneLib = (crane.mkLib pkgs).overrideToolchain stableToolchain;
craneLibLLvmTools = (crane.mkLib pkgs).overrideToolchain stableToolchainWithLLvmTools;

Expand Down
6 changes: 6 additions & 0 deletions mnn-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ coreml = ["metal"]
opencl = []
openmp = []
opengl = []

mnn-threadpool = []

crt_static = []
mini-build = []
sparse-compute = []
arm82 = []
bf16 = []
cpu-weight-dequant-gemm = []
avx512 = []
neon = []
low-memory = []

default = ["mnn-threadpool", "sparse-compute", "opencl"]
3 changes: 1 addition & 2 deletions mnn-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ fn _main() -> Result<()> {
} else if *TARGET_OS == "linux" {
#[cfg(feature = "opencl")]
{
if !pkg_config::probe_library("OpenCL").is_ok() {
if pkg_config::probe_library("OpenCL").is_err() {
println!("cargo:rustc-link-lib=static=OpenCL");
};
}
Expand Down Expand Up @@ -822,7 +822,6 @@ fn x86_64<'a>(
.cpp(true)
.std("c++11")
.includes(includes)
// .cargo_warnings(false)
.files(mnn_sse_src)
.define("MNN_USE_SSE", None)
.tap_mut(|build| {
Expand Down
2 changes: 1 addition & 1 deletion mnn-sys/mnn_c/interpreter_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ const char *OperatorInfo_name(const void *op) {
const char *OperatorInfo_type(const void *op) {
return reinterpret_cast<const MNN::OperatorInfo *>(op)->type().c_str();
}
const float OperatorInfo_flops(const void *op) {
float OperatorInfo_flops(const void *op) {
return reinterpret_cast<const MNN::OperatorInfo *>(op)->flops();
}
} // extern "C"
2 changes: 1 addition & 1 deletion mnn-sys/mnn_c/interpreter_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const char *Interpreter_uuid(const Interpreter *interpreter);

const char *OperatorInfo_name(const void *op);
const char *OperatorInfo_type(const void *op);
const float OperatorInfo_flops(const void *op);
float OperatorInfo_flops(const void *op);

#ifdef __cplusplus
}
Expand Down
Empty file removed mnn-sys/mnn_c/mnndefine.h
Empty file.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub use ffi::MapType;
pub mod prelude {
pub use crate::error::*;
pub(crate) use crate::profile::profile;
pub use core::ffi::*;
pub use core::marker::PhantomData;
pub use error_stack::{Report, ResultExt};
pub use core::ffi::*;
}

0 comments on commit 00131e1

Please sign in to comment.