Skip to content

Commit

Permalink
Merge pull request #13210 from JiabinYang/fix_15_mac
Browse files Browse the repository at this point in the history
Fix 15 mac
  • Loading branch information
panyx0718 authored Sep 5, 2018
2 parents 3206b17 + 1701cf0 commit ed11f49
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 2 additions & 3 deletions paddle/fluid/inference/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ get_property(fluid_modules GLOBAL PROPERTY FLUID_MODULES)
# paddle_fluid_origin exclude inference api interface
cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api)

if(NOT APPLE)
add_subdirectory(api)
endif()
# fix macos compile error
add_subdirectory(api)

# Create static library
cc_library(paddle_fluid DEPS ${fluid_modules} paddle_fluid_api paddle_inference_api)
Expand Down
11 changes: 11 additions & 0 deletions paddle/fluid/inference/api/api_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,13 @@ std::unique_ptr<PaddlePredictor> NativePaddlePredictor::Clone() {
LOG(ERROR) << "fail to call Init";
return nullptr;
}
#ifdef __clang__
// fix macos compile error.
return cls;
#else
// fix manylinux compile error.
return std::move(cls);
#endif
}

bool NativePaddlePredictor::SetFeed(const std::vector<PaddleTensor> &inputs,
Expand Down Expand Up @@ -307,7 +312,13 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
if (!dynamic_cast<NativePaddlePredictor *>(predictor.get())->Init(nullptr)) {
return nullptr;
}
#ifdef __clang__
// fix macos compile error
return predictor;
#else
// fix manylinux compile error
return std::move(predictor);
#endif
}

} // namespace paddle
2 changes: 1 addition & 1 deletion paddle/fluid/inference/api/paddle_inference_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct PaddleTensor {
std::vector<int> shape;
PaddleBuf data; // blob of data.
PaddleDType dtype;
std::vector<std::vector<uint64_t>> lod; // lod data
std::vector<std::vector<size_t>> lod; // lod data
};

enum class PaddleEngineKind {
Expand Down

0 comments on commit ed11f49

Please sign in to comment.