Class cv::GKernelPackage#

A container class for heterogeneous kernel implementation collections and graph transformations. View details

Collaboration diagram for cv::GKernelPackage:

Friends#

Return

Name

Description

GKernelPackage

cv::gapi::combine(const GKernelPackage &lhs, const GKernelPackage &rhs)

Create a new package based on lhs and rhs.

Detailed Description#

A container class for heterogeneous kernel implementation collections and graph transformations.

GKernelPackage is a special container class which stores kernel implementations and graph transformations. Objects of this class are created and passed to cv::GComputation::compile() to specify which kernels to use and which transformations to apply in the compiled graph. GKernelPackage may contain kernels of different backends, e.g. be heterogeneous.

The most easy way to create a kernel package is to use function cv::gapi::kernels(). This template functions takes kernel implementations in form of type list (variadic template) and generates a kernel package atop of that.

Kernel packages can be also generated programmatically, starting with an empty package (created with the default constructor) and then by populating it with kernels via call to GKernelPackage::include(). Note this method is also a template one since G-API kernel and transformation implementations are types, not objects.

Finally, two kernel packages can be combined into a new one with function cv::gapi::combine().

Member Typedef Documentation#

M#

typedef std::unordered_map< std::string, std::pair< cv::gapi::GBackend, cv::GKernelImpl > > cv::GKernelPackage::M

Member Function Documentation#

includeHelper()#

template<typename KImpl>
std::enable_if<(std::is_base_of< cv::detail::KernelTag, KImpl >::value), void >::type cv::GKernelPackage::includeHelper()

includeHelper()#

template<typename TImpl>
std::enable_if<(std::is_base_of< cv::detail::TransformTag, TImpl >::value), void >::type cv::GKernelPackage::includeHelper()

includesAPI()#

bool cv::GKernelPackage::includesAPI(const std::string & id)

lookup()#

std::pair< cv::gapi::GBackend, cv::GKernelImpl > cv::GKernelPackage::lookup(const std::string & id)

removeAPI()#

void cv::GKernelPackage::removeAPI(const std::string & id)

backends()#

std::vector< cv::gapi::GBackend > cv::GKernelPackage::backends()

Lists all backends which are included into package.

Returns

vector of backends

get_kernel_ids()#

std::vector< std::string > cv::GKernelPackage::get_kernel_ids()

Returns vector of kernel ids included in the package.

Returns

vector of kernel ids included in the package

get_transformations()#

const std::vector< GTransform > & cv::GKernelPackage::get_transformations()

Returns vector of transformations included in the package.

Returns

vector of transformations included in the package

include()#

template<typename KImpl>
void cv::GKernelPackage::include()

Put a new kernel implementation or a new transformation KImpl into the package.

include()#

void cv::GKernelPackage::include(
const cv::gapi::GBackend & backend,
const std::string & kernel_id )

Adds a new kernel based on it’s backend and id into the kernel package.

Parameters

  • backend — backend associated with the kernel

  • kernel_id — a name/id of the kernel

include()#

void cv::GKernelPackage::include(const cv::gapi::GFunctor & functor)

includes()#

template<typename KImpl>
bool cv::GKernelPackage::includes()

Test if a particular kernel implementation KImpl is included in this kernel package.

See also

includesAPI()

Note

cannot be applied to transformations

Returns

true if there is such kernel, false otherwise.

includesAPI()#

template<typename KAPI>
bool cv::GKernelPackage::includesAPI()

Check if package contains ANY implementation of a kernel API by API type.

lookup()#

template<typename KAPI>
cv::gapi::GBackend cv::GKernelPackage::lookup()

Find a kernel (by its API)

Returns implementation corresponding id. Throws if nothing found.

Returns

Backend which hosts matching kernel implementation.

remove()#

template<typename KAPI>
void cv::GKernelPackage::remove()

Remove all kernels implementing the given API from the package.

Does nothing if there’s no kernels implementing the given interface.

remove()#

void cv::GKernelPackage::remove(const cv::gapi::GBackend & backend)

Remove all kernels associated with the given backend from the package.

Does nothing if there’s no kernels of this backend in the package.

Parameters

  • backend — backend which kernels to remove

size()#

GAPI_WRAP std::size_t cv::GKernelPackage::size()

Python:

cv.GKernelPackage.size() -> retval

Returns total number of kernels in the package (across all backends included)

Returns

a number of kernels in the package

Member Data Documentation#

m_id_kernels#

M cv::GKernelPackage::m_id_kernels

m_transformations#

std::vector< GTransform > cv::GKernelPackage::m_transformations

Source file#

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