GetCudaEnabledDeviceCount() public static method

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
return int
Ejemplo n.º 1
0
 private void ThrowIfNotAvailable()
 {
     if (disposed)
     {
         throw new ObjectDisposedException(GetType().Name);
     }
     if (Cv2Gpu.GetCudaEnabledDeviceCount() < 1)
     {
         throw new OpenCvSharpException("GPU module cannot be used.");
     }
 }
Ejemplo n.º 2
0
        /// <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.");
            }
        }