提交 f833b157 编写于 作者: J JiabinYang

fix macos compile error

上级 a6ef41f3
...@@ -17,9 +17,7 @@ get_property(fluid_modules GLOBAL PROPERTY FLUID_MODULES) ...@@ -17,9 +17,7 @@ get_property(fluid_modules GLOBAL PROPERTY FLUID_MODULES)
# paddle_fluid_origin exclude inference api interface # paddle_fluid_origin exclude inference api interface
cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api) cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api)
if(NOT APPLE) add_subdirectory(api)
add_subdirectory(api)
endif()
# Create static library # Create static library
cc_library(paddle_fluid DEPS ${fluid_modules} paddle_fluid_api paddle_inference_api) cc_library(paddle_fluid DEPS ${fluid_modules} paddle_fluid_api paddle_inference_api)
......
...@@ -172,8 +172,13 @@ std::unique_ptr<PaddlePredictor> NativePaddlePredictor::Clone() { ...@@ -172,8 +172,13 @@ std::unique_ptr<PaddlePredictor> NativePaddlePredictor::Clone() {
LOG(ERROR) << "fail to call Init"; LOG(ERROR) << "fail to call Init";
return nullptr; return nullptr;
} }
#ifdef __clang__
// fix macos compile error.
return cls;
#else
// fix manylinux compile error. // fix manylinux compile error.
return std::move(cls); return std::move(cls);
#endif
} }
bool NativePaddlePredictor::SetFeed(const std::vector<PaddleTensor> &inputs, bool NativePaddlePredictor::SetFeed(const std::vector<PaddleTensor> &inputs,
...@@ -307,7 +312,13 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor< ...@@ -307,7 +312,13 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
if (!dynamic_cast<NativePaddlePredictor *>(predictor.get())->Init(nullptr)) { if (!dynamic_cast<NativePaddlePredictor *>(predictor.get())->Init(nullptr)) {
return nullptr; return nullptr;
} }
#ifdef __clang__
// fix macos compile error
return predictor;
#else
// fix manylinux compile error
return std::move(predictor); return std::move(predictor);
#endif
} }
} // namespace paddle } // namespace paddle
...@@ -70,7 +70,7 @@ struct PaddleTensor { ...@@ -70,7 +70,7 @@ struct PaddleTensor {
std::vector<int> shape; std::vector<int> shape;
PaddleBuf data; // blob of data. PaddleBuf data; // blob of data.
PaddleDType dtype; PaddleDType dtype;
std::vector<std::vector<uint64_t>> lod; // lod data std::vector<std::vector<size_t>> lod; // lod data
}; };
enum class PaddleEngineKind { enum class PaddleEngineKind {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册