SDK

Starting with v0.4.1 SOL comes with the option to add user defined plugins. To use the SOL SDK you first need to install nec-sol install sdk. Then go to the path where sol is installed (usually under .local/lib/python*/sol), go to the sdk folder. Within the example folder you can find different kinds of SOL plugins.

You can build these examples using:

cmake -DCMAKE_MODULE_PATH=/path/to/sol/sdk /path/to/sol/sdk/examples/type/
make

To test if your plugin works, you need to copy it to /path/to/sol/lib64 and run python3 -m sol. It will display an overview of all loaded plugins.

##############################################################################

SOL Compiler Plugins:
    Devices:     [x86, ve]
    Frameworks:  [pytorch, dl4j, onnx]
    Deployments: [static_lib, shared_lib]
    Backends:    [dfp::ncc, dnn::nnpack, dnn::mkl, dnn::veblas, dnn::cublas, dnn::dnnl, dfp::ispc, dnn::veasl, dnn::vednn]
    Jits:        [gcc, ncc, dot, ispc, python]

SOL Runtime Plugins:
    x86          [dfp::ispc, none]
    ve           [dnn::veblas, dnn::veasl, dnn::vednn, none]

##############################################################################

If your plugin is not shown within this view, please run SOL_LOG=TRACE python3 -m sol and check why SOL rejects your plugin.

SOL Plugin Infrastructure

SOL plugins are versions and can only be loaded for the specific version they have been build for. Further, SOL plugins enforce specific namespace conventions. The following macros can be used to register the necessary callbacks within the SOL plugin:

#define SOL_REGISTER_PLUGIN()
#define SOL_REGISTER_BACKEND(TYPE)	
#define SOL_REGISTER_BACKEND_COMPILER(TYPE, ...)
#define SOL_REGISTER_BACKEND_RUNTIME(TYPE, ...)
#define SOL_REGISTER_DEPLOYMENT(TYPE)
#define SOL_REGISTER_DEPLOYMENT_COMPILER(TYPE)
#define SOL_REGISTER_DEVICE(TYPE)	
#define SOL_REGISTER_DEVICE_COMPILER(TYPE, LINKER)
#define SOL_REGISTER_DEVICE_RUNTIME(DEVICE)
#define SOL_REGISTER_FRAMEWORK(TYPE)
#define SOL_REGISTER_FRAMEWORK_COMPILER(TYPE)
#define SOL_REGISTER_FRAMEWORK_RUNTIME(FRAMEWORK, DEVICE)
#define SOL_REGISTER_JIT(TYPE)		
#define SOL_REGISTER_JIT_COMPILER(TYPE)

In theory you can mix all of these components within one plugin, but it is not recommended to do that. Please take a look at the examples provided in /path/to/sol/sdk/examples to see how these functions are used and how the namespace needs to be setup.