VART-X  0.3.0
vart::PLKernelImplBase Class Referenceabstract

Abstract interface for PLKernel implementation used by PLKernel. More...

#include <vart_plkernel_impl_base.hpp>

Public Member Functions

 PLKernelImplBase ()=default
 Default constructor. More...
 
virtual ~PLKernelImplBase ()
 Virtual destructor to ensure proper cleanup of derived implementations. More...
 
virtual void process (const std::vector< std::any > &args)=0
 process() - Set and process the given arguments on Kernel. More...
 
virtual int wait (unsigned int timeout)=0
 wait() - Waits for the kernel to complete processing. More...
 
virtual void set_config_impl (const std::any &info)=0
 set_config_impl() - Set configuration using a non-template virtual function. More...
 
virtual void get_config_impl (std::any &info)=0
 get_config_impl() - Gets configuration using a non-template virtual function. More...
 
template<typename PLKernelAnyInfo >
void set_config (PLKernelAnyInfo &info)
 set_config() - Sets the configuration for the kernel. More...
 
template<typename PLKernelAnyInfo >
void get_config (PLKernelAnyInfo &info)
 get_config() - Gets the configuration of the kernel. More...
 

Detailed Description

Abstract interface for PLKernel implementation used by PLKernel.

Note
Applications should use vart::PLKernel rather than this type directly, unless extending or integrating a new backend.

Constructor & Destructor Documentation

◆ PLKernelImplBase()

vart::PLKernelImplBase::PLKernelImplBase ( )
default

Default constructor.

◆ ~PLKernelImplBase()

virtual vart::PLKernelImplBase::~PLKernelImplBase ( )
inlinevirtual

Virtual destructor to ensure proper cleanup of derived implementations.

Member Function Documentation

◆ get_config()

template<typename PLKernelAnyInfo >
void vart::PLKernelImplBase::get_config ( PLKernelAnyInfo &  info)
inline

get_config() - Gets the configuration of the kernel.

Template Parameters
PLKernelAnyInfoThe type of the configuration information.
Parameters
[out]infoPopulated with the current kernel configuration on return.

◆ get_config_impl()

virtual void vart::PLKernelImplBase::get_config_impl ( std::any &  info)
pure virtual

get_config_impl() - Gets configuration using a non-template virtual function.

Template Parameters
PLKernelAnyInfoThe type of the configuration information.
Parameters
[out]infoPopulated with the current kernel configuration on return.

◆ process()

virtual void vart::PLKernelImplBase::process ( const std::vector< std::any > &  args)
pure virtual

process() - Set and process the given arguments on Kernel.

Parameters
[in]argsArguments to be processed, type-erased through std::any. Each element is bound to the corresponding kernel argument slot in sequence. Implementations are expected to throw std::runtime_error for an unknown / unsupported element type.

Use this method to set any type of arguments required by the kernel. This method can pass any type and any number of arguments.

◆ set_config()

template<typename PLKernelAnyInfo >
void vart::PLKernelImplBase::set_config ( PLKernelAnyInfo &  info)
inline

set_config() - Sets the configuration for the kernel.

Template Parameters
PLKernelAnyInfoThe type of the configuration information.
Parameters
[in]infoThe configuration information to apply to the kernel.

◆ set_config_impl()

virtual void vart::PLKernelImplBase::set_config_impl ( const std::any &  info)
pure virtual

set_config_impl() - Set configuration using a non-template virtual function.

Template Parameters
PLKernelAnyInfoThe type of the configuration information.
Parameters
[in]infoThe configuration information to apply to the kernel.

Templates cannot be declared as virtual in C++. To work around this, we can use a non-template virtual function in the base class and then use template methods in the derived class to handle the specific types

◆ wait()

virtual int vart::PLKernelImplBase::wait ( unsigned int  timeout)
pure virtual

wait() - Waits for the kernel to complete processing.

Parameters
[in]timeoutTimeout in milliseconds. A value of 0 means block until the run completes (no timeout).
Returns
Integer indicating the backend run state. Implementations may return -1 if they internally catch an exception while waiting.

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