Skip to content
Draft
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 .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,9 @@ jobs:
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"

# Install the eIQ Neutron SDK (provides the Neutron driver headers)
pip install -r backends/nxp/requirements-eiq.txt

# Build
cmake -DEXECUTORCH_BUILD_NXP_NEUTRON=ON -DEXECUTORCH_BUILD_NXP_NEUTRON_EXTERNAL_MEM=ON -Bcmake-out .
cmake --build cmake-out --target executorch_delegate_neutron --config Release
Expand Down
4 changes: 3 additions & 1 deletion backends/nxp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/neutron_sdk.cmake)

set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)

Expand All @@ -15,7 +17,7 @@ set(_neutron_sources ${CMAKE_CURRENT_SOURCE_DIR}/runtime/NeutronBackend.cpp)
add_library(executorch_delegate_neutron STATIC ${_neutron_sources})
target_include_directories(
executorch_delegate_neutron
PRIVATE ${_common_include_directories}
PRIVATE ${_common_include_directories} ${EIQ_NEUTRON_TARGET_INCLUDE_DIR}
${PROJECT_SOURCE_DIR}/runtime/core/portable_type/c10
)
install(
Expand Down
48 changes: 48 additions & 0 deletions backends/nxp/cmake/neutron_sdk.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2026 NXP
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Locates the eIQ Neutron SDK and the selected target. Sets:
# EIQ_NEUTRON_TARGET_DIR, EIQ_NEUTRON_TARGET_INCLUDE_DIR.

if(NOT DEFINED EIQ_NEUTRON_TARGET)
set(EIQ_NEUTRON_TARGET
"imxrt700"
CACHE STRING "Neutron Target to build against"
)
endif()

find_package(
Python
COMPONENTS Interpreter
REQUIRED
)

message(STATUS "Looking for eIQ Neutron SDK")
execute_process(
COMMAND
${Python_EXECUTABLE} -c
"import eiq_neutron_sdk, os; print(os.path.dirname(eiq_neutron_sdk.__file__))"
OUTPUT_VARIABLE EIQ_NEUTRON_SDK_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Looking for eIQ Neutron SDK -- found: ${EIQ_NEUTRON_SDK_PATH}")

message(STATUS "Looking for Neutron target ${EIQ_NEUTRON_TARGET}")
set(EIQ_NEUTRON_TARGET_DIR
"${EIQ_NEUTRON_SDK_PATH}/target/${EIQ_NEUTRON_TARGET}"
)
if(NOT EXISTS ${EIQ_NEUTRON_TARGET_DIR})
message(
FATAL_ERROR "Looking for Neutron target ${EIQ_NEUTRON_TARGET} -- not found"
)
endif()
message(
STATUS
"Looking for Neutron target ${EIQ_NEUTRON_TARGET} -- found: ${EIQ_NEUTRON_TARGET_DIR}"
)

set(EIQ_NEUTRON_TARGET_INCLUDE_DIR "${EIQ_NEUTRON_TARGET_DIR}/common/include"
"${EIQ_NEUTRON_TARGET_DIR}/driver/include"
)
4 changes: 2 additions & 2 deletions backends/nxp/runtime/NeutronBackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include <executorch/runtime/core/event_tracer_hooks_delegate.h>
#include <executorch/runtime/core/exec_aten/util/dim_order_util.h>

#include "NeutronDriver.h"
#include "NeutronErrors.h"
#include <NeutronDriver.h>
#include <NeutronErrors.h>

using namespace std;

Expand Down
278 changes: 0 additions & 278 deletions backends/nxp/runtime/NeutronDriver.h

This file was deleted.

Loading
Loading