Skip to content

Commit ed11f49

Browse files
authored
Merge pull request #13210 from JiabinYang/fix_15_mac
Fix 15 mac
2 parents 3206b17 + 1701cf0 commit ed11f49

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

paddle/fluid/inference/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ get_property(fluid_modules GLOBAL PROPERTY FLUID_MODULES)
1717
# paddle_fluid_origin exclude inference api interface
1818
cc_library(paddle_fluid_origin DEPS ${fluid_modules} paddle_fluid_api)
1919

20-
if(NOT APPLE)
21-
add_subdirectory(api)
22-
endif()
20+
# fix macos compile error
21+
add_subdirectory(api)
2322

2423
# Create static library
2524
cc_library(paddle_fluid DEPS ${fluid_modules} paddle_fluid_api paddle_inference_api)

paddle/fluid/inference/api/api_impl.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,13 @@ std::unique_ptr<PaddlePredictor> NativePaddlePredictor::Clone() {
172172
LOG(ERROR) << "fail to call Init";
173173
return nullptr;
174174
}
175+
#ifdef __clang__
176+
// fix macos compile error.
177+
return cls;
178+
#else
175179
// fix manylinux compile error.
176180
return std::move(cls);
181+
#endif
177182
}
178183

179184
bool NativePaddlePredictor::SetFeed(const std::vector<PaddleTensor> &inputs,
@@ -307,7 +312,13 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
307312
if (!dynamic_cast<NativePaddlePredictor *>(predictor.get())->Init(nullptr)) {
308313
return nullptr;
309314
}
315+
#ifdef __clang__
316+
// fix macos compile error
317+
return predictor;
318+
#else
319+
// fix manylinux compile error
310320
return std::move(predictor);
321+
#endif
311322
}
312323

313324
} // namespace paddle

paddle/fluid/inference/api/paddle_inference_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct PaddleTensor {
7070
std::vector<int> shape;
7171
PaddleBuf data; // blob of data.
7272
PaddleDType dtype;
73-
std::vector<std::vector<uint64_t>> lod; // lod data
73+
std::vector<std::vector<size_t>> lod; // lod data
7474
};
7575

7676
enum class PaddleEngineKind {

0 commit comments

Comments
 (0)