Replies: 2 comments 4 replies
-
Hi, Thanks for using my splr. diff --git a/Cargo.toml b/Cargo.toml
index dffcc622..f4950ac0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,6 +15,7 @@ rust-version = "1.65"
[dependencies]
bitflags = "^2.4"
+instant = { version = "0.1", features = ["wasm-bindgen"], optional = true }
[features]
default = [
@@ -42,6 +43,9 @@ default = [
### For DEBUG
# "boundary_check",
# "maintain_watch_cache",
+
+ ### platform dependency
+ # "platform_wasm"
]
assign_rate = [] # for debug and study
best_phases_tracking = [] # save the best-so-far assignment, used by 'rephase'
@@ -62,6 +66,7 @@ just_used = [] # Var and clause have 'just_used' flags
LRB_rewarding = [] # Vearning Rate Based rewarding, a new var activity criteria
maintain_watch_cache = [] # for DEBUG
no_IO = [] # to embed Splr into non-std environments
+platform_wasm = ["instant"] # use instant::Duration instead of std::time::Duration
reason_side_rewarding = [] # an idea used in Learning-rate based rewarding
rephase = [ # search around the best-so-far candidate repeatedly
"best_phases_tracking", diff --git a/src/state.rs b/src/state.rs
index 2e130bba..b4eede46 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -1,4 +1,8 @@
/// Module `state` is a collection of internal data.
+#[cfg(feature = "platform_wasm")]
+use instant::{Duration, Instant};
+#[cfg(not(feature = "platform_wasm"))]
+use std::time::{Duration, Instant};
use {
crate::{
assign, cdb,
@@ -9,7 +13,6 @@ use {
fmt,
io::{stdout, Write},
ops::{Index, IndexMut},
- time::{Duration, Instant},
},
};
const PROGRESS_REPORT_ROWS: usize = 7; |
Beta Was this translation helpful? Give feedback.
3 replies
-
Published as 0.17.2. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I compiled your amazing tool to wasm:
https://github.com/nhatcher/splr-wasm
You can read here how I am using it on a project:
https://www.nhatcher.com/post/on-hats-and-sats/
I would love to make PR that targets wasm. Changes are fairly trivial, I wonder if that is interesting to you,
Nicolás
Beta Was this translation helpful? Give feedback.
All reactions