Skip to content

Commit b94a1d5

Browse files
committed
Adding NXP runtime.
1 parent 4559a61 commit b94a1d5

File tree

5 files changed

+745
-0
lines changed

5 files changed

+745
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ option(EXECUTORCH_BUILD_ARM_BAREMETAL
170170
"Build the Arm Baremetal flow for Cortex-M and Ethos-U" OFF
171171
)
172172

173+
option(EXECUTORCH_BUILD_NXP_NEUTRON "Build the NXP Neutron NPU library" OFF)
174+
173175
option(EXECUTORCH_BUILD_COREML "Build the Core ML backend" OFF)
174176

175177
option(EXECUTORCH_BUILD_KERNELS_CUSTOM "Build the custom kernels" OFF)
@@ -710,6 +712,10 @@ if(EXECUTORCH_BUILD_CADENCE)
710712
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/cadence)
711713
endif()
712714

715+
if(EXECUTORCH_BUILD_NXP_NEUTRON)
716+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/nxp)
717+
endif()
718+
713719
if(EXECUTORCH_BUILD_COREML)
714720
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backends/apple/coreml)
715721
endif()

backends/nxp/CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2024 NXP
2+
#
3+
# This source code is licensed under the BSD-style license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
cmake_minimum_required(VERSION 3.19)
7+
project(neutron_backend)
8+
9+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
10+
11+
# Source root directory for executorch.
12+
if(NOT EXECUTORCH_ROOT)
13+
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..)
14+
endif()
15+
16+
include(${EXECUTORCH_ROOT}/tools/cmake/Utils.cmake)
17+
18+
set(_common_include_directories ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10)
19+
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)
20+
21+
set(_neutron_sources backends/nxp/runtime/NeutronBackend.cpp )
22+
23+
list(TRANSFORM _neutron_sources PREPEND "${EXECUTORCH_ROOT}/")
24+
25+
add_library(executorch_delegate_neutron STATIC ${_neutron_sources})
26+
target_include_directories(
27+
executorch_delegate_neutron PUBLIC ${_common_include_directories}
28+
)

0 commit comments

Comments
 (0)