Skip to content

Commit

Permalink
Fix C2 Ambiguous namespace (#89534)
Browse files Browse the repository at this point in the history
Summary: cuda:: is a ambiguous namespace. Make it explicit c10::cuda

Differential Revision: D41469007
/caffe2/caffe2/core/context_gpu.cu(564): error: "caffe2::cuda" is ambiguous/caffe2/caffe2/core/context_gpu.cu(564): error: expected a ";"/caffe2/caffe2/core/context_gpu.cu(568): warning #12-D: parsing restarts here after previous syntax error
Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"/caffe2/caffe2/core/context_gpu.cu(569): error: "caffe2::cuda" is ambiguous/caffe2/caffe2/core/context_gpu.cu(628): error: "caffe2::cuda" is ambiguous
4 errors detected in the compilation of "/caffe2/caffe2/core/context_gpu.cu".

Pull Request resolved: #89534
Approved by: https://github.com/malfet
  • Loading branch information
xw285cornell authored and pytorchmergebot committed Dec 7, 2022
1 parent 56ab94d commit 50ec416
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions caffe2/core/context_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,12 @@ struct DefaultCUDAAllocator final : public at::Allocator {
// some models that are currently running with the thc
// allocator fit in memory. We will need to find some
// way of resolving this problem.
cuda::CUDAStreamGuard g(
c10::cuda::CUDAStreamGuard g(
Stream(
Stream::DEFAULT,
Device(kCUDA, CaffeCudaGetDevice())
));
ptr = cuda::CUDACachingAllocator::raw_alloc(nbytes);
ptr = c10::cuda::CUDACachingAllocator::raw_alloc(nbytes);
}
if (FLAGS_caffe2_gpu_memory_tracking) {
g_size_map[ptr] = nbytes;
Expand Down Expand Up @@ -625,7 +625,7 @@ struct DefaultCUDAAllocator final : public at::Allocator {
break;
}
case CudaMemoryPoolType::THC: {
cuda::CUDACachingAllocator::raw_delete(ptr);
c10::cuda::CUDACachingAllocator::raw_delete(ptr);
if (FLAGS_caffe2_gpu_memory_tracking) {
g_cuda_device_affiliation.erase(g_cuda_device_affiliation.find(ptr));
}
Expand Down

0 comments on commit 50ec416

Please sign in to comment.