ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::api::CustomKernelRegistry Class Reference

#include <CustomKernelRegistry.h>

Public Member Functions

void registerKernel (const std::string &id, nnfw_custom_eval evalFunction)
 
std::shared_ptr< backend::custom::IKernelBuildergetBuilder ()
 
std::unique_ptr< CustomKernelbuildKernelForOp (const std::string &id)
 

Detailed Description

Definition at line 33 of file CustomKernelRegistry.h.

Member Function Documentation

◆ buildKernelForOp()

std::unique_ptr< CustomKernel > onert::api::CustomKernelRegistry::buildKernelForOp ( const std::string &  id)

Definition at line 53 of file CustomKernelRegistry.cc.

54{
55 auto it = _storage.find(id);
56 if (it == _storage.end())
57 {
58 throw std::runtime_error("Unable to find associated kernel for op");
59 }
60
61 return std::make_unique<CustomKernel>(it->second);
62}

Referenced by onert::api::KernelBuilder::buildKernel().

◆ getBuilder()

std::shared_ptr< backend::custom::IKernelBuilder > onert::api::CustomKernelRegistry::getBuilder ( )

Definition at line 48 of file CustomKernelRegistry.cc.

49{
50 return std::make_unique<KernelBuilder>(this);
51}

◆ registerKernel()

void onert::api::CustomKernelRegistry::registerKernel ( const std::string &  id,
nnfw_custom_eval  evalFunction 
)

Definition at line 43 of file CustomKernelRegistry.cc.

44{
45 _storage.emplace(id, evalFunction);
46}

The documentation for this class was generated from the following files: