public CUcontext GetCurrentContextV1() { CUcontext ctx = new CUcontext(); this.LastError = CUDADriver.cuCtxGetCurrent(ref ctx); return(ctx); }
public static CUcontext?TryGetCurrentContext() { CUcontext ctx = new CUcontext(); CUResult res = CUDADriver.cuCtxGetCurrent(ref ctx); if (res != CUResult.Success) { return(null); } return(ctx); }
public static CUcontext GetCurrentContext() { CUcontext ctx = new CUcontext(); CUResult res = CUDADriver.cuCtxGetCurrent(ref ctx); if (res != CUResult.Success) { throw new CUDAException(res); } return(ctx); }