Skip to content

Commit a5291f9

Browse files
committed
Fix compile
1 parent 4518252 commit a5291f9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

paddle/pybind/tensor_py.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ struct CastToPyBufferImpl<true, I, ARGS...> {
6363
auto *dst_ptr = static_cast<void *>(dst_tensor.mutable_data<CUR_TYPE>(
6464
tensor.dims(), platform::CPUPlace()));
6565

66-
platform::DeviceContextPool &pool = platform::DeviceContextPool::Get();
66+
platform::DeviceContextPool &pool =
67+
platform::DeviceContextPool::Instance;
6768
auto dev_ctx = static_cast<const platform::CUDADeviceContext *>(
68-
pool.Borrow(tensor.place()));
69+
pool.Get(tensor.place()));
6970

7071
paddle::platform::GpuMemcpyAsync(
7172
dst_ptr, src_ptr, sizeof(CUR_TYPE) * tensor.numel(),
@@ -137,9 +138,9 @@ void PyCUDATensorSetFromArray(
137138
self.Resize(framework::make_ddim(dims));
138139
auto *dst = self.mutable_data<T>(place);
139140

140-
platform::DeviceContextPool &pool = platform::DeviceContextPool::Get();
141+
platform::DeviceContextPool &pool = platform::DeviceContextPool::Instance();
141142
auto dev_ctx =
142-
static_cast<const platform::CUDADeviceContext *>(pool.Borrow(place));
143+
static_cast<const platform::CUDADeviceContext *>(pool.Get(place));
143144
paddle::platform::GpuMemcpyAsync(dst, array.data(), sizeof(T) * array.size(),
144145
cudaMemcpyHostToDevice, dev_ctx->stream());
145146
}

0 commit comments

Comments
 (0)