未验证 提交 ee7f1ecd 编写于 作者: Y Yancey 提交者: GitHub

Fix dist compile error (#9320)

上级 9126e626
...@@ -146,8 +146,9 @@ class GrpcByteBufferSource ...@@ -146,8 +146,9 @@ class GrpcByteBufferSource
class GrpcByteBufferSourceWrapper : public Source { class GrpcByteBufferSourceWrapper : public Source {
public: public:
GrpcByteBufferSourceWrapper(GrpcByteBufferSource* source) : source_(source) {} explicit GrpcByteBufferSourceWrapper(GrpcByteBufferSource* source)
virtual ::google::protobuf::io::ZeroCopyInputStream* contents() override { : source_(source) {}
::google::protobuf::io::ZeroCopyInputStream* contents() override {
return source_; return source_;
} }
......
...@@ -29,8 +29,6 @@ limitations under the License. */ ...@@ -29,8 +29,6 @@ limitations under the License. */
#include "paddle/fluid/operators/detail/grpc_service.h" #include "paddle/fluid/operators/detail/grpc_service.h"
//#include <grpc/support/log.h>
namespace paddle { namespace paddle {
namespace operators { namespace operators {
namespace detail { namespace detail {
......
...@@ -81,7 +81,7 @@ void RunSerdeTestSelectedRows(platform::Place place) { ...@@ -81,7 +81,7 @@ void RunSerdeTestSelectedRows(platform::Place place) {
// operators::detail::DeserializeFromByteBuffer(msg, ctx, &var2); // operators::detail::DeserializeFromByteBuffer(msg, ctx, &var2);
framework::Scope scope; framework::Scope scope;
scope.Var("myvar"); scope.Var("myvar");
operators::detail::TensorResponse resp(&scope, &ctx); operators::detail::VariableResponse resp(&scope, &ctx);
EXPECT_EQ(resp.Parse(msg), 0); EXPECT_EQ(resp.Parse(msg), 0);
framework::Variable* var2 = resp.GetVar(); framework::Variable* var2 = resp.GetVar();
...@@ -166,7 +166,7 @@ void RunTestLodTensor(platform::Place place, int from_type = 0) { ...@@ -166,7 +166,7 @@ void RunTestLodTensor(platform::Place place, int from_type = 0) {
// deserialize zero-copy // deserialize zero-copy
framework::Scope scope; framework::Scope scope;
scope.Var("myvar"); scope.Var("myvar");
operators::detail::TensorResponse resp(&scope, &ctx); operators::detail::VariableResponse resp(&scope, &ctx);
if (from_type == 0) { if (from_type == 0) {
EXPECT_EQ(resp.Parse(msg), 0); EXPECT_EQ(resp.Parse(msg), 0);
} else { } else {
...@@ -194,24 +194,23 @@ void RunTestLodTensor(platform::Place place, int from_type = 0) { ...@@ -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); for (int i = 0; i < tensor_numel; ++i) EXPECT_FLOAT_EQ(tensor_data2[i], 31.9);
} }
TEST(LodTensor, GPU) { TEST(LodTensor, Run) {
platform::CUDAPlace place; platform::CPUPlace place;
RunTestLodTensor(place); RunTestLodTensor(place);
RunTestLodTensor(place, 1); RunTestLodTensor(place, 1);
} #ifdef PADDLE_WITH_CUDA
platform::CUDAPlace place;
TEST(LodTensor, CPU) {
platform::CPUPlace place;
RunTestLodTensor(place); RunTestLodTensor(place);
RunTestLodTensor(place, 1); RunTestLodTensor(place, 1);
#endif
} }
TEST(SelectedRows, CPU) { TEST(SelectedRows, Run) {
platform::CPUPlace place; platform::CPUPlace place;
RunSerdeTestSelectedRows(place); RunSerdeTestSelectedRows(place);
}
TEST(SelectedRows, GPU) { #ifdef PADDLE_WITH_CUDA
platform::CUDAPlace place; platform::CUDAPlace place;
RunSerdeTestSelectedRows(place); RunSerdeTestSelectedRows(place);
#endif
} }
...@@ -36,9 +36,9 @@ class VariableResponse { ...@@ -36,9 +36,9 @@ class VariableResponse {
public: public:
VariableResponse(const framework::Scope* scope, VariableResponse(const framework::Scope* scope,
const platform::DeviceContext* dev_ctx) const platform::DeviceContext* dev_ctx)
: scope_(scope), dev_ctx_(dev_ctx){}; : scope_(scope), dev_ctx_(dev_ctx) {}
virtual ~VariableResponse(){}; virtual ~VariableResponse() {}
// return: // return:
// 0:ok. // 0:ok.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册