Skip to content

Commit 0a0c7e1

Browse files
authored
Make lambdaworks-gpu dep in lambdaworks-math optional (#465)
* Remove lambdaworks-gpu dep in lambdaworks-math * Re-add gpu dependency, but make it optional
1 parent fed84b1 commit 0a0c7e1

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

ensure-no_std/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ edition = "2021"
55

66

77
[dependencies]
8-
getrandom = { version = "0.2", features = ["js"] }
98
lambdaworks-math = { path = "../math", default-features = false }
10-
wee_alloc = "0.4.5"
119

1210
[profile.dev]
1311
panic = "abort"

ensure-no_std/src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,5 @@ fn panic(_info: &PanicInfo) -> ! {
1414
loop {}
1515
}
1616

17-
#[global_allocator]
18-
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
19-
2017
#[allow(unused_imports)]
21-
use {lambdaworks_math};
18+
use lambdaworks_math;

math/Cargo.toml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ license.workspace = true
88
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99

1010
[dependencies]
11-
rand = {version = "0.8.5", default-features = false}
12-
thiserror = "1.0.38"
11+
rand = { version = "0.8.5", default-features = false }
12+
thiserror = { version = "1.0.38", optional = true }
1313

1414
# rayon
1515
rayon = { version = "1.7.0", optional = true }
@@ -22,7 +22,7 @@ objc = { version = "0.2.7", optional = true }
2222
# cuda
2323
cudarc = { version = "0.9.7", optional = true }
2424

25-
lambdaworks-gpu.workspace = true
25+
lambdaworks-gpu = { workspace = true, optional = true }
2626

2727
[dev-dependencies]
2828
proptest = "1.1.0"
@@ -33,22 +33,21 @@ iai-callgrind.workspace = true
3333
[features]
3434
rayon = ["dep:rayon"]
3535
default = ["rayon", "std"]
36-
std = []
36+
std = ["dep:thiserror"]
3737

3838
# gpu
39-
metal = ["dep:metal", "dep:objc", "lambdaworks-gpu/metal"]
40-
cuda = ["dep:cudarc"]
39+
metal = [
40+
"dep:metal",
41+
"dep:objc",
42+
"dep:lambdaworks-gpu",
43+
"lambdaworks-gpu?/metal",
44+
]
45+
cuda = ["dep:cudarc", "dep:lambdaworks-gpu"]
4146

4247
[[bench]]
4348
name = "criterion_elliptic_curve"
4449
harness = false
4550

46-
# gpu
47-
metal = ["dep:metal", "dep:objc"]
48-
cuda = ["dep:cudarc"]
49-
50-
rayon = ["dep:rayon"]
51-
5251
[[bench]]
5352
name = "criterion_polynomial"
5453
harness = false

0 commit comments

Comments
 (0)