Skip to content

Commit c2b8bd3

Browse files
committed
FIX: name convention
1 parent b4ff2e4 commit c2b8bd3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

paddle/platform/device_context.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Eigen::DefaultDevice* CPUDeviceContext::eigen_device() const {
3232
return eigen_device_.get();
3333
}
3434

35-
Place CPUDeviceContext::place() const { return CPUPlace(); }
35+
Place CPUDeviceContext::GetPlace() const { return CPUPlace(); }
3636

3737
#ifndef PADDLE_ONLY_CPU
3838

@@ -50,7 +50,7 @@ CUDADeviceContext::CUDADeviceContext(GPUPlace place) : place_(place) {
5050

5151
CUDADeviceContext::~CUDADeviceContext() {
5252
SetDeviceId(place_.device);
53-
wait();
53+
Wait();
5454
if (cublas_handle_) {
5555
PADDLE_ENFORCE(dynload::cublasDestroy(cublas_handle_));
5656
}
@@ -67,11 +67,11 @@ CUDADeviceContext::~CUDADeviceContext() {
6767
PADDLE_ENFORCE(cudaStreamDestroy(stream_));
6868
}
6969

70-
Place CUDADeviceContext::place() const { return place_; }
70+
Place CUDADeviceContext::GetPlace() const { return place_; }
7171

7272
cudaStream_t CUDADeviceContext::stream() const { return stream_; }
7373

74-
void CUDADeviceContext::wait() const {
74+
void CUDADeviceContext::Wait() const {
7575
PADDLE_ENFORCE(cudaStreamSynchronize(stream_));
7676
}
7777

paddle/platform/device_context.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace platform {
3131
class DeviceContext {
3232
public:
3333
virtual ~DeviceContext() {}
34-
virtual Place place() const = 0;
34+
virtual Place GetPlace() const = 0;
3535

3636
template <typename DeviceType>
3737
DeviceType* get_eigen_device() const;
@@ -45,7 +45,7 @@ class CPUDeviceContext : public DeviceContext {
4545

4646
Eigen::DefaultDevice* eigen_device() const;
4747

48-
Place place() const override;
48+
Place GetPlace() const override;
4949

5050
private:
5151
std::unique_ptr<Eigen::DefaultDevice> eigen_device_;
@@ -59,13 +59,13 @@ class CUDADeviceContext : public DeviceContext {
5959
virtual ~CUDADeviceContext();
6060

6161
/*! \brief Wait for all operations completion in the stream. */
62-
void wait() const;
62+
void Wait() const;
6363

6464
/*! \brief Return CUDA stream in the device context. */
6565
cudaStream_t stream() const;
6666

6767
/*! \brief Return place in the device context. */
68-
Place place() const override;
68+
Place GetPlace() const override;
6969

7070
/*! \brief Return eigen device in the device context. */
7171
Eigen::GpuDevice* eigen_device() const;

0 commit comments

Comments
 (0)