Skip to content

Commit 50ec416

Browse files
xw285cornellpytorchmergebot
authored andcommitted
Fix C2 Ambiguous namespace (pytorch#89534)
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: pytorch#89534 Approved by: https://github.com/malfet
1 parent 56ab94d commit 50ec416

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

caffe2/core/context_gpu.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,12 @@ struct DefaultCUDAAllocator final : public at::Allocator {
561561
// some models that are currently running with the thc
562562
// allocator fit in memory. We will need to find some
563563
// way of resolving this problem.
564-
cuda::CUDAStreamGuard g(
564+
c10::cuda::CUDAStreamGuard g(
565565
Stream(
566566
Stream::DEFAULT,
567567
Device(kCUDA, CaffeCudaGetDevice())
568568
));
569-
ptr = cuda::CUDACachingAllocator::raw_alloc(nbytes);
569+
ptr = c10::cuda::CUDACachingAllocator::raw_alloc(nbytes);
570570
}
571571
if (FLAGS_caffe2_gpu_memory_tracking) {
572572
g_size_map[ptr] = nbytes;
@@ -625,7 +625,7 @@ struct DefaultCUDAAllocator final : public at::Allocator {
625625
break;
626626
}
627627
case CudaMemoryPoolType::THC: {
628-
cuda::CUDACachingAllocator::raw_delete(ptr);
628+
c10::cuda::CUDACachingAllocator::raw_delete(ptr);
629629
if (FLAGS_caffe2_gpu_memory_tracking) {
630630
g_cuda_device_affiliation.erase(g_cuda_device_affiliation.find(ptr));
631631
}

0 commit comments

Comments
 (0)