Open
Description
Approach A.
- Interface in C struct with function pointers
- Caution: there can be 2 or more instances of NPU HAL objects! (we already have one coming soon)
- Keep C++ (tensor_filter_subplugin of nnstreamer 2.4.x as HAL 2.0) semantics, but interface in C
- Each C++ method ==> 3 C functions of HAL
- E.g.,
tensor_filter_subplugin::configure_instance
==>
- E.g.,
- Each C++ method ==> 3 C functions of HAL
int func_tensor_filter_subplugin_HAL_configure_instance_prepare (struct X(tbd), void **ptr);
int func_tensor_filter_subplugin_HAL_configure_instance_main (struct X(tbd), void **ptr);
int func_tensor_filter_subplugin_HAL_configure_instance_post (struct X(tbd), void **ptr);
- Then, the upper layer (the subplugin in C++) calls:
thehardware::configure_instance(P) {
// some C++ code that needs to interact with nnstreamer
someptr->configure_instance_prepare (converter(P. TBD), this->ptr);
// some C++ code that needs to interact with nnstreamer
someptr->configure_instance_main (converter(P. TBD), this->ptr);
// some C++ code that needs to interact with nnstreamer
someptr->configure_instance_post (converter(P. TBD), this->ptr);
// some C++ code that needs to interact with nnstreamer
}