Kompute
Public Member Functions | List of all members
kp::OpMemoryBarrier Class Reference

#include <OpMemoryBarrier.hpp>

Inheritance diagram for kp::OpMemoryBarrier:
Inheritance graph
[legend]
Collaboration diagram for kp::OpMemoryBarrier:
Collaboration graph
[legend]

Public Member Functions

 OpMemoryBarrier (const std::vector< std::shared_ptr< Tensor >> &tensors, const vk::AccessFlagBits &srcAccessMask, const vk::AccessFlagBits &dstAccessMask, const vk::PipelineStageFlagBits &srcStageMask, const vk::PipelineStageFlagBits &dstStageMask, bool barrierOnPrimary=true)
 
virtual ~OpMemoryBarrier () override
 
virtual void record (const vk::CommandBuffer &commandBuffer) override
 
virtual void preEval (const vk::CommandBuffer &commandBuffer) override
 
virtual void postEval (const vk::CommandBuffer &commandBuffer) override
 
- Public Member Functions inherited from kp::OpBase
virtual ~OpBase ()
 

Detailed Description

Operation that provides a general abstraction that simplifies the use of algorithm and parameter components which can be used with shaders. It exposes the pipeline barrier functionality specifically for memory barriers that can be configured through the respective source and destination masks

Constructor & Destructor Documentation

◆ OpMemoryBarrier()

kp::OpMemoryBarrier::OpMemoryBarrier ( const std::vector< std::shared_ptr< Tensor >> &  tensors,
const vk::AccessFlagBits &  srcAccessMask,
const vk::AccessFlagBits &  dstAccessMask,
const vk::PipelineStageFlagBits &  srcStageMask,
const vk::PipelineStageFlagBits &  dstStageMask,
bool  barrierOnPrimary = true 
)

Constructor that stores tensors as well as memory barrier parameters to be used to create a pipeline barrier on the respective primary or staging tensor.

Parameters
tensorsThe tensors to apply the memory barriers on
srcAccessMaskThe kp::AccessFlagBits for the source access mask
dstAccessMaskThe kp::AccessFlagBits for the destination access mask
srcStageMaskThe kp::PipelineStageFlagBits for the source stage mask
dstStageMaskThe kp::PipelineStageFlagBits for the destination stage mask
barrierOnPrimaryBoolean to select primary or secondary buffers on tensors

◆ ~OpMemoryBarrier()

virtual kp::OpMemoryBarrier::~OpMemoryBarrier ( )
overridevirtual

Default destructor, which is in charge of destroying the reference to the tensors and all the relevant access / stage masks created

Member Function Documentation

◆ postEval()

virtual void kp::OpMemoryBarrier::postEval ( const vk::CommandBuffer &  commandBuffer)
overridevirtual

Does not perform any postEval commands.

Parameters
commandBufferThe command buffer to record the command into.

Implements kp::OpBase.

◆ preEval()

virtual void kp::OpMemoryBarrier::preEval ( const vk::CommandBuffer &  commandBuffer)
overridevirtual

Does not perform any preEval commands.

Parameters
commandBufferThe command buffer to record the command into.

Implements kp::OpBase.

◆ record()

virtual void kp::OpMemoryBarrier::record ( const vk::CommandBuffer &  commandBuffer)
overridevirtual

This records the memory barrier with the access and stage masks provided across all relevant tensors.

Parameters
commandBufferThe command buffer to record the command into.

Implements kp::OpBase.


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