Lluvia
ll::ComputeNodeDescriptor Class Reference

Class for describing a compute node node. More...

#include <ComputeNodeDescriptor.h>

Public Member Functions

 ComputeNodeDescriptor ()=default
 
 ComputeNodeDescriptor (const ComputeNodeDescriptor &descriptor)=default
 
 ComputeNodeDescriptor (ComputeNodeDescriptor &&descriptor)=default
 
 ~ComputeNodeDescriptor ()=default
 
ComputeNodeDescriptoroperator= (const ComputeNodeDescriptor &descriptor)=default
 
ComputeNodeDescriptoroperator= (ComputeNodeDescriptor &&descriptor)=default
 
ComputeNodeDescriptorsetProgram (const std::shared_ptr< ll::Program > &tProgram) noexcept
 Sets the program object. More...
 
ComputeNodeDescriptorsetProgram (const std::shared_ptr< ll::Program > &tProgram, const std::string &tFunctionName) noexcept
 Sets the program object and function name. More...
 
ComputeNodeDescriptorsetParameter (const std::string &name, const ll::Parameter &value)
 Sets a parameter. More...
 
ComputeNodeDescriptorsetFunctionName (const std::string &name) noexcept
 Sets the function name within the program object to run in the ll::ComputeNode. More...
 
ComputeNodeDescriptorsetBuilderName (const std::string &name) noexcept
 Sets the builder name this descriptor refers to within the Lua interpreter. More...
 
ComputeNodeDescriptoraddPort (const ll::PortDescriptor &port)
 Adds a port to the descriptor. More...
 
ComputeNodeDescriptoraddPorts (const std::initializer_list< ll::PortDescriptor > &ports)
 Adds a list of ports to the descriptor. More...
 
ComputeNodeDescriptorsetGridX (const uint32_t x) noexcept
 Sets the grid size in the X axis. More...
 
ComputeNodeDescriptorsetGridY (const uint32_t y) noexcept
 Sets the grid size in the Y axis. More...
 
ComputeNodeDescriptorsetGridZ (const uint32_t z) noexcept
 Sets the grid size in the Z axis. More...
 
ComputeNodeDescriptorsetGridShape (const ll::vec3ui &shape) noexcept
 Sets the grid shape. More...
 
ComputeNodeDescriptorconfigureGridShape (const ll::vec3ui &globalShape) noexcept
 Calculates the grid shape provided local and global shapes. More...
 
ComputeNodeDescriptorsetLocalX (const uint32_t x) noexcept
 Sets the local group size in the X axis. More...
 
ComputeNodeDescriptorsetLocalY (const uint32_t y) noexcept
 Sets the local group size in the Y axis. More...
 
ComputeNodeDescriptorsetLocalZ (const uint32_t z) noexcept
 Sets the local group size in the Z axis. More...
 
ComputeNodeDescriptorsetLocalShape (const ll::vec3ui &shape) noexcept
 Sets the local group shape. More...
 
ComputeNodeDescriptorsetPushConstants (const ll::PushConstants &constants) noexcept
 Sets the push constants for this compute node. More...
 
std::shared_ptr< ll::ProgramgetProgram () const noexcept
 Gets the program associated to this compute node. More...
 
const ll::PortDescriptorgetPort (const std::string &name) const
 Gets a port descriptor given its name. More...
 
const ll::ParametergetParameter (const std::string &name) const
 Gets a parameter. More...
 
const std::string & getFunctionName () const noexcept
 Gets the function name within the ll::Program object used by this node. More...
 
const std::string & getBuilderName () const noexcept
 Gets the builder name within the Lua interpreter. More...
 
ll::vec3ui getGridShape () const noexcept
 Gets the grid shape. More...
 
ll::vec3ui getLocalShape () const noexcept
 Gets the local group shape. More...
 
uint32_t getGridX () const noexcept
 
uint32_t getGridY () const noexcept
 
uint32_t getGridZ () const noexcept
 
uint32_t getLocalX () const noexcept
 
uint32_t getLocalY () const noexcept
 
uint32_t getLocalZ () const noexcept
 
const ll::PushConstantsgetPushConstants () const noexcept
 
std::vector< vk::DescriptorSetLayoutBinding > getParameterBindings () const
 

Detailed Description

Class for describing a compute node node.

