VART-X  0.3.0
vart::PLKernel Class Reference

PLKernel class for managing PL kernel execution. More...

#include <vart_plkernel.hpp>

Public Member Functions

 PLKernel (PLKernelImplType type, const std::string &kernel_name, std::string &json_data, std::shared_ptr< Device > device)
 PLKernel() - Constructs a PLKernel object. More...
 
 PLKernel (std::shared_ptr< PLKernelImplBase > ptr)
 PLKernel() - Constructs a PLKernel object with a given implementation pointer. More...
 
const std::shared_ptr< PLKernelImplBase > & get_pimpl_handle () const
 get_pimpl_handle() - Gives pointer to implementation class. More...
 
template<typename... Args>
void process (Args &&... args)
 process() - Set and process the given arguments on Kernel. More...
 
int wait (unsigned int timeout)
 wait() - Waits for the kernel to complete processing. 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

PLKernel class for managing PL kernel execution.

See also
PLKernelImplBase

Constructor & Destructor Documentation

◆ PLKernel() [1/2]

vart::PLKernel::PLKernel ( PLKernelImplType  type,
const std::string &  kernel_name,
std::string &  json_data,
std::shared_ptr< Device device 
)

PLKernel() - Constructs a PLKernel object.

Parameters
[in]typeThe type of the kernel implementation. See PLKernelImplType for supported types.
[in]kernel_nameThe name of the kernel.
[in]json_dataThe JSON data for the kernel configuration.
[in]deviceThe device on which the kernel will run. Must be non-null. See vart::Device for more details.

◆ PLKernel() [2/2]

vart::PLKernel::PLKernel ( std::shared_ptr< PLKernelImplBase ptr)

PLKernel() - Constructs a PLKernel object with a given implementation pointer.

Parameters
[in]ptrA shared pointer to the kernel implementation.

Member Function Documentation

◆ get_config()

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

get_config() - Gets the configuration of the kernel.

Template Parameters
PLKernelAnyInfoThe type of the configuration information. The XRT backend always writes a std::vector<vart::ArgumentInfo>; passing any other type causes std::bad_any_cast (rethrown as std::runtime_error) on the trailing any_cast inside this template.
Parameters
[out]infoThe configuration information. Overwritten on return.

◆ get_pimpl_handle()

const std::shared_ptr<PLKernelImplBase>& vart::PLKernel::get_pimpl_handle ( ) const

get_pimpl_handle() - Gives pointer to implementation class.

Returns
Returns a constant reference of pointer to implementation class.

◆ process()

template<typename... Args>
void vart::PLKernel::process ( Args &&...  args)
inline

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

Template Parameters
ArgsVariadic template arguments
Parameters
[in]argsArguments to be processed. Scalar/pointer arguments are bound to the kernel in the order supplied.

◆ set_config()

template<typename PLKernelAnyInfo >
void vart::PLKernel::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.

◆ wait()

int vart::PLKernel::wait ( unsigned int  timeout)

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
An integer indicating the status.

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