Skip to content

Commit

Permalink
[luci-interpreter] cleanup pal related cmakes (Samsung#7757)
Browse files Browse the repository at this point in the history
This PR moves platform specific sources and headers to PAL
and adds warning message.

ONE-DCO-1.0-Signed-off-by: Alexander Efimov <[email protected]>
  • Loading branch information
binarman authored Sep 28, 2021
1 parent 68d5660 commit 18900c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
7 changes: 6 additions & 1 deletion compiler/luci-interpreter/pal/linux/pal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ macro(add_pal_to_target TGT)
set(PAL_SOURCES ${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/quantization_util.cc)
add_library(luci_interpreter_linux_pal STATIC ${PAL_SOURCES})
set_target_properties(luci_interpreter_linux_pal PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(luci_interpreter_linux_pal SYSTEM PRIVATE "${TensorFlowSource_DIR}")
target_include_directories(luci_interpreter_linux_pal SYSTEM PRIVATE
"${TensorFlowRuySource_DIR}"
"${TensorFlowGEMMLowpSource_DIR}"
"${TensorFlowEigenSource_DIR}"
"${TensorFlowSource_DIR}"
)

target_link_libraries(${TGT} PRIVATE Threads::Threads luci_interpreter_linux_pal)
endmacro()
7 changes: 6 additions & 1 deletion compiler/luci-interpreter/pal/mcu/pal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ macro(add_pal_to_target TGT)
set(PAL_SOURCES ${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/quantization_util.cc)
add_library(luci_interpreter_mcu_pal STATIC ${PAL_SOURCES})
set_target_properties(luci_interpreter_mcu_pal PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(luci_interpreter_mcu_pal SYSTEM PRIVATE "${TensorFlowSource_DIR}")
target_include_directories(luci_interpreter_mcu_pal SYSTEM PRIVATE
"${TensorFlowRuySource_DIR}"
"${TensorFlowGEMMLowpSource_DIR}"
"${TensorFlowEigenSource_DIR}"
"${TensorFlowSource_DIR}"
)

target_link_libraries(${TGT} PRIVATE luci_interpreter_mcu_pal)
#target_link_libraries(${TGT} PRIVATE Threads::Threads luci_interpreter_mcu_pal)
Expand Down
3 changes: 2 additions & 1 deletion compiler/luci-interpreter/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
include(${LUCI_INTERPRETER_PAL_DIR}/pal.cmake)
include("${LUCI_INTERPRETER_PAL_DIR}/pal.cmake")

initialize_pal()

if (NOT PAL_INITIALIZED)
message("PAL Failed to initialize, skip luci-interpreter")
return()
endif()

Expand Down
18 changes: 3 additions & 15 deletions compiler/luci-interpreter/src/kernels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ set(SOURCES
BinaryOpCommon.h
Utils.h
Utils.cpp
${TensorFlowSource_DIR}/tensorflow/lite/kernels/internal/quantization_util.cc
"${LUCI_INTERPRETER_INCLUDE_DIR}/luci_interpreter/TestMemoryManager.h"
${LUCI_INTERPRETER_SOURCE_DIR}/TestMemoryManager.cpp
"${LUCI_INTERPRETER_INCLUDE_DIR}/luci_interpreter/SimpleMemoryManager.h"
Expand All @@ -18,20 +17,9 @@ include(${KERNEL_REGISTER_FILE})
add_library(${LUCI_INTERPRETER_KERNELS} STATIC ${SOURCES})
set_target_properties(${LUCI_INTERPRETER_KERNELS} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(${LUCI_INTERPRETER_KERNELS} PUBLIC ${LUCI_INTERPRETER_SOURCE_DIR})
target_include_directories(${LUCI_INTERPRETER_KERNELS} SYSTEM PRIVATE
"${TensorFlowRuySource_DIR}"
"${TensorFlowGEMMLowpSource_DIR}"
"${TensorFlowEigenSource_DIR}"
"${TensorFlowSource_DIR}")

if (NOT LUCI_MICRO)
target_link_libraries(${LUCI_INTERPRETER_KERNELS}
PUBLIC ${LUCI_INTERPRETER_CORE}
PRIVATE nncc_common Threads::Threads)
else ()
target_link_libraries(${LUCI_INTERPRETER_KERNELS}
PUBLIC ${LUCI_INTERPRETER_CORE})
endif()

target_link_libraries(${LUCI_INTERPRETER_KERNELS} PUBLIC ${LUCI_INTERPRETER_CORE})
target_link_libraries(${LUCI_INTERPRETER_KERNELS} PRIVATE nncc_common)

add_pal_to_target(${LUCI_INTERPRETER_KERNELS})

Expand Down

0 comments on commit 18900c9

Please sign in to comment.