Skip to content

[Design] tensor-filter HAL for layer separation #4660

Open
@myungjoo

Description

@myungjoo

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 ==>
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

}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions