Skip to content

Clippy fix in intel-mkl-tool #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions intel-mkl-tool/src/config.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ pub const VALID_CONFIGS: &[&str] = &[
];

/// How to link MKL
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LinkType {
Static,
Dynamic,
@@ -49,7 +49,7 @@ impl FromStr for LinkType {
///
/// Array index of some APIs in MKL are defined by `int` in C,
/// whose size is not fixed.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DataModel {
/// `long` and pointer are 64bit, i.e. `sizeof(int) == 4`
LP64,
@@ -84,7 +84,7 @@ impl FromStr for DataModel {
}

/// How to manage thread(s)
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Threading {
/// Use iomp5, Intel OpenMP runtime.
OpenMP,
@@ -121,7 +121,7 @@ impl FromStr for Threading {
/// Configuration for Intel MKL, e.g. `mkl-static-lp64-seq`
///
/// There are 2x2x2=8 combinations of [LinkType], [DataModel], and [Threading].
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub struct Config {
pub link: LinkType,
pub index_size: DataModel,
@@ -134,16 +134,6 @@ impl fmt::Display for Config {
}
}

impl Default for Config {
fn default() -> Self {
Config {
link: LinkType::default(),
index_size: DataModel::default(),
parallel: Threading::default(),
}
}
}

impl FromStr for Config {
type Err = anyhow::Error;
fn from_str(name: &str) -> Result<Self> {
7 changes: 2 additions & 5 deletions intel-mkl-tool/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
//! Helper crate of `build.rs` in intel-mkl-src crate.
//!
//! This crate is responsible for setup Intel MKL library
//! usable from Rust crate.
//!
//! - Find library from system.
//! - Download library as a container from OCI registry.
//! This crate is responsible for finding static or dynamic library
//! of Intel MKL installed in user system.
//!
mod config;