Don't call cudaStreamDestroy at destruction time (#15692)
authorDmytro Dzhulgakov <dzhulgakov@fb.com>
Fri, 11 Jan 2019 20:32:50 +0000 (12:32 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 11 Jan 2019 20:36:41 +0000 (12:36 -0800)
commit96ea2594d882fc177a6730c42cd3c266f9bb2a67
treeec895ed4216e06ea9f3faaa7638290bba6c9401b
parent726341fea77c737f68d82fe9c8eacf62dd95761e
Don't call cudaStreamDestroy at destruction time (#15692)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15692

It was leading to ocassional crashes with dynamically linked CUDA because runtime was already destroyed.

Also, unique_ptr<T[]> is more suitable than deque<T> for the purpose.

Reviewed By: Yangqing

Differential Revision: D13571988

fbshipit-source-id: 37eb26dfbe361c49160367b53f87bd037c6c0e46
c10/cuda/CUDAFunctions.h
c10/cuda/CUDAMacros.h
c10/cuda/CUDAStream.cpp
caffe2/contrib/nccl/cuda_nccl_op_gpu.cc
caffe2/core/common_gpu.h
caffe2/core/context_gpu.cu
caffe2/core/context_gpu.h
caffe2/core/cudnn_wrappers.h
caffe2/core/hip/miopen_wrapper.h