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

#include <OpTensorSyncLocal.hpp>

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

Public Member Functions

 OpTensorSyncLocal (const std::vector< std::shared_ptr< Tensor >> &tensors)
 
 ~OpTensorSyncLocal () override
 
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 syncs tensor's local memory by mapping device data into the local CPU memory. For TensorTypes::eDevice it will use a record operation for the memory to be syncd into GPU memory which means that the operation will be done in sync with GPU commands. For TensorTypes::eHost it will only map the data into host memory which will happen during preEval before the recorded commands are dispatched.

Constructor & Destructor Documentation

◆ OpTensorSyncLocal()

kp::OpTensorSyncLocal::OpTensorSyncLocal ( const std::vector< std::shared_ptr< Tensor >> &  tensors)

Default constructor with parameters that provides the core vulkan resources and the tensors that will be used in the operation. The tensors provided cannot be of type TensorTypes::eStorage.

Parameters
tensorsTensors that will be used to create in operation.

◆ ~OpTensorSyncLocal()

kp::OpTensorSyncLocal::~OpTensorSyncLocal ( )
override

Default destructor. This class does not manage memory so it won't be expecting the parent to perform a release.

Member Function Documentation

◆ postEval()

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

For host tensors it performs the map command from the host memory into local memory.

Parameters
commandBufferThe command buffer to record the command into.

Implements kp::OpBase.

◆ preEval()

virtual void kp::OpTensorSyncLocal::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()

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

For device tensors, it records the copy command for the tensor to copy the data from its device to staging memory.

Parameters
commandBufferThe command buffer to record the command into.

Implements kp::OpBase.


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