summaryrefslogtreecommitdiff
path: root/src/solvers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/gpu')
-rw-r--r--src/solvers/gpu/output.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/solvers/gpu/output.rs b/src/solvers/gpu/output.rs
index 9030586..4e52ab4 100644
--- a/src/solvers/gpu/output.rs
+++ b/src/solvers/gpu/output.rs
@@ -7,6 +7,7 @@ struct InBuffer {
receiver: Receiver<Message>,
row_requests: HashMap<u64, Vec<Vec<u32>>>,
results_requests: HashMap<u64, ResultMessage>,
+ banned_requests: HashSet<u64>,
}
impl InBuffer {
@@ -15,6 +16,7 @@ impl InBuffer {
receiver,
row_requests: HashMap::new(),
results_requests: HashMap::new(),
+ banned_requests: HashSet::new(),
}
}
fn read(&mut self) -> Option<Vec<RowResult>> {
@@ -34,10 +36,17 @@ impl InBuffer {
result_walls,
));
} else {
- self.results_requests.insert(results.id, results);
+ if results.data.iter().any(|x| *x != 0) {
+ self.results_requests.insert(results.id, results);
+ } else {
+ self.banned_requests.insert(results.id);
+ }
}
}
Message::OutputMessage((id, output)) => {
+ if self.banned_requests.remove(&id) {
+ continue;
+ }
if let Some(results) = self.results_requests.get(&id) {
return Some(Self::calc_results(
results.valid_walls().as_ref(),