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.
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
-
commandBuffer | The command buffer to record the command into. |
Implemented in kp::OpTensorSyncLocal, kp::OpTensorSyncDevice, kp::OpTensorCopy, kp::OpMemoryBarrier, and kp::OpAlgoDispatch.
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
-
commandBuffer | The command buffer to record the command into. |
Implemented in kp::OpTensorSyncLocal, kp::OpTensorSyncDevice, kp::OpTensorCopy, kp::OpMemoryBarrier, and kp::OpAlgoDispatch.