Skip to content
Snippets Groups Projects
Commit f5c02edf authored by Thibault Allenet's avatar Thibault Allenet Committed by Olivier BICHLER
Browse files

Export when Aidge Datatype isn't convertible into cpp type then set cpp export type to None

parent 61b9a632
No related branches found
No related tags found
2 merge requests!318[Upd] release verision 0.5.0,!262Low bit support for ARM Cortex-M export
...@@ -19,6 +19,8 @@ datatype_converter_aide2c = { ...@@ -19,6 +19,8 @@ datatype_converter_aide2c = {
def aidge2c(datatype): def aidge2c(datatype):
"""Convert a aidge datatype to C type """Convert a aidge datatype to C type
If the type is not convertible to a C type (e.g. int4), return None and raise a warning.
:param datatype: Aidge datatype to convert :param datatype: Aidge datatype to convert
:type datatype: :py:object:`aidge_core.DataType` :type datatype: :py:object:`aidge_core.DataType`
:return: A string representing the C type :return: A string representing the C type
...@@ -27,4 +29,6 @@ def aidge2c(datatype): ...@@ -27,4 +29,6 @@ def aidge2c(datatype):
if datatype in datatype_converter_aide2c: if datatype in datatype_converter_aide2c:
return datatype_converter_aide2c[datatype] return datatype_converter_aide2c[datatype]
else: else:
raise ValueError(f"Unsupported {datatype} aidge datatype") # raise ValueError(f"Unsupported {datatype} aidge datatype")
aidge_core.Log.warn(f"Unsupported conversion of {datatype} (aidge datatype) to a C type.")
return None
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