Skip to content

Fix dist compile error #9320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions paddle/fluid/operators/detail/bytebuffer_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ class GrpcByteBufferSource

class GrpcByteBufferSourceWrapper : public Source {
public:
GrpcByteBufferSourceWrapper(GrpcByteBufferSource* source) : source_(source) {}
virtual ::google::protobuf::io::ZeroCopyInputStream* contents() override {
explicit GrpcByteBufferSourceWrapper(GrpcByteBufferSource* source)
: source_(source) {}
::google::protobuf::io::ZeroCopyInputStream* contents() override {
return source_;
}

Expand Down
2 changes: 0 additions & 2 deletions paddle/fluid/operators/detail/grpc_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ limitations under the License. */

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

//#include <grpc/support/log.h>

namespace paddle {
namespace operators {
namespace detail {
Expand Down
21 changes: 10 additions & 11 deletions paddle/fluid/operators/detail/test_serde.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void RunSerdeTestSelectedRows(platform::Place place) {
// operators::detail::DeserializeFromByteBuffer(msg, ctx, &var2);
framework::Scope scope;
scope.Var("myvar");
operators::detail::TensorResponse resp(&scope, &ctx);
operators::detail::VariableResponse resp(&scope, &ctx);
EXPECT_EQ(resp.Parse(msg), 0);

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

TEST(LodTensor, GPU) {
platform::CUDAPlace place;
TEST(LodTensor, Run) {
platform::CPUPlace place;
RunTestLodTensor(place);
RunTestLodTensor(place, 1);
}

TEST(LodTensor, CPU) {
platform::CPUPlace place;
#ifdef PADDLE_WITH_CUDA
platform::CUDAPlace place;
RunTestLodTensor(place);
RunTestLodTensor(place, 1);
#endif
}

TEST(SelectedRows, CPU) {
TEST(SelectedRows, Run) {
platform::CPUPlace place;
RunSerdeTestSelectedRows(place);
}

TEST(SelectedRows, GPU) {
#ifdef PADDLE_WITH_CUDA
platform::CUDAPlace place;
RunSerdeTestSelectedRows(place);
#endif
}
4 changes: 2 additions & 2 deletions paddle/fluid/operators/detail/variable_response.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class VariableResponse {
public:
VariableResponse(const framework::Scope* scope,
const platform::DeviceContext* dev_ctx)
: scope_(scope), dev_ctx_(dev_ctx){};
: scope_(scope), dev_ctx_(dev_ctx) {}

virtual ~VariableResponse(){};
virtual ~VariableResponse() {}

// return:
// 0:ok.
Expand Down