From 8020fb6d2533977fca693a6364a7c897b4120630 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sat, 9 May 2026 18:37:24 +0200 Subject: [PATCH] CUDA support --- src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj | 35 +++++++++++++++++-- .../NumberRecognitionEngine.cs | 8 ++--- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj b/src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj index dab45a2..3b066e7 100644 --- a/src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj +++ b/src/AIFotoONLUS.Core/AIFotoONLUS.Core.csproj @@ -22,13 +22,44 @@ true false + + true + - - + + + + + + + + + + + + + + + + + <_CublasLtFragment0>$(NuGetPackageRoot)ntvlibs.cuda11.cublaslt64_11.runtime.win-x64.f00\11.8.0\fragments\win-x64\native\cublasLt64_11.dll.f00 + <_CublasLtFragment1>$(NuGetPackageRoot)ntvlibs.cuda11.cublaslt64_11.runtime.win-x64.f01\11.8.0\fragments\win-x64\native\cublasLt64_11.dll.f01 + <_CudnnCnnInferFragment0>$(NuGetPackageRoot)ntvlibs.cudnn.cuda11.cudnn_cnn_infer64_8.runtime.win-x64.f00\8.9.7.29\fragments\win-x64\native\cudnn_cnn_infer64_8.dll.f00 + <_CudnnCnnInferFragment1>$(NuGetPackageRoot)ntvlibs.cudnn.cuda11.cudnn_cnn_infer64_8.runtime.win-x64.f01\8.9.7.29\fragments\win-x64\native\cudnn_cnn_infer64_8.dll.f01 + + + + + + + + + + \ No newline at end of file diff --git a/src/AIFotoONLUS.Core/NumberRecognitionEngine.cs b/src/AIFotoONLUS.Core/NumberRecognitionEngine.cs index d6b2d25..e729141 100644 --- a/src/AIFotoONLUS.Core/NumberRecognitionEngine.cs +++ b/src/AIFotoONLUS.Core/NumberRecognitionEngine.cs @@ -166,13 +166,13 @@ namespace AIFotoONLUS.Core { if (useGpu) { - net.SetPreferableBackend(Backend.CUDA); - net.SetPreferableTarget(Target.CUDA); + net.SetPreferableBackend(Net.Backend.CUDA); + net.SetPreferableTarget(Net.Target.CUDA); return; } - net.SetPreferableBackend(Backend.OPENCV); - net.SetPreferableTarget(Target.CPU); + net.SetPreferableBackend(Net.Backend.OPENCV); + net.SetPreferableTarget(Net.Target.CPU); } private void ValidateGpuRuntime()