Build acl_cl kernel as a separate static lib `libkernel_acl_cl.a`.
Likewise #2084 for cpu kernel.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
# Build kernels
set(LIB_NEURUN_KERNEL_CPU neurun_kernel_cpu)
+set(LIB_NEURUN_KERNEL_ACL_CL neurun_kernel_acl_cl)
add_subdirectory(src/kernel)
# Build backends
file(GLOB SOURCES "src/*.cc")
file(GLOB_RECURSE SOURCES_INTERNAL "src/internal/*.cc")
-file(GLOB_RECURSE SOURCES_KERNEL "src/kernel/acl_cl/*.cc") # TODO should be built as a separate lib
set(SOURCES ${SOURCES} ${SOURCES_INTERNAL} ${SOURCES_KERNEL})
target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} arm_compute)
target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} nnfw_support_nnapi)
+target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} ${LIB_NEURUN_KERNEL_ACL_CL})
set_target_properties(${LIB_NEURUN_BACKEND_ACL_CL} PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(${LIB_NEURUN_BACKEND_ACL_CL} PROPERTIES OUTPUT_NAME backend_acl_cl)
add_subdirectory(cpufallback)
+add_subdirectory(acl_cl)
--- /dev/null
+file(GLOB SOURCES "*.cc")
+
+add_library(${LIB_NEURUN_KERNEL_ACL_CL} STATIC ${SOURCES})
+
+target_include_directories(${LIB_NEURUN_KERNEL_ACL_CL} PUBLIC ${NNFW_INCLUDE_DIR})
+target_include_directories(${LIB_NEURUN_KERNEL_ACL_CL} PUBLIC ${NEURUN_INCLUDE_DIR})
+target_include_directories(${LIB_NEURUN_KERNEL_ACL_CL} PUBLIC ${CMAKE_SOURCE_DIR}/externals/tensorflow) # TODO We should not need this
+
+target_link_libraries(${LIB_NEURUN_KERNEL_ACL_CL} arm_compute)
+target_link_libraries(${LIB_NEURUN_KERNEL_ACL_CL} tensorflow-lite) # TODO We should not need this
+target_link_libraries(${LIB_NEURUN_KERNEL_ACL_CL} ${LIB_NEURUN_KERNEL_CPU}) # TODO We should not need this
+
+set_target_properties(${LIB_NEURUN_KERNEL_ACL_CL} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set_target_properties(${LIB_NEURUN_KERNEL_ACL_CL} PROPERTIES OUTPUT_NAME kernel_acl_cl)
+install(TARGETS ${LIB_NEURUN_KERNEL_ACL_CL} DESTINATION lib/neurun)
#include <arm_compute/runtime/IFunction.h>
#include "internal/Model.h"
+
+// TODO Remove this unnecessary dependency. This is only for OperandType.
+// If we remove this, we can also remove cpu kernel library dependency
#include "kernel/cpufallback/OperationUtils.h"
using namespace internal::kernel::cpu;