diff options
author | Edward Yang <ezyang@fb.com> | 2019-01-24 12:00:34 -0800 |
---|---|---|
committer | Facebook Github Bot <facebook-github-bot@users.noreply.github.com> | 2019-01-24 12:06:56 -0800 |
commit | e936a69085e0a0ae12032621d13ab70989929269 (patch) | |
tree | 03400d5751e73008af04a58652a9959fbf61b9f5 /torch/lib | |
parent | 24b50f14119f8077420222c2a3fba4300657b0d4 (diff) | |
download | pytorch-e936a69085e0a0ae12032621d13ab70989929269.tar.gz pytorch-e936a69085e0a0ae12032621d13ab70989929269.tar.bz2 pytorch-e936a69085e0a0ae12032621d13ab70989929269.zip |
Move THCCachingAllocator to c10_cuda. (#16119)
Summary:
Some renaming and renamespacing also took place. I was originally planning not to do anything, but it turns out that it was easier to make HIPify work by using a namespace CUDACachingAllocator:: rather than THCCachingAllocator_, since :: is a word boundary but _ is not.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16119
Reviewed By: smessmer
Differential Revision: D13718768
fbshipit-source-id: 884a481d99027fd3e34471c020f826aa12225656
Diffstat (limited to 'torch/lib')
-rw-r--r-- | torch/lib/THD/base/data_channels/DataChannelNccl.cpp | 8 | ||||
-rw-r--r-- | torch/lib/c10d/ProcessGroupNCCL.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/torch/lib/THD/base/data_channels/DataChannelNccl.cpp b/torch/lib/THD/base/data_channels/DataChannelNccl.cpp index 131b79cde6..bc211dd349 100644 --- a/torch/lib/THD/base/data_channels/DataChannelNccl.cpp +++ b/torch/lib/THD/base/data_channels/DataChannelNccl.cpp @@ -412,7 +412,7 @@ void DataChannelNccl::allReduce( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); NCCL_CHECK(ncclGroupStart()); for (size_t i = 0; i < data.size(); ++i) { @@ -468,7 +468,7 @@ void DataChannelNccl::allGather( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); NCCL_CHECK(ncclGroupStart()); for (size_t i = 0; i < input.size(); ++i) { @@ -525,7 +525,7 @@ void DataChannelNccl::reduce( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); NCCL_CHECK(ncclGroupStart()); for (size_t i = 0; i < data.size(); ++i) { @@ -584,7 +584,7 @@ void DataChannelNccl::broadcast( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); NCCL_CHECK(ncclGroupStart()); for (size_t i = 0; i < data.size(); ++i) { diff --git a/torch/lib/c10d/ProcessGroupNCCL.cpp b/torch/lib/c10d/ProcessGroupNCCL.cpp index dbf9807fd9..5031e6fd05 100644 --- a/torch/lib/c10d/ProcessGroupNCCL.cpp +++ b/torch/lib/c10d/ProcessGroupNCCL.cpp @@ -370,7 +370,7 @@ std::shared_ptr<ProcessGroup::Work> ProcessGroupNCCL::allreduce( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); C10D_NCCL_CHECK(ncclGroupStart()); @@ -417,7 +417,7 @@ std::shared_ptr<ProcessGroup::Work> ProcessGroupNCCL::broadcast( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); C10D_NCCL_CHECK(ncclGroupStart()); @@ -465,7 +465,7 @@ std::shared_ptr<ProcessGroup::Work> ProcessGroupNCCL::reduce( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); C10D_NCCL_CHECK(ncclGroupStart()); @@ -534,7 +534,7 @@ std::shared_ptr<ProcessGroup::Work> ProcessGroupNCCL::allgather( at::cuda::OptionalCUDAGuard gpuGuard; std::unique_lock<std::mutex> cudaFreeMutexLock( - *(at::cuda::THCCachingAllocator_getCudaFreeMutex())); + *(c10::cuda::CUDACachingAllocator::getFreeMutex())); C10D_NCCL_CHECK(ncclGroupStart()); |