Library/ManagedCuda/CudaContext.cs
/// <summary>
/// Returns the version number of the installed cuda driver
/// </summary>
/// <returns>CUDA driver version</returns>
Returns the version number of the installed cuda driver
Returns the version number of the installed cuda driver
public static Version GetDriverVersion()
		{
			int driverVersion = 0;
			CUResult res = DriverAPINativeMethods.cuDriverGetVersion(ref driverVersion);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuDriverGetVersion", res));
			if (res == CUResult.ErrorNotInitialized)
			{
				res = DriverAPINativeMethods.cuInit(CUInitializationFlags.None);
				Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuInit", res));
				if (res != CUResult.Success)
					throw new CudaException(res);
				res = DriverAPINativeMethods.cuDriverGetVersion(ref driverVersion);
				Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuDriverGetVersion", res));
				if (res != CUResult.Success)
					throw new CudaException(res);
			}
			else if (res != CUResult.Success)
				throw new CudaException(res);
			return new Version(driverVersion / 1000, driverVersion % 100);
		}
public static Version GetDriverVersion ( ) { int driverVersion = 0 ; CUResult res = DriverAPINativeMethods . cuDriverGetVersion ( ref driverVersion ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res == CUResult . ErrorNotInitialized ) { res = DriverAPINativeMethods . cuInit ( CUInitializationFlags . None ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; res = DriverAPINativeMethods . cuDriverGetVersion ( ref driverVersion ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; } else if ( res != CUResult . Success ) throw new CudaException ( res ) ; return new Version ( driverVersion / 1000 , driverVersion % 100 ) ; }
Returns the version number of the installed cuda driver
Returns the version number of the installed cuda driver
CUDA driver version
CUDA driver version