Ejemplo n.º 1
0
		/// <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);
		}
Ejemplo n.º 2
0
 public static extern CUResult cuDeviceTotalMem_v2(ref SizeT bytes, CUdevice dev);
Ejemplo n.º 3
0
			public static extern CUResult cuDevicePrimaryCtxGetState(CUdevice dev, ref CUCtxFlags flags, ref int active);
Ejemplo n.º 4
0
 public static extern CUResult cuDeviceCanAccessPeer(ref int canAccessPeer, CUdevice dev, CUdevice peerDev);
Ejemplo n.º 5
0
 public static extern CUResult cuCtxCreate_v2(ref CUcontext pctx, CUCtxFlags flags, CUdevice dev);
Ejemplo n.º 6
0
			public static extern CUResult cuDevicePrimaryCtxRetain(ref CUcontext pctx, CUdevice dev);
Ejemplo n.º 7
0
 public static extern CUResult cuD3D9GetDevice(ref CUdevice pCudaDevice, string pszAdapterName);
Ejemplo n.º 8
0
			public static extern CUResult cuDeviceGetByPCIBusId(ref CUdevice dev, byte[] pciBusId);
Ejemplo n.º 9
0
 public static extern CUResult cuD3D11GetDevice(ref CUdevice device, IntPtr pAdapter);
Ejemplo n.º 10
0
 public static extern CUResult cuD3D11CtxCreateOnDevice(ref CUcontext pCtx, CUCtxFlags flags, IntPtr pD3DDevice, CUdevice cudaDevice);
Ejemplo n.º 11
0
 public static extern CUResult cuWGLGetDevice(ref CUdevice pDevice, IntPtr hGpu);
Ejemplo n.º 12
0
 public static extern CUResult cuGLCtxCreate(ref CUcontext pCtx, CUCtxFlags Flags, CUdevice device);
Ejemplo n.º 13
0
 public static extern CUResult cuGLGetDevices(ref uint pCudaDeviceCount, CUdevice[] pCudaDevices, uint cudaDeviceCount, CUGLDeviceList deviceList);
Ejemplo n.º 14
0
 public static extern CUResult cuDeviceGetProperties(ref CUDeviceProperties prop, CUdevice dev);
Ejemplo n.º 15
0
 public static extern CUResult cuD3D9CtxCreate(ref CUcontext pCtx, ref CUdevice pCudaDevice, CUCtxFlags Flags, IntPtr pD3DDevice);
Ejemplo n.º 16
0
 public static extern CUResult cuDeviceGetAttribute(ref int pi, CUDeviceAttribute attrib, CUdevice dev);
Ejemplo n.º 17
0
 public static extern CUResult cuMemAdvise(CUdeviceptr devPtr, SizeT count, CUmemAdvise advice, CUdevice device);
Ejemplo n.º 18
0
			public static extern CUResult cuDeviceGetPCIBusId(byte[] pciBusId, int len, CUdevice dev);
Ejemplo n.º 19
0
 public static extern CUResult cuMemPrefetchAsync(CUdeviceptr devPtr, SizeT count, CUdevice dstDevice, CUstream hStream);
Ejemplo n.º 20
0
 public static extern CUResult cuCtxGetDevice(ref CUdevice device);
Ejemplo n.º 21
0
 public static extern CUResult cuDeviceGetP2PAttribute(ref int value, CUdevice_P2PAttribute attrib, CUdevice srcDevice, CUdevice dstDevice);
Ejemplo n.º 22
0
			public static extern CUResult cuDevicePrimaryCtxSetFlags(CUdevice dev, CUCtxFlags flags);
Ejemplo n.º 23
0
 public static extern CUResult cuDeviceGetName([Out] byte[] name, int len, CUdevice dev);
Ejemplo n.º 24
0
			public static extern CUResult cuDevicePrimaryCtxReset(CUdevice dev);
Ejemplo n.º 25
0
 public static extern CUResult cuDeviceComputeCapability(ref int major, ref int minor, CUdevice dev);
Ejemplo n.º 26
0
 public static extern CUResult cuDeviceGet(ref CUdevice device, int ordinal);
Ejemplo n.º 27
0
		/// <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;
		}