Skip to content

Commit 9534c72

Browse files
author
Github Executorch
committed
Adding the build test for the neutron backend library.
1 parent 1c86b30 commit 9534c72

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.github/workflows/trunk.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ jobs:
245245
toolchain_cmake=$(realpath ${toolchain_cmake})
246246
247247
# Build and test size test
248-
bash test/build_size_test.sh "-DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON"
248+
bash test/build_size_test.sh "-DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} -DEXECUTORCH_BUILD_ARM_BAREMETAL=ON -DEXECUTORCH_BUILD_NXP_NEUTRON=ON"
249249
elf="cmake-out/test/size_test"
250250
251251
# Dump basic info
@@ -271,6 +271,15 @@ jobs:
271271
exit 1
272272
fi
273273
274+
# Build check for the neutron backend library
275+
lib_neutron = "cmake-out/backends/nxp/libexecutorch_delegate_neutron.a"
276+
if [ ! -f $(lib_neutron) ]; then
277+
echo "Neutron backend library not found!"
278+
exit 1
279+
else
280+
echo "Neutron backend library built."
281+
fi
282+
274283
test-coreml-delegate:
275284
name: test-coreml-delegate
276285
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main

backends/nxp/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
set(
77
_common_include_directories
88
${CMAKE_CURRENT_SOURCE_DIR}/../../..
9+
${CMAKE_CURRENT_SOURCE_DIR}/../../runtime/core/portable_type/c10
910
)
11+
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)
1012

1113
set(_neutron_sources ${CMAKE_CURRENT_SOURCE_DIR}/runtime/NeutronBackend.cpp )
1214

backends/nxp/runtime/NeutronBackend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ class NeutronBackend final : public PyTorchBackendInterface {
236236
// cfg->mcfg.kernels
237237
const uint8_t* transpositionFlags =
238238
static_cast<const uint8_t*>(processed->data());
239-
uint32_t numInputs = transpositionFlags[INPUT_TENSOR_FORMAT_LEN_POS];
240-
uint32_t numOutputs = transpositionFlags[OUTPUT_TENSOR_FORMAT_LEN_POS];
239+
int numInputs = transpositionFlags[INPUT_TENSOR_FORMAT_LEN_POS];
240+
int numOutputs = transpositionFlags[OUTPUT_TENSOR_FORMAT_LEN_POS];
241241
cfg->inputTranspositionFlags =
242242
INPUT_TENSOR_FORMAT_ARRAY_ADDR(transpositionFlags);
243243
cfg->outputTranspositionFlags =

0 commit comments

Comments
 (0)