Ah no worries, this makes more sense.
I think this is mainly convention and a way to avoid #include "../../../../target/source/source_module.h"
.
These are two different styles of BYOC implementations–DNNL was added earlier than CMSIS-NN, and CMSIS-NN uses a different code-lowering path to take advantage of USMP I believe. DNNL offloads directly from the Relay graph, meaning the compiler doesn’t see any IR that might allow it to e.g. perform memory planning. CMSIS-NN uses the newly-added Relay-to-TIR and TIR-to-Runtime Target hooks. I believe it also modifies constants to adapt them to the format expected by CMSIS-NN.
I don’t think in this case it makes senes to pass variables
to CSourceModuleCreate
, because it’s not possible to use ConstLoaderModule
in the C runtime. In any case, I think that error would be caused by something in variables
not being a string.
The ARM CMSIS-NN TIR-to-Runtime hook seems to use the C++ binding. I think that should be fine for you to use (should be equivalent to passing variables
as an empty list).