Skip to content
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
3 changes: 3 additions & 0 deletions cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ if (LITE_WITH_NNADAPTER)
if (NNADAPTER_WITH_KUNLUNXIN_XTCL)
add_definitions("-DNNADAPTER_WITH_KUNLUNXIN_XTCL")
endif()
if (NNADAPTER_WITH_ANDROID_NNAPI)
add_definitions("-DNNADAPTER_WITH_ANDROID_NNAPI")
endif()
endif()
endif()

Expand Down
4 changes: 4 additions & 0 deletions lite/backends/nnadapter/nnadapter/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ endif()
if(NNADAPTER_WITH_KUNLUNXIN_XTCL)
add_subdirectory(kunlunxin_xtcl)
endif()

if(NNADAPTER_WITH_ANDROID_NNAPI)
add_subdirectory(android_nnapi)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set(DEVICE_NAME android_nnapi)
add_definitions(-DNNADAPTER_DEVICE_NAME=${DEVICE_NAME})
add_definitions(-DNNADAPTER_DEVICE_SYMBOL=${NNADAPTER_DEVICE_SYMBOL_PREFIX}${DEVICE_NAME})

include(dependencies.cmake)

aux_source_directory(converter CONVERTERS)
aux_source_directory(optimizer OPTIMIZERS)
set(SRCS nnapi_implementation.cc utility.cc ${OPTIMIZERS} ${CONVERTERS} engine.cc driver.cc)
set(DEPS ${NNADAPTER_CORE} ${NNADAPTER_UTILITIES} nnadapter_optimizer_symm2asymm nnadapter_optimizer_nchw2nhwc nnadapter_optimizer_fuse_matmul_add_into_fully_connected ${${DEVICE_NAME}_deps})

add_library(${DEVICE_NAME} SHARED ${SRCS})
target_link_libraries(${DEVICE_NAME} "-Wl,--start-group" ${DEPS} "-Wl,--end-group")
set(NNADAPTER_DEVICES ${NNADAPTER_DEVICES} ${DEVICE_NAME} CACHE INTERNAL "")
Loading