GetCudaEnabledDeviceCount() public static méthode

Returns the number of installed CUDA-enabled devices. Use this function before any other GPU functions calls. If OpenCV is compiled without GPU support, this function returns 0.
public static GetCudaEnabledDeviceCount ( ) : int
Résultat int
Exemple #1
0
 private void ThrowIfNotAvailable()
 {
     if (disposed)
     {
         throw new ObjectDisposedException(GetType().Name);
     }
     if (Cv2Gpu.GetCudaEnabledDeviceCount() < 1)
     {
         throw new OpenCvSharpException("GPU module cannot be used.");
     }
 }
        /// <summary>
        /// Checks whether the opencv_gpu*.dll includes CUDA support.
        /// </summary>
        protected void ThrowIfNotAvailable()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }
            if (Cv2Gpu.GetCudaEnabledDeviceCount() < 1)
            {
                throw new OpenCvSharpException("Your OpenCV DLL does not support GPU module.");
            }

            if (!IsGpuCompatible)
            {
                throw new OpenCvSharpException("The selected GPU device is not compatible.");
            }
        }