Kompute
Public Member Functions | List of all members
kp::OpBase Class Referenceabstract

#include <OpBase.hpp>

Inheritance diagram for kp::OpBase:
Inheritance graph
[legend]

Public Member Functions

virtual ~OpBase ()
 
virtual void record (const vk::CommandBuffer &commandBuffer)=0
 
virtual void preEval (const vk::CommandBuffer &commandBuffer)=0
 
virtual void postEval (const vk::CommandBuffer &commandBuffer)=0
 

Detailed Description

Base Operation which provides the high level interface that Kompute operations implement in order to perform a set of actions in the GPU.

Operations can perform actions on tensors, and optionally can also own an Algorithm with respective parameters. kp::Operations with kp::Algorithms would inherit from kp::OpBaseAlgo.

Constructor & Destructor Documentation

◆ ~OpBase()

virtual kp::OpBase::~OpBase ( )
inlinevirtual

Default destructor for OpBase class. This OpBase destructor class should always be called to destroy and free owned resources unless it is intended to destroy the resources in the parent class.

Member Function Documentation

◆ postEval()

virtual void kp::OpBase::postEval ( const vk::CommandBuffer &  commandBuffer)
pure virtual

Post eval is called after the Sequence has called eval and submitted the commands to the GPU for processing, and can be used to perform any tear-down steps required as the computation iteration finishes. It's worth noting that there are situations where eval can be called multiple times, so the resources that are destroyed should not require a re-init unless explicitly provided by the user.

Parameters
commandBufferThe command buffer to record the command into.

Implemented in kp::OpTensorSyncLocal, kp::OpTensorSyncDevice, kp::OpTensorCopy, kp::OpMemoryBarrier, and kp::OpAlgoDispatch.

◆ preEval()

virtual void kp::OpBase::preEval ( const vk::CommandBuffer &  commandBuffer)
pure virtual

Pre eval is called before the Sequence has called eval and submitted the commands to the GPU for processing, and can be used to perform any per-eval setup steps required as the computation iteration begins. It's worth noting that there are situations where eval can be called multiple times, so the resources that are created should be idempotent in case it's called multiple times in a row.

Parameters
commandBufferThe command buffer to record the command into.

Implemented in kp::OpTensorSyncLocal, kp::OpTensorSyncDevice, kp::OpTensorCopy, kp::OpMemoryBarrier, and kp::OpAlgoDispatch.

◆ record()

virtual void kp::OpBase::record ( const vk::CommandBuffer &  commandBuffer)
pure virtual

The record function is intended to only send a record command or run commands that are expected to record operations that are to be submitted as a batch into the GPU.

Parameters
commandBufferThe command buffer to record the command into.

Implemented in kp::OpTensorSyncLocal, kp::OpTensorSyncDevice, kp::OpTensorCopy, kp::OpMemoryBarrier, and kp::OpAlgoDispatch.


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