ONE - On-device Neural Engine
|
Class to manage loading and unloading of dynamic library containing implementation of ICodegen interface. More...
#include <CodegenLoader.h>
Public Types | |
using | dlhandle_destroy_t = std::function< void(void *)> |
Typedef for function pointer to destroy loaded library handle. | |
using | factory_t = ICodegen *(*)() |
Typedef for function pointer to create instance of ICodegen. | |
using | codegen_destory_t = void(*)(ICodegen *) |
Typedef for function pointer to destroy instance of ICodegen. | |
Public Member Functions | |
CodegenLoader (CodegenLoader const &)=delete | |
CodegenLoader & | operator= (CodegenLoader const &)=delete |
void | loadLibrary (const char *target) |
Load dynamic library containing implementation of ICodegen. | |
void | unloadLibrary () |
Unload dynamic library containing implementation of ICodegen. | |
const ICodegen * | get () const |
Get instance of ICodegen created through factory method. | |
Static Public Member Functions | |
static CodegenLoader & | instance () |
Get singleton instance of CodegenLoader. | |
Class to manage loading and unloading of dynamic library containing implementation of ICodegen interface.
Definition at line 34 of file CodegenLoader.h.
using onert::odc::CodegenLoader::codegen_destory_t = void (*)(ICodegen *) |
Typedef for function pointer to destroy instance of ICodegen.
Definition at line 48 of file CodegenLoader.h.
using onert::odc::CodegenLoader::dlhandle_destroy_t = std::function<void(void *)> |
Typedef for function pointer to destroy loaded library handle.
Definition at line 40 of file CodegenLoader.h.
using onert::odc::CodegenLoader::factory_t = ICodegen *(*)() |
Typedef for function pointer to create instance of ICodegen.
Definition at line 44 of file CodegenLoader.h.
|
delete |
|
inline |
Get instance of ICodegen created through factory method.
Definition at line 85 of file CodegenLoader.h.
Referenced by loadLibrary(), and unloadLibrary().
|
static |
Get singleton instance of CodegenLoader.
Definition at line 35 of file CodegenLoader.cc.
Referenced by onert::odc::CodegenManager::codegen().
void onert::odc::CodegenLoader::loadLibrary | ( | const char * | target | ) |
Load dynamic library containing implementation of ICodegen.
[in] | target | Target backend name This target string will be used to find a backend library. The name of target backend library should follow the following rules: 'lib' + {backend extension} + '-gen' + {lib extension} And the target string should be a name except 'lib' and {lib extension}. For example, if the backend extension is 'aaa', the backend library name should be 'libaaa-gen.so', and the target string should be 'aaa-gen'. |
Definition at line 41 of file CodegenLoader.cc.
References get().
|
delete |
void onert::odc::CodegenLoader::unloadLibrary | ( | ) |
Unload dynamic library containing implementation of ICodegen.
Definition at line 81 of file CodegenLoader.cc.
References get().