Skip to content
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

Add DYN_ARCH/USE_THREADS/USE_OPENMP features on linux #72

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions openblas-build/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,11 @@ impl Configure {
}
if self.use_thread {
args.push("USE_THREAD=1".into());
args.push("NUM_THREADS=256".into());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not certain if it’s necessary . After setting use_thread, will OpenBlas makefile script detect num_thread atomically?

}
if self.use_openmp {
args.push("USE_OPENMP=1".into());
args.push("NUM_THREADS=256".into());
}
if matches!(self.interface, Interface::ILP64) {
args.push("INTERFACE64=1".into());
Expand Down
3 changes: 3 additions & 0 deletions openblas-src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ cblas = []
lapacke = []
static = []
system = []
use_thread = []
use_openmp = []
dynamic_arch = []

[dev-dependencies]
libc = "0.2"
Expand Down
9 changes: 9 additions & 0 deletions openblas-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ fn build() {
cfg.compilers.hostcc = env::var("OPENBLAS_HOSTCC").ok();
cfg.compilers.fc = env::var("OPENBLAS_FC").ok();
cfg.compilers.ranlib = env::var("OPENBLAS_RANLIB").ok();
if feature_enabled("use_thread") {
cfg.use_thread = true;
}
if feature_enabled("use_openmp") {
cfg.use_openmp = true;
}
if feature_enabled("dynamic_arch") {
cfg.no_shared = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the variable name should be dynamic_arch. Additionally, please move these codes to line 145.

}

let output = if feature_enabled("cache") {
use std::hash::*;
Expand Down