Move all Stream and Event Python implementation to C++ (#15937)
authorShen Li <shenli@fb.com>
Thu, 17 Jan 2019 15:22:42 +0000 (07:22 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 17 Jan 2019 15:29:22 +0000 (07:29 -0800)
commit24f4d3987ec643fe245608625cfbf8997c42e87e
tree5f5a30d0543877d67ce1eff2ffec63fc2bdadc79
parent1e425d1a47ab6292a592120e335fd51ca56d12b3
Move all Stream and Event Python implementation to C++ (#15937)

Summary:
1. Added `torch/csrc/cuda/Event.h` and `torch/csrc/cuda/Event.cpp` to bind Python Event class to C++ implementation.
2. Move all CUDA runtime invocations from `torch/cuda/streams.py` to C++
3. Added tests to cover Stream and Event APIs. ~(event IPC handle tests is introduced in #15974)~
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15937

Differential Revision: D13649001

Pulled By: mrshenli

fbshipit-source-id: 84ca58f35f6ba679a4ba33150ceba678d760d240
16 files changed:
aten/src/ATen/cuda/CUDAEvent.h
aten/src/ATen/test/cuda_stream_test.cpp
c10/cuda/CUDAStream.h
test/test_cuda.py
test/test_multiprocessing.py
tools/autograd/templates/python_variable_methods.cpp
torch/CMakeLists.txt
torch/csrc/Module.cpp
torch/csrc/cuda/Event.cpp [new file with mode: 0644]
torch/csrc/cuda/Event.h [new file with mode: 0644]
torch/csrc/cuda/Stream.cpp
torch/csrc/cuda/Stream.h
torch/csrc/cuda/THCP.h
torch/cuda/__init__.py
torch/cuda/streams.py
torch/multiprocessing/reductions.py