CCodegenFacade
Facade to export a high-level model or a prebuilt ComputeGraph into Arduino C code.
This facade follows the ModelExportFacade pattern from skainet-compile-json, providing consistent API patterns for different input types while integrating CCodeGenerator and ArduinoLibraryPackager components.
Capabilities:
If model is already a ComputeGraph, delegates to exportGraphToArduinoLibrary.
Otherwise, prefer using the overload that accepts a forwardPass lambda to run a single forward execution under a recording tape; the tape is then converted to a ComputeGraph and exported.
Functions
Link copied to clipboard
fun exportGraphToArduinoLibrary(graph: ComputeGraph, outputPath: String, libraryName: String): ArduinoLibraryResult
Exports a ComputeGraph directly to an Arduino library.
Link copied to clipboard
fun <T : Any> exportToArduinoLibrary(model: T, outputPath: String, libraryName: String = model::class.simpleName ?: "SKaiNETModel"): ArduinoLibraryResult
Exports a model to an Arduino library.
fun <T : Any> exportToArduinoLibrary(model: T, forwardPass: (ExecutionContext) -> Unit, outputPath: String, libraryName: String = model::class.simpleName ?: "SKaiNETModel"): ArduinoLibraryResult
Fallback overload for models without a direct adapter.