Skip to content

Commit

Permalink
Merge pull request #92 from dariooo512/master
Browse files Browse the repository at this point in the history
Adding catch case for handling FileNotFound exception when using dll from .NET Core
  • Loading branch information
Sergio0694 authored Nov 1, 2019
2 parents e1e7e34 + 6299d70 commit 1fe3211
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NeuralNetwork.NET/cuDNN/CuDnnService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Threading;
using Alea;
Expand Down Expand Up @@ -75,7 +76,7 @@ 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 (TypeInitializationException)
catch (Exception e) when (e is FileNotFoundException || e is TypeInitializationException)
{
// Missing .dll file
return false;
Expand Down

0 comments on commit 1fe3211

Please sign in to comment.