Hello, I have a task for implementing tvm codegen generating code from relay operators to an external DSP accelerator with has a C API.
The accelerator API include c functions API, such as:
Void f1 (int* a, int* b char* c);
Void f2 (float* a, int_64* b char* c);
Each operator can be matched with one or several DSP API functions, or alternatively Several relay operators can be matched with one or several API accelerator function.
The issue is that the implementation must be modular.
It should be relatively easy for the user to register relay ops to the corresponding DSP C API functions. Therefore, I would like to create some sort of data structure/dictionary that will map operators to corresponding DSP C API functions.
the API can be in python for example. and the user will be able to add a new entry for relay op and map it to the external API.
It should also include a function per operator that returns true, depending on input and output type, if it can be implemented with the aforementioned API.
This data structure/dictionary with be used in the codegen.
Can someone advice how to define create such a data structure/dictionary which is agnostic of the IR?