From d12a11e9678b7abccd919cafdd26efd395343874 Mon Sep 17 00:00:00 2001 From: Luka Macan Date: Thu, 1 Feb 2024 09:45:13 +0100 Subject: [PATCH] Add cmake support --- CMakeLists.txt | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..171ef04 --- /dev/null +++ b/CMakeLists.txt @@ -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_ 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()