Skip to content
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

[cherry-pick2.9][cxx demo] fix arm linux full demo bug #6068

Merged
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
7 changes: 6 additions & 1 deletion lite/demo/cxx/armlinux_mobilenetv1_full_demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ set(ARMLINUX_ARCH_ABI armv8)

# 1. path to Paddle-Lite lib
set(LITE_DIR "${PROJECT_SOURCE_DIR}/../../../cxx")
set(GFLAGS_DIR "${PROJECT_SOURCE_DIR}/../../../../third_party/install/gflags")

# 2. link Paddle-Lite directory
link_directories(${LITE_DIR}/lib)
link_directories(${GFLAGS_DIR}/lib)

include_directories(${LITE_DIR}/include)
include_directories(${GFLAGS_DIR}/include)

# 3. compile options
if(ARMLINUX_ARCH_ABI STREQUAL "armv8")
Expand All @@ -36,7 +39,9 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
# 4.add executable output
add_executable(${TARGET} ${TARGET}.cc)
target_link_libraries(${TARGET} -lpaddle_full_api_shared)

target_link_libraries(${TARGET} libgflags.a)
target_link_libraries(${TARGET} -ldl)
target_link_libraries(${TARGET} -lpthread)
###############################################################
# How to use one of static libaray: #
# `libpaddle_api_full_bundled.a` #
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ void RunModel() {
config.set_model_dir(FLAGS_model_dir);
#ifdef DEMO_WITH_OPENCL
std::vector<Place> valid_places{
Place{TARGET(kOpenCL), PRECISION(kFP16), DATALAYOUT(kImageDefault)},
Place{TARGET(kOpenCL), PRECISION(kFloat), DATALAYOUT(kNCHW)},
Place{TARGET(kOpenCL), PRECISION(kFloat), DATALAYOUT(kNHWC)},
Place{TARGET(kARM), PRECISION(kFloat)}};
Place{TARGET(kOpenCL), PRECISION(kAny), DATALAYOUT(kImageDefault)},
Place{TARGET(kOpenCL), PRECISION(kAny), DATALAYOUT(kNCHW)},
Place{TARGET(kOpenCL), PRECISION(kInt32), DATALAYOUT(kNCHW)},
Place{TARGET(kARM)}};
#else
std::vector<Place> valid_places{Place{TARGET(kARM), PRECISION(kFloat)}};
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
# 4.add executable output
add_executable(${TARGET} ${TARGET}.cc)
target_link_libraries(${TARGET} -lpaddle_light_api_shared)
target_link_libraries(${TARGET} -ldl)

###############################################################
# How to use one of static libaray: #
Expand Down