Skip to content

Commit

Permalink
Add cmake support
Browse files Browse the repository at this point in the history
  • Loading branch information
lukamac committed Feb 28, 2024
1 parent a82c048 commit d12a11e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.18)

project(pulp-nnx
VERSION 0.3.0
DESCRIPTION "Kernel library for PULP-based NN accelerators."
LANGUAGES C)

add_library(pulp-nnx STATIC)

target_sources(pulp-nnx PRIVATE util/pulp_nnx_util.c util/hwpe.c)
target_include_directories(pulp-nnx PUBLIC inc util)

option(USE_NE16 "Use the NE16 accelerator.")
option(USE_NEUREKA "Use the N-EUREKA accelerator.")

if (NOT ${USE_NE16} AND NOT ${USE_NEUREKA})
message(FATAL_ERROR "[PULP-NNX] No accelerator in use. Please set an appropriate USE_<acc> option.")
endif()

if (${USE_NE16})
message(STATUS "[PULP-NNX] Using the NE16 accelerator.")
target_sources(pulp-nnx
PRIVATE
ne16/bsp/ne16_pulp_bsp.c
ne16/hal/ne16.c
ne16/hal/ne16_task.c
src/pulp_nnx_ne16.c
)
target_include_directories(pulp-nnx
PUBLIC
ne16/bsp
ne16/hal
ne16/gvsoc
)
endif()

if (${USE_NEUREKA})
message(STATUS "[PULP-NNX] Using the N-EUREKA accelerator.")
target_sources(pulp-nnx
PRIVATE
neureka/bsp/neureka_siracusa_bsp.c
neureka/hal/neureka.c
neureka/hal/neureka_task.c
src/pulp_nnx_neureka.c
)
target_include_directories(pulp-nnx
PUBLIC
neureka/bsp
neureka/hal
neureka/gvsoc
)
endif()

0 comments on commit d12a11e

Please sign in to comment.