Skip to content

Commit

Permalink
feat: log single-multiexp kernel initialization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvank committed Jul 27, 2020
1 parent 68d5af7 commit 7ba375a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/gpu/multiexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,17 @@ where

let kernels: Vec<_> = devices
.iter()
.map(|d| SingleMultiexpKernel::<E>::create(*d, priority))
.filter(|res| res.is_ok())
.map(|res| res.unwrap())
.map(|d| (d, SingleMultiexpKernel::<E>::create(*d, priority)))
.filter_map(|(device, res)| {
if let Err(ref e) = res {
error!(
"Cannot initialize kernel for device '{}'! Error: {}",
device.name().unwrap_or("Unknown".into()),
e
);
}
res.ok()
})
.collect();

if kernels.is_empty() {
Expand Down

0 comments on commit 7ba375a

Please sign in to comment.