Skip to content
Snippets Groups Projects
Commit 14b473c3 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Fix export path.

parent 553c7af0
No related branches found
No related tags found
1 merge request!17v0.1.0
Pipeline #60952 passed
......@@ -3,7 +3,12 @@
Use this module to generate CPP exports for ARM CortexM boards.
This module has to be used with the Aidge suite
"""
from pathlib import Path
FILE = Path(__file__).resolve()
ROOT = FILE.parents[0]
from .export import *
from .export_registry import ExportLibAidgeARM, ExportLibCMSISNN
from .operators import *
import os
import shutil
from pathlib import Path
from aidge_export_arm_cortexm.utils import (ROOT, AVAILABLE_BOARDS, has_board)
from aidge_export_arm_cortexm import ROOT
from aidge_export_arm_cortexm.export_registry import ExportLibAidgeARM
# from aidge_export_arm_cortexm.utils.converter import numpy_dtype2ctype
......@@ -50,7 +50,3 @@ def gen_board_files(path:str, board:str)->None:
# Copy all static files in the export
shutil.copytree(BOARDS_MAP[board], str(path), dirs_exist_ok=True)
# For N2D2 library, copy static folder to export/include
dnn_include_folder = dnn_folder / "include"
os.makedirs(str(dnn_include_folder), exist_ok=True)
shutil.copytree(str(ROOT / "_N2D2" / "static"), str(dnn_include_folder), dirs_exist_ok=True)
......@@ -7,14 +7,30 @@ from typing import Tuple, List
import aidge_core
from aidge_core.export_utils import ExportNode, ExportNodeCpp
from aidge_core.export_utils.code_generation import *
from aidge_export_arm_cortexm.utils import ROOT
from aidge_export_arm_cortexm.utils.converter import numpy_dtype2ctype
from aidge_export_arm_cortexm.utils.generation import *
from aidge_export_arm_cortexm import ROOT
from aidge_export_arm_cortexm.export_registry import ExportLibAidgeARM
##############################################
############## Export functions ##############
##############################################
# Note: to remove
def numpy_dtype2ctype(dtype):
if dtype == np.int8:
return "int8_t"
elif dtype == np.int16:
return "int16_t"
elif dtype == np.int32:
return "int32_t"
elif dtype == np.int64:
return "int64_t"
elif dtype == np.float32:
return "float"
elif dtype == np.float64:
return "double"
# Add more dtype mappings as needed
else:
raise ValueError(f"Unsupported {dtype} dtype")
def export_params(name:str,
array: np.ndarray,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment