Beispiel #1
0
        public static Context GpuContext(Gpu gpu, int streamId = 0)
        {
            var key = new GpuContextKey(gpu.Device.Id, streamId);

            return(GpuContexts.GetOrAdd(key, _ => new GpuContext(gpu)));
        }
Beispiel #2
0
        public static Context GpuContext(int deviceId, int streamId = 0)
        {
            var key = new GpuContextKey(deviceId, streamId);

            return(GpuContexts.GetOrAdd(key, _ => new GpuContext(Gpu.Get(deviceId))));
        }