ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 55 of file CustomKernelRegistry.cc.

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

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

◆ getBuilder()

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

Definition at line 50 of file CustomKernelRegistry.cc.

51{
52 return std::make_unique<KernelBuilder>(this);
53}

◆ registerKernel()

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

Definition at line 45 of file CustomKernelRegistry.cc.

46{
47 _storage.emplace(id, evalFunction);
48}

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