public static Context GpuContext(Gpu gpu, int streamId = 0) { var key = new GpuContextKey(gpu.Device.Id, streamId); return(GpuContexts.GetOrAdd(key, _ => new GpuContext(gpu))); }
public static Context GpuContext(int deviceId, int streamId = 0) { var key = new GpuContextKey(deviceId, streamId); return(GpuContexts.GetOrAdd(key, _ => new GpuContext(Gpu.Get(deviceId)))); }