pytorch/test/cpp_extensions
Mike Ruberry 1003ccfa15 Creates CUDAContext (#9435)
Summary:
ezyang noticed that the CUDAStream files lived under ATen/ despite being CUDA-specific, and suggested porting them to ATen/cuda and exposing them with a new CUDAContext. This PR does that. It also:

- Moves ATen's CUDA-specific exceptions for ATen/cudnn to ATen/cuda for consistency
- Moves getDeviceProperties() and getCurrentCUDASparseHandle() to CUDAContext from CUDAHooks

The separation between CUDAContext and CUDAHooks is straightforward. Files that are in CUDA-only builds should rely on CUDAContext, while CUDAHooks is for runtime dispatch in files that can be included in CPU-only builds. A comment in CUDAContext.h explains this pattern. Acquiring device properties and CUDA-specific handles is something only done in builds with CUDA, for example, so I moved them from CUDAHooks to CUDAContext.

This PR will conflict with #9277 and I will merge with master after #9277 goes in.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/9435

Reviewed By: soumith

Differential Revision: D8917236

Pulled By: ezyang

fbshipit-source-id: 219718864234fdd21a2baff1dd3932ff289b5751
2018-07-20 12:56:15 -07:00
..
torch_test_cpp_extension Add support for dotted names in CPP Extensions (#6986) 2018-04-29 18:10:03 +02:00
cuda_extension.cpp Bring back C++ extension torch.h (#7310) 2018-05-05 14:06:27 -07:00
cuda_extension.cu Improve CUDA extension support (#5324) 2018-02-23 10:15:30 -05:00
cuda_extension_kernel.cu Improve CUDA extension support (#5324) 2018-02-23 10:15:30 -05:00
cuda_extension_kernel2.cu Improve CUDA extension support (#5324) 2018-02-23 10:15:30 -05:00
cudnn_extension.cpp Creates CUDAContext (#9435) 2018-07-20 12:56:15 -07:00
doubler.h Create ATen tensors via TensorOptions (#7869) 2018-06-16 00:40:35 -07:00
extension.cpp Create ATen tensors via TensorOptions (#7869) 2018-06-16 00:40:35 -07:00
jit_extension.cpp Bring back C++ extension torch.h (#7310) 2018-05-05 14:06:27 -07:00
jit_extension2.cpp Bring back C++ extension torch.h (#7310) 2018-05-05 14:06:27 -07:00
setup.py Add support for dotted names in CPP Extensions (#6986) 2018-04-29 18:10:03 +02:00