Skip to content

Commit

Permalink
Minor code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 authored Nov 1, 2019
1 parent af64bec commit 6299d70
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions NeuralNetwork.NET/cuDNN/CuDnnService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,10 @@ public static bool IsAvailable
// Calling this directly could cause a crash in the <Module> loader due to the missing .dll files
return CuDnnSupportHelper.IsGpuAccelerationSupported();
}
catch (Exception e)
catch (Exception e) when (e is FileNotFoundException || e is TypeInitializationException)
{
switch (e)
{
case TypeInitializationException _:
case FileNotFoundException _:
// Missing .dll file
return false;
default:
throw;
}
// Missing .dll file
return false;
}
}
}
Expand Down

0 comments on commit 6299d70

Please sign in to comment.