예제 #1
0
        public ComputeSession(string sessionID, Accelerator accelerator, ComputeHost host)
        {
            SessionID = sessionID;

            _stream = accelerator.CreateStream();
            _host   = host;
        }
예제 #2
0
        public async void Dispose()
        {
            _disposing = true;
            _isActive  = false; // do not allow any new computation.

            // the host will dispose of this stream
            _host?.ReturnSession(this);
            _host = null;

            bool computeFinished = await ComputeFinished();

            _stream?.Dispose();
            _stream = null;
            _display?.Dispose();
            _display = null;

            _area?.Dispose();
            _area = null;
            _output?.Dispose();
            _output           = null;
            mandelbrot_kernel = null;
        }