Move CUDAGuard, CUDAStream and CUDAGuardImpl to c10/cuda (#14248)
authorEdward Yang <ezyang@fb.com>
Wed, 12 Dec 2018 19:19:03 +0000 (11:19 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 12 Dec 2018 19:24:26 +0000 (11:24 -0800)
commit2d485ffb17ebdec54b399df591e1da031e101d46
treee9e9208777a42581b3e31fe5f1a22702fc9ff5f1
parent9943cf2378a9919c576420a743ff96306512efe1
Move CUDAGuard, CUDAStream and CUDAGuardImpl to c10/cuda (#14248)

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

This diff also introduces a horrifying hack to override CUDA's DeviceGuardImpl
with a HIPGuardImplMasqueradingAsCUDA, to accommodate PyTorch's current
behavior of pretending CUDA is HIP when you build with ROCm enabled.

Reviewed By: bddppq

Differential Revision: D13145293

fbshipit-source-id: ee0e207b6fd132f0d435512957424a002d588f02
47 files changed:
aten/src/ATen/CMakeLists.txt
aten/src/ATen/cuda/CUDAContext.cpp
aten/src/ATen/cuda/CUDAContext.h
aten/src/ATen/cuda/CUDAEvent.h
aten/src/ATen/cuda/CUDAMultiStreamGuard.h
aten/src/ATen/hip/impl/HIPGuardImplMasqueradingAsCUDA.cpp [new file with mode: 0644]
aten/src/ATen/hip/impl/HIPGuardImplMasqueradingAsCUDA.h [new file with mode: 0644]
aten/src/ATen/miopen/Utils.h
aten/src/ATen/native/DispatchStub.h
aten/src/ATen/native/cuda/Copy.cu
aten/src/ATen/native/cuda/Resize.cuh
aten/src/ATen/test/cuda_stream_test.cpp
aten/src/THC/THCCachingAllocator.cpp
aten/src/THC/THCCachingAllocator.h
aten/src/THC/THCCachingHostAllocator.h
aten/src/THC/THCGeneral.cpp
aten/src/THC/THCGeneral.h.in
aten/src/THC/THCStream.cpp
c10/cuda/CMakeLists.txt
c10/cuda/CUDAGuard.h [moved from aten/src/ATen/cuda/CUDAGuard.h with 96% similarity]
c10/cuda/CUDAStream.cpp [moved from aten/src/ATen/cuda/CUDAStream.cpp with 98% similarity]
c10/cuda/CUDAStream.h [moved from aten/src/ATen/cuda/CUDAStream.h with 97% similarity]
c10/cuda/impl/CUDAGuardImpl.cpp [moved from aten/src/ATen/cuda/detail/CUDAGuardImpl.cpp with 58% similarity]
c10/cuda/impl/CUDAGuardImpl.h [moved from aten/src/ATen/cuda/detail/CUDAGuardImpl.h with 73% similarity]
c10/impl/InlineDeviceGuard.h
docs/cpp/source/Doxyfile
tools/amd_build/pyHIPIFY/cuda_to_hip_mappings.py
tools/amd_build/pyHIPIFY/hipify_python.py
tools/cwrap/plugins/AutoGPU.py
tools/cwrap/plugins/NNExtension.py
torch/csrc/autograd/engine.cpp
torch/csrc/autograd/profiler.cpp
torch/csrc/cuda/Stream.cpp
torch/csrc/cuda/comm.cpp
torch/csrc/cuda/nccl.cpp
torch/csrc/cuda/python_nccl.cpp
torch/csrc/distributed/c10d/ddp.cpp
torch/csrc/generic/StorageSharing.cpp
torch/csrc/jit/fuser/cuda/fused_kernel.cpp
torch/csrc/utils.h
torch/lib/THD/base/data_channels/DataChannelNccl.cpp
torch/lib/c10d/ProcessGroupGloo.cpp
torch/lib/c10d/ProcessGroupGloo.hpp
torch/lib/c10d/ProcessGroupNCCL.cpp
torch/lib/c10d/test/CUDATest.hpp
torch/lib/c10d/test/ProcessGroupGlooAsyncTest.cpp
torch/lib/c10d/test/ProcessGroupNCCLTest.cpp