/// <summary>
		/// Destroy all allocations and reset all state on the primary context
		/// <para/>
		/// Explicitly destroys and cleans up all resources associated with the current
		/// device in the current process.
		/// <para/>
		/// Note that it is responsibility of the calling function to ensure that no
		/// other module in the process is using the device any more. For that reason
		/// it is recommended to use ::cuDevicePrimaryCtxRelease() in most cases.
		/// However it is safe for other modules to call ::cuDevicePrimaryCtxRelease()
		/// even after resetting the device.
		/// </summary>
		/// <param name="device">Device for which primary context is destroyed</param>
		public static void Reset(CUdevice device)
		{
			CUResult res;
			res = DriverAPINativeMethods.ContextManagement.cuDevicePrimaryCtxReset(device);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuDevicePrimaryCtxReset", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
		}
Exemple #2
0
 public static extern CUResult cuDeviceTotalMem_v2(ref SizeT bytes, CUdevice dev);
Exemple #3
0
			public static extern CUResult cuDevicePrimaryCtxGetState(CUdevice dev, ref CUCtxFlags flags, ref int active);
Exemple #4
0
 public static extern CUResult cuDeviceCanAccessPeer(ref int canAccessPeer, CUdevice dev, CUdevice peerDev);
Exemple #5
0
 public static extern CUResult cuCtxCreate_v2(ref CUcontext pctx, CUCtxFlags flags, CUdevice dev);
Exemple #6
0
			public static extern CUResult cuDevicePrimaryCtxRetain(ref CUcontext pctx, CUdevice dev);
Exemple #7
0
 public static extern CUResult cuD3D9GetDevice(ref CUdevice pCudaDevice, string pszAdapterName);
Exemple #8
0
			public static extern CUResult cuDeviceGetByPCIBusId(ref CUdevice dev, byte[] pciBusId);
Exemple #9
0
 public static extern CUResult cuD3D11GetDevice(ref CUdevice device, IntPtr pAdapter);
Exemple #10
0
 public static extern CUResult cuD3D11CtxCreateOnDevice(ref CUcontext pCtx, CUCtxFlags flags, IntPtr pD3DDevice, CUdevice cudaDevice);
Exemple #11
0
 public static extern CUResult cuWGLGetDevice(ref CUdevice pDevice, IntPtr hGpu);
Exemple #12
0
 public static extern CUResult cuGLCtxCreate(ref CUcontext pCtx, CUCtxFlags Flags, CUdevice device);
Exemple #13
0
 public static extern CUResult cuGLGetDevices(ref uint pCudaDeviceCount, CUdevice[] pCudaDevices, uint cudaDeviceCount, CUGLDeviceList deviceList);
Exemple #14
0
 public static extern CUResult cuDeviceGetProperties(ref CUDeviceProperties prop, CUdevice dev);
Exemple #15
0
 public static extern CUResult cuD3D9CtxCreate(ref CUcontext pCtx, ref CUdevice pCudaDevice, CUCtxFlags Flags, IntPtr pD3DDevice);
Exemple #16
0
 public static extern CUResult cuDeviceGetAttribute(ref int pi, CUDeviceAttribute attrib, CUdevice dev);
Exemple #17
0
 public static extern CUResult cuMemAdvise(CUdeviceptr devPtr, SizeT count, CUmemAdvise advice, CUdevice device);
Exemple #18
0
			public static extern CUResult cuDeviceGetPCIBusId(byte[] pciBusId, int len, CUdevice dev);
Exemple #19
0
 public static extern CUResult cuMemPrefetchAsync(CUdeviceptr devPtr, SizeT count, CUdevice dstDevice, CUstream hStream);
Exemple #20
0
 public static extern CUResult cuCtxGetDevice(ref CUdevice device);
Exemple #21
0
 public static extern CUResult cuDeviceGetP2PAttribute(ref int value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice);
Exemple #22
0
			public static extern CUResult cuDevicePrimaryCtxSetFlags(CUdevice dev, CUCtxFlags flags);
Exemple #23
0
 public static extern CUResult cuDeviceGetName([Out] byte[] name, int len, CUdevice dev);
Exemple #24
0
			public static extern CUResult cuDevicePrimaryCtxReset(CUdevice dev);
Exemple #25
0
 public static extern CUResult cuDeviceComputeCapability(ref int major, ref int minor, CUdevice dev);
Exemple #26
0
 public static extern CUResult cuDeviceGet(ref CUdevice device, int ordinal);
		/// <summary>
		/// Get the state of the primary context<para/>
		/// Returns in flags the flags for the primary context of device, and in
		/// active whether it is active.  See ::cuDevicePrimaryCtxSetFlags for flag
		/// values.
		/// </summary>
		/// <param name="device">Device to get primary context flags for</param>
		/// <param name="flags">Pointer to store flags</param>
		/// <param name="active">Pointer to store context state</param>
		public static void GetState(CUdevice device, out CUCtxFlags flags, out bool active)
		{
			CUResult res;
			flags = new CUCtxFlags();
			int temp = 0;
			res = DriverAPINativeMethods.ContextManagement.cuDevicePrimaryCtxGetState(device, ref flags, ref temp);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuDevicePrimaryCtxGetState", res));
			if (res != CUResult.Success)
				throw new CudaException(res);
			active = temp == 1;
		}