Skip to content

Commit ee7f1ec

Browse files
author
Yancey
authored
Fix dist compile error (#9320)
1 parent 9126e62 commit ee7f1ec

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

paddle/fluid/operators/detail/bytebuffer_stream.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ class GrpcByteBufferSource
146146

147147
class GrpcByteBufferSourceWrapper : public Source {
148148
public:
149-
GrpcByteBufferSourceWrapper(GrpcByteBufferSource* source) : source_(source) {}
150-
virtual ::google::protobuf::io::ZeroCopyInputStream* contents() override {
149+
explicit GrpcByteBufferSourceWrapper(GrpcByteBufferSource* source)
150+
: source_(source) {}
151+
::google::protobuf::io::ZeroCopyInputStream* contents() override {
151152
return source_;
152153
}
153154

paddle/fluid/operators/detail/grpc_server.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ limitations under the License. */
2929

3030
#include "paddle/fluid/operators/detail/grpc_service.h"
3131

32-
//#include <grpc/support/log.h>
33-
3432
namespace paddle {
3533
namespace operators {
3634
namespace detail {

paddle/fluid/operators/detail/test_serde.cc

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void RunSerdeTestSelectedRows(platform::Place place) {
8181
// operators::detail::DeserializeFromByteBuffer(msg, ctx, &var2);
8282
framework::Scope scope;
8383
scope.Var("myvar");
84-
operators::detail::TensorResponse resp(&scope, &ctx);
84+
operators::detail::VariableResponse resp(&scope, &ctx);
8585
EXPECT_EQ(resp.Parse(msg), 0);
8686

8787
framework::Variable* var2 = resp.GetVar();
@@ -166,7 +166,7 @@ void RunTestLodTensor(platform::Place place, int from_type = 0) {
166166
// deserialize zero-copy
167167
framework::Scope scope;
168168
scope.Var("myvar");
169-
operators::detail::TensorResponse resp(&scope, &ctx);
169+
operators::detail::VariableResponse resp(&scope, &ctx);
170170
if (from_type == 0) {
171171
EXPECT_EQ(resp.Parse(msg), 0);
172172
} else {
@@ -194,24 +194,23 @@ void RunTestLodTensor(platform::Place place, int from_type = 0) {
194194
for (int i = 0; i < tensor_numel; ++i) EXPECT_FLOAT_EQ(tensor_data2[i], 31.9);
195195
}
196196

197-
TEST(LodTensor, GPU) {
198-
platform::CUDAPlace place;
197+
TEST(LodTensor, Run) {
198+
platform::CPUPlace place;
199199
RunTestLodTensor(place);
200200
RunTestLodTensor(place, 1);
201-
}
202-
203-
TEST(LodTensor, CPU) {
204-
platform::CPUPlace place;
201+
#ifdef PADDLE_WITH_CUDA
202+
platform::CUDAPlace place;
205203
RunTestLodTensor(place);
206204
RunTestLodTensor(place, 1);
205+
#endif
207206
}
208207

209-
TEST(SelectedRows, CPU) {
208+
TEST(SelectedRows, Run) {
210209
platform::CPUPlace place;
211210
RunSerdeTestSelectedRows(place);
212-
}
213211

214-
TEST(SelectedRows, GPU) {
212+
#ifdef PADDLE_WITH_CUDA
215213
platform::CUDAPlace place;
216214
RunSerdeTestSelectedRows(place);
215+
#endif
217216
}

paddle/fluid/operators/detail/variable_response.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class VariableResponse {
3636
public:
3737
VariableResponse(const framework::Scope* scope,
3838
const platform::DeviceContext* dev_ctx)
39-
: scope_(scope), dev_ctx_(dev_ctx){};
39+
: scope_(scope), dev_ctx_(dev_ctx) {}
4040

41-
virtual ~VariableResponse(){};
41+
virtual ~VariableResponse() {}
4242

4343
// return:
4444
// 0:ok.

0 commit comments

Comments
 (0)