Descriptors are used to construct ll::ComputeNode objects.

Constructor & Destructor Documentation

◆ ComputeNodeDescriptor() [1/3]

ll::ComputeNodeDescriptor::ComputeNodeDescriptor ( )
default

◆ ComputeNodeDescriptor() [2/3]

ll::ComputeNodeDescriptor::ComputeNodeDescriptor ( const ComputeNodeDescriptor descriptor)
default

◆ ComputeNodeDescriptor() [3/3]

ll::ComputeNodeDescriptor::ComputeNodeDescriptor ( ComputeNodeDescriptor &&  descriptor)
default

◆ ~ComputeNodeDescriptor()

ll::ComputeNodeDescriptor::~ComputeNodeDescriptor ( )
default

Member Function Documentation

◆ addPort()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::addPort ( const ll::PortDescriptor port)

Adds a port to the descriptor.

Parameters
[in]portThe port
Returns
A reference to this object.

◆ addPorts()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::addPorts ( const std::initializer_list< ll::PortDescriptor > &  ports)

Adds a list of ports to the descriptor.

Parameters
[in]portsThe ports
Returns
A reference to this object.

◆ configureGridShape()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::configureGridShape ( const ll::vec3ui globalShape)
noexcept

Calculates the grid shape provided local and global shapes.

The calculation is done as:

grid.x = ceil(global.x / local.x)
grid.y = ceil(global.y / local.y)
grid.z = ceil(global.z / local.z)

This method does not control the case of dividing by zero.

Parameters
[in]globalShapeThe global shape.
Returns
A reference to this object.

◆ getBuilderName()

const std::string& ll::ComputeNodeDescriptor::getBuilderName ( ) const
noexcept

Gets the builder name within the Lua interpreter.

Returns
The builder name.

◆ getFunctionName()

const std::string& ll::ComputeNodeDescriptor::getFunctionName ( ) const
noexcept

Gets the function name within the ll::Program object used by this node.

Returns
The function name.

◆ getGridShape()

ll::vec3ui ll::ComputeNodeDescriptor::getGridShape ( ) const
noexcept

Gets the grid shape.

Returns
The grid shape.

◆ getGridX()

uint32_t ll::ComputeNodeDescriptor::getGridX ( ) const
noexcept

◆ getGridY()

uint32_t ll::ComputeNodeDescriptor::getGridY ( ) const
noexcept

◆ getGridZ()

uint32_t ll::ComputeNodeDescriptor::getGridZ ( ) const
noexcept

◆ getLocalShape()

ll::vec3ui ll::ComputeNodeDescriptor::getLocalShape ( ) const
noexcept

Gets the local group shape.

Returns
The local group shape.

◆ getLocalX()

uint32_t ll::ComputeNodeDescriptor::getLocalX ( ) const
noexcept

◆ getLocalY()

uint32_t ll::ComputeNodeDescriptor::getLocalY ( ) const
noexcept

◆ getLocalZ()

uint32_t ll::ComputeNodeDescriptor::getLocalZ ( ) const
noexcept

◆ getParameter()

const ll::Parameter& ll::ComputeNodeDescriptor::getParameter ( const std::string &  name) const

Gets a parameter.

Parameters
[in]nameThe parameter name
Returns
The parameter.
Exceptions
std::system_errorWith error code ll::ErrorCode::KeyNotFound if name is not in the parameters table.

◆ getParameterBindings()

std::vector<vk::DescriptorSetLayoutBinding> ll::ComputeNodeDescriptor::getParameterBindings ( ) const

◆ getPort()

const ll::PortDescriptor& ll::ComputeNodeDescriptor::getPort ( const std::string &  name) const

Gets a port descriptor given its name.

Parameters
[in]nameThe name
Returns
The port descriptor.
Exceptions
std::system_errorWith error code ll::ErrorCode::KeyNotFound if name is not in the ports table.

◆ getProgram()

std::shared_ptr<ll::Program> ll::ComputeNodeDescriptor::getProgram ( ) const
noexcept

Gets the program associated to this compute node.

Returns
The program.

◆ getPushConstants()

const ll::PushConstants& ll::ComputeNodeDescriptor::getPushConstants ( ) const
noexcept

◆ operator=() [1/2]

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::operator= ( ComputeNodeDescriptor &&  descriptor)
default

◆ operator=() [2/2]

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::operator= ( const ComputeNodeDescriptor descriptor)
default

◆ setBuilderName()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setBuilderName ( const std::string &  name)
noexcept

Sets the builder name this descriptor refers to within the Lua interpreter.

Parameters
[in]nameThe builder name.
Returns
A reference to this object.

◆ setFunctionName()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setFunctionName ( const std::string &  name)
noexcept

Sets the function name within the program object to run in the ll::ComputeNode.

Parameters
[in]nameThe function name.
Returns
A reference to this object.

◆ setGridShape()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setGridShape ( const ll::vec3ui shape)
noexcept

Sets the grid shape.

The grid size defines the number of local groups to be run during the execution of a compute node shader program.

Parameter z corresponds to the groupCountZ parameter in vkCmdDispatch. See https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDispatch for more information.

Parameters
[in]shapeThe grid shape. Each XYZ component must be greater than zero.
Returns
A reference to this object.

◆ setGridX()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setGridX ( const uint32_t  x)
noexcept

Sets the grid size in the X axis.

The grid size defines the number of local groups to be run during the execution of a compute node shader program.

Parameter x corresponds to the groupCountX parameter in vkCmdDispatch. See https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDispatch for more information.

Parameters
[in]xThe grid size. It must be greater than zero.
Returns
A reference to this object.

◆ setGridY()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setGridY ( const uint32_t  y)
noexcept

Sets the grid size in the Y axis.

The grid size defines the number of local groups to be run during the execution of a compute node shader program.

Parameter y corresponds to the groupCountY parameter in vkCmdDispatch. See https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDispatch for more information.

Parameters
[in]yThe grid size. It must be greater than zero.
Returns
A reference to this object.

◆ setGridZ()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setGridZ ( const uint32_t  z)
noexcept

Sets the grid size in the Z axis.

The grid size defines the number of local groups to be run during the execution of a compute node shader program.

Parameter z corresponds to the groupCountZ parameter in vkCmdDispatch. See https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#vkCmdDispatch for more information.

Parameters
[in]zThe grid size. It must be greater than zero.
Returns
A reference to this object.

◆ setLocalShape()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setLocalShape ( const ll::vec3ui shape)
noexcept

Sets the local group shape.

Parameters
[in]shapeThe shape. Each XYZ component must be greater than zero.
Returns
A reference to this object.

◆ setLocalX()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setLocalX ( const uint32_t  x)
noexcept

Sets the local group size in the X axis.

Parameters
[in]xThe local group size. It must be greater than zero.
Returns
A reference to this object.

◆ setLocalY()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setLocalY ( const uint32_t  y)
noexcept

Sets the local group size in the Y axis.

Parameters
[in]yThe local group size. It must be greater than zero.
Returns
A reference to this object.

◆ setLocalZ()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setLocalZ ( const uint32_t  z)
noexcept

Sets the local group size in the Z axis.

Parameters
[in]zThe local group size. It must be greater than zero.
Returns
A reference to this object.

◆ setParameter()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setParameter ( const std::string &  name,
const ll::Parameter value 
)

Sets a parameter.

Parameters
[in]nameThe name
[in]defaultValueThe value.
Returns
A reference to this object.

◆ setProgram() [1/2]

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setProgram ( const std::shared_ptr< ll::Program > &  tProgram)
noexcept

Sets the program object.

Parameters
[in]tProgramThe program.
Returns
A reference to this object.

◆ setProgram() [2/2]

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setProgram ( const std::shared_ptr< ll::Program > &  tProgram,
const std::string &  tFunctionName 
)
noexcept

Sets the program object and function name.

Parameters
[in]tProgramThe program.
[in]tFunctionNameThe function name.
Returns
A reference to this object.
See also
ll::ComputeNodeDescriptor::setProgram sets the program object.
ll::ComputeNodeDescriptor::setFunctionName sets the function name.

◆ setPushConstants()

ComputeNodeDescriptor& ll::ComputeNodeDescriptor::setPushConstants ( const ll::PushConstants constants)
noexcept

Sets the push constants for this compute node.

Parameters
[in]constantsA shared pointer to ll::PushConstants. This way, the values of the constants can be shared among several nodes.
Returns
A reference to this object

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