Add support for Android make
This change adds support for building TIM-VX under a
Android AOSP environment.
Instructions below based on Khadas VIMS system
* Add TIM-VX git repository to Android AOSP
# cd vendor/amlogic/common/npu
# git clone git@github.com:VeriSilicon/TIM-VX.git tim-vx
* Include tim-vx/Android.mk to AOSP build
Edit vendor/amlogic/common/npu/Android.mak
+TMP_PATH := $(LOCAL_PATH)
+VIVANTE_SDK_DIR := $(LOCAL_PATH)/service/ovx_inc
+include $(LOCAL_PATH)/tim-vx/Android.mk
+LOCAL_PATH := $(TMP_PATH)
ifeq ($(BOARD_NPU_SERVICE_ENABLE), true)
Note VIVANTE_SDK_DIR needs to point to SDK header
inclusion path
Signed-off-by: Kainan Cha <kainan.zha@verisilicon.com>
This commit is contained in:
parent
88f83019a8
commit
31969a7326
|
|
@ -0,0 +1,94 @@
|
||||||
|
#
|
||||||
|
# Android Makefile for TIM-VX (assuming VENDOR build)
|
||||||
|
#
|
||||||
|
# Prerequesite: Requires Vivante SDK (libOpenVX etc) to be available
|
||||||
|
# and VIVANTE_SDK_INC to be set for include paths
|
||||||
|
#
|
||||||
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
|
ifeq ($(VIVANTE_SDK_INC),)
|
||||||
|
$(error Please set VIVANTE_SDK_INC path pointing to VX/CL header file locations)
|
||||||
|
endif
|
||||||
|
|
||||||
|
LOCAL_VENDOR_MODULE := true
|
||||||
|
|
||||||
|
INTERNAL_SRC_PATH := $(LOCAL_PATH)/src/tim/vx/internal/src
|
||||||
|
SRC_FILES := $(wildcard $(LOCAL_PATH)/src/tim/vx/*.c**)
|
||||||
|
SRC_FILES += $(wildcard $(LOCAL_PATH)/src/tim/vx/ops/*.c**)
|
||||||
|
LOCAL_SRC_FILES := $(SRC_FILES:$(LOCAL_PATH)/%=%)
|
||||||
|
|
||||||
|
INTERNAL_SOURCES := $(wildcard $(LOCAL_PATH)/src/tim/vx/internal/src/*.c)
|
||||||
|
INTERNAL_SOURCES += $(wildcard $(LOCAL_PATH)/src/tim/vx/internal/src/*/*.c)
|
||||||
|
LOCAL_SRC_FILES += $(INTERNAL_SOURCES:$(LOCAL_PATH)/%=%)
|
||||||
|
|
||||||
|
LIBNNEXT_KERNEL_SOURCES := $(wildcard $(INTERNAL_SRC_PATH)/libnnext/ops/kernel/*.c)
|
||||||
|
LOCAL_SRC_FILES += $(LIBNNEXT_KERNEL_SOURCES:$(LOCAL_PATH)/%=%)
|
||||||
|
|
||||||
|
KERNEL_SOURCES := $(wildcard $(INTERNAL_SRC_PATH)/kernel/cl/*.c)
|
||||||
|
KERNEL_SOURCES += $(wildcard $(INTERNAL_SRC_PATH)/kernel/cpu/*.c)
|
||||||
|
KERNEL_SOURCES += $(wildcard $(INTERNAL_SRC_PATH)/kernel/evis/*.c)
|
||||||
|
KERNEL_SOURCES += $(wildcard $(INTERNAL_SRC_PATH)/kernel/vx/*.c)
|
||||||
|
KERNEL_SOURCES += $(wildcard $(INTERNAL_SRC_PATH)/custom/ops/*.c)
|
||||||
|
KERNEL_SOURCES += $(wildcard $(INTERNAL_SRC_PATH)/custom/ops/kernel/*.c)
|
||||||
|
LOCAL_SRC_FILES += $(KERNEL_SOURCES:$(LOCAL_PATH)/%=%)
|
||||||
|
|
||||||
|
LOCAL_C_INCLUDES := \
|
||||||
|
$(VIVANTE_SDK_INC)/VX \
|
||||||
|
$(VIVANTE_SDK_INC)/CL \
|
||||||
|
$(VIVANTE_SDK_INC)/ \
|
||||||
|
$(LOCAL_PATH)/include \
|
||||||
|
$(LOCAL_PATH)/include/tim/vx \
|
||||||
|
$(LOCAL_PATH)/include/tim/vx/ops \
|
||||||
|
$(LOCAL_PATH)/src/tim/vx \
|
||||||
|
$(INTERNAL_SRC_PATH)/../include \
|
||||||
|
$(INTERNAL_SRC_PATH)/../include/ops \
|
||||||
|
$(INTERNAL_SRC_PATH)/../include/utils \
|
||||||
|
$(INTERNAL_SRC_PATH)/../include/inference \
|
||||||
|
$(INTERNAL_SRC_PATH)/../include/client \
|
||||||
|
$(INTERNAL_SRC_PATH)/../include/libnnext
|
||||||
|
|
||||||
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
|
liblog \
|
||||||
|
libGAL \
|
||||||
|
libOpenVX \
|
||||||
|
libVSC \
|
||||||
|
libdl
|
||||||
|
|
||||||
|
LOCAL_STATIC_LIBRARIES := libgtest
|
||||||
|
|
||||||
|
LOCAL_CFLAGS := \
|
||||||
|
-DLINUX \
|
||||||
|
-D'OVXLIB_API=__attribute__((visibility("default")))' \
|
||||||
|
-DANDROID_SDK_VERSION=$(PLATFORM_SDK_VERSION)\
|
||||||
|
-Wno-sign-compare \
|
||||||
|
-Wno-implicit-function-declaration \
|
||||||
|
-Wno-sometimes-uninitialized \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wno-enum-conversion \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-tautological-compare \
|
||||||
|
-Wno-missing-braces
|
||||||
|
|
||||||
|
LOCAL_CPP_EXTENSION := .cc
|
||||||
|
LOCAL_MODULE := libtim-vx
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_PRELINK_MODULE := false
|
||||||
|
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26 && echo OK),OK)
|
||||||
|
LOCAL_PROPRIETARY_MODULE := true
|
||||||
|
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/$(Target)
|
||||||
|
else
|
||||||
|
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
|
||||||
|
endif
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_CPP_EXTENSION := .cc
|
||||||
|
LOCAL_SRC_FILES := samples/lenet/lenet_asymu8.cc
|
||||||
|
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
|
||||||
|
LOCAL_SHARED_LIBRARIES := liblog libGAL libOpenVX libVSC libdl libtim-vx
|
||||||
|
LOCAL_MODULE := lenet_asymu8
|
||||||
|
LOCAL_MODULE_TAGS := optional
|
||||||
|
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
|
||||||
|
LOCAL_MODULE_CASS := EXECUTABLES
|
||||||
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
#
|
|
||||||
# Build Vivante chipinfo for android.
|
|
||||||
#
|
|
||||||
LOCAL_PATH:= $(call my-dir)
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
ifeq ($(AQROOT),)
|
|
||||||
$(error Please set AQROOT env first)
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(AQROOT)/Android.mk.def
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM_VENDOR),1)
|
|
||||||
LOCAL_VENDOR_MODULE := true
|
|
||||||
endif
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
vsi_nn_context.c \
|
|
||||||
vsi_nn_client_op.c \
|
|
||||||
vsi_nn_graph.c \
|
|
||||||
vsi_nn_node_attr_template.c \
|
|
||||||
vsi_nn_node.c \
|
|
||||||
vsi_nn_ops.c \
|
|
||||||
vsi_nn_daemon.c \
|
|
||||||
vsi_nn_tensor.c \
|
|
||||||
vsi_nn_version.c \
|
|
||||||
vsi_nn_rnn.c \
|
|
||||||
vsi_nn_rnn_helper.c \
|
|
||||||
vsi_nn_internal_node.c \
|
|
||||||
vsi_nn_log.c \
|
|
||||||
vsi_nn_graph_optimization.c \
|
|
||||||
vsi_nn_pre_post_process.c
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
client/vsi_nn_vxkernel.c
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
utils/vsi_nn_code_generator.c \
|
|
||||||
utils/vsi_nn_binary_tree.c \
|
|
||||||
utils/vsi_nn_map.c \
|
|
||||||
utils/vsi_nn_hashmap.c \
|
|
||||||
utils/vsi_nn_link_list.c \
|
|
||||||
utils/vsi_nn_math.c \
|
|
||||||
utils/vsi_nn_dtype.c \
|
|
||||||
utils/vsi_nn_dtype_util.c \
|
|
||||||
utils/vsi_nn_shape_util.c \
|
|
||||||
utils/vsi_nn_limits.c \
|
|
||||||
utils/vsi_nn_vdata.c \
|
|
||||||
utils/vsi_nn_tensor_op.c \
|
|
||||||
utils/vsi_nn_util.c \
|
|
||||||
utils/vsi_nn_constraint_check.c
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
quantization/vsi_nn_dynamic_fixed_point.c \
|
|
||||||
quantization/vsi_nn_asymmetric_affine.c \
|
|
||||||
quantization/vsi_nn_perchannel_symmetric_affine.c \
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
pycc/vsi_pycc_interface.c
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += \
|
|
||||||
post/vsi_nn_post_fasterrcnn.c \
|
|
||||||
post/vsi_nn_post_cmupose.c
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += libnnext/vsi_nn_libnnext_resource.c
|
|
||||||
|
|
||||||
LOCAL_SRC_FILES += kernel/vsi_nn_kernel.c \
|
|
||||||
kernel/vsi_nn_kernel_util.c \
|
|
||||||
kernel/vsi_nn_kernel_backend.c \
|
|
||||||
kernel/vsi_nn_kernel_eltwise.c \
|
|
||||||
kernel/vsi_nn_kernel_selector.c \
|
|
||||||
kernel/vsi_nn_kernel_node.c \
|
|
||||||
kernel/vsi_nn_kernel_param.c \
|
|
||||||
kernel/vsi_nn_kernel_gpu_shape_optimize.c \
|
|
||||||
kernel/vsi_nn_gpu.c
|
|
||||||
|
|
||||||
LIBNNEXT_KERNEL_SOURCES := $(wildcard $(LOCAL_PATH)/libnnext/ops/kernel/*.c)
|
|
||||||
LOCAL_SRC_FILES += $(LIBNNEXT_KERNEL_SOURCES:$(LOCAL_PATH)/%=%)
|
|
||||||
|
|
||||||
KERNEL_SOURCES := $(wildcard $(LOCAL_PATH)/kernel/cl/*.c)
|
|
||||||
KERNEL_SOURCES += $(wildcard $(LOCAL_PATH)/kernel/cpu/*.c)
|
|
||||||
KERNEL_SOURCES += $(wildcard $(LOCAL_PATH)/kernel/evis/*.c)
|
|
||||||
KERNEL_SOURCES += $(wildcard $(LOCAL_PATH)/kernel/vx/*.c)
|
|
||||||
KERNEL_SOURCES += $(wildcard $(LOCAL_PATH)/custom/ops/*.c)
|
|
||||||
KERNEL_SOURCES += $(wildcard $(LOCAL_PATH)/custom/ops/kernel/*.c)
|
|
||||||
LOCAL_SRC_FILES += $(KERNEL_SOURCES:$(LOCAL_PATH)/%=%)
|
|
||||||
|
|
||||||
OPERATION_SOURCES := $(wildcard $(LOCAL_PATH)/ops/*.c)
|
|
||||||
LOCAL_SRC_FILES += $(OPERATION_SOURCES:$(LOCAL_PATH)/%=%)
|
|
||||||
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
|
||||||
liblog \
|
|
||||||
libjpeg \
|
|
||||||
libGAL \
|
|
||||||
libOpenVX \
|
|
||||||
libVSC \
|
|
||||||
libdl
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES += \
|
|
||||||
external/libjpeg-turbo \
|
|
||||||
$(AQROOT)/sdk/inc/CL \
|
|
||||||
$(AQROOT)/sdk/inc/VX \
|
|
||||||
$(AQROOT)/sdk/inc/ \
|
|
||||||
$(AQROOT)/sdk/inc/HAL \
|
|
||||||
$(LOCAL_PATH)/../include \
|
|
||||||
$(LOCAL_PATH)/../include/ops \
|
|
||||||
$(LOCAL_PATH)/../include/utils \
|
|
||||||
$(LOCAL_PATH)/../include/infernce \
|
|
||||||
$(LOCAL_PATH)/../include/client \
|
|
||||||
$(LOCAL_PATH)/../include/libnnext
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := \
|
|
||||||
-DLINUX \
|
|
||||||
-D'OVXLIB_API=__attribute__((visibility("default")))' \
|
|
||||||
-DANDROID_SDK_VERSION=$(PLATFORM_SDK_VERSION)\
|
|
||||||
-Wno-sign-compare \
|
|
||||||
-Wno-implicit-function-declaration \
|
|
||||||
-Wno-sometimes-uninitialized \
|
|
||||||
-Wno-unused-parameter \
|
|
||||||
-Wno-enum-conversion \
|
|
||||||
-Wno-missing-field-initializers \
|
|
||||||
-Wno-tautological-compare \
|
|
||||||
-Wno-missing-braces
|
|
||||||
|
|
||||||
LOCAL_MODULE:= libovxlib
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
|
||||||
LOCAL_PRELINK_MODULE := false
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
Loading…
Reference in New Issue