|
Graphite
|
Represents a collection of optimizable variables to be processed together on the GPU. More...
#include <vertex.hpp>


Public Types | |
| using | InvP = std::conditional_t< is_low_precision< S >::value, T, S > |
| using | Traits = VTraits |
| using | VertexType = typename Traits::Vertex |
| using | State = get_State_or_t< Traits, VertexType > |
Public Types inherited from graphite::BaseVertexDescriptor< T, S > | |
| using | InvP = std::conditional_t< is_low_precision< S >::value, T, S > |
Public Member Functions | |
| void | apply_update_async (const T *delta_x, T *jacobian_scales, cudaStream_t stream) override |
| Applies an update to the vertex parameters asynchronously. | |
| void | augment_block_diagonal_async (InvP *block_diagonal, InvP *scalar_diagonal, T mu, cudaStream_t stream) override |
| Adds damping to the Hessian block diagonal asynchronously. | |
| void | apply_block_jacobi (T *z, const T *r, InvP *block_diagonal, cudaStream_t stream) override |
| Applies the block Jacobi preconditioner asynchronously. | |
| virtual void | to_device () override |
| Prepares descriptor for GPU processing. | |
| VertexType ** | vertices () |
| Returns a pointer to the array of vertex pointers for the descriptor. | |
| virtual void | backup_parameters_async () override |
| Backs up the state of the vertices asynchronously. | |
| virtual void | restore_parameters_async () override |
| Restores the state of the vertices from the backup asynchronously. | |
| virtual size_t | count () const override |
| Returns the number of vertices in the descriptor (including fixed vertices). | |
| void | reserve (size_t size) |
| Reserves memory for the specified number of vertices. You should call this before constructing the graph to avoid excessive reallocations. | |
| void | remove_vertex (const size_t id) |
| Removes a vertex from the descriptor by its ID. | |
| void | replace_vertex (const size_t id, VertexType *vertex) |
| Replaces a vertex pointer in the descriptor for the given ID. | |
| void | add_vertex (const size_t id, VertexType *vertex, const bool fixed=false) |
| Adds a vertex to the descriptor. | |
| void | set_fixed (const size_t id, const bool fixed) |
| Sets the fixed state of a vertex. | |
| bool | is_fixed (const size_t id) const override |
| Checks if a vertex is fixed. | |
| bool | is_active (const size_t id) const override |
| Checks if a vertex is active. | |
| uint8_t * | get_active_state () const override |
| Retrieves a pointer to the active state array for the vertices. | |
| const size_t * | get_block_ids () const override |
| Retrieves a pointer to the block IDs array for the vertices. | |
| VertexType * | get_vertex (const size_t id) |
| Retrieves a pointer to the vertex associated with the given ID. | |
| bool | exists (const size_t id) const |
| Checks if a vertex exists in the descriptor. | |
| const std::unordered_map< size_t, size_t > & | get_global_map () const override |
| size_t | dimension () const override |
| Returns the dimension of the vertex parameterization. | |
| const size_t * | get_hessian_ids () const override |
| void | set_hessian_column (const size_t global_id, const size_t hessian_column, const size_t block_index) |
| Sets the Hessian column and block index for a vertex. | |
| void | clear () |
| Clears all vertices and resets the descriptor to an empty state. | |
Public Attributes | |
| std::unordered_map< size_t, size_t > | global_to_local_map |
| std::vector< size_t > | local_to_global_map |
| thrust::host_vector< size_t > | local_to_hessian_offsets |
| thrust::device_vector< size_t > | hessian_ids |
| managed_vector< size_t > | block_ids |
| managed_vector< uint8_t > | active_state |
Static Public Attributes | |
| static constexpr size_t | dim = Traits::dimension |
Private Attributes | |
| thrust::device_vector< VertexType * > | x_device |
| thrust::host_vector< VertexType * > | x_host |
| thrust::device_vector< State > | backup_state |
Represents a collection of optimizable variables to be processed together on the GPU.
|
inline |
Adds a vertex to the descriptor.
| id | The ID of the vertex to add. Must be unique across all vertex descriptors in the same graph. |
| vertex | The pointer of the vertex to add. |
| fixed | Whether the vertex is fixed or not. |
|
inlineoverridevirtual |
Applies the block Jacobi preconditioner asynchronously.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Applies an update to the vertex parameters asynchronously.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Adds damping to the Hessian block diagonal asynchronously.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Backs up the state of the vertices asynchronously.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Returns the number of vertices in the descriptor (including fixed vertices).
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Returns the dimension of the vertex parameterization.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inline |
Checks if a vertex exists in the descriptor.
| id | The ID of the vertex to check. |
|
inlineoverridevirtual |
Retrieves a pointer to the active state array for the vertices.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Retrieves a pointer to the block IDs array for the vertices.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Implements graphite::BaseVertexDescriptor< T, S >.
|
inline |
Retrieves a pointer to the vertex associated with the given ID.
| id | The ID of the vertex to retrieve. |
|
inlineoverridevirtual |
Checks if a vertex is active.
| id | The ID of the vertex to check. |
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Checks if a vertex is fixed.
| id | The ID of the vertex to check. |
Implements graphite::BaseVertexDescriptor< T, S >.
|
inline |
Removes a vertex from the descriptor by its ID.
| id | The ID of the vertex to remove. |
|
inline |
Replaces a vertex pointer in the descriptor for the given ID.
| id | The ID of the vertex to replace. |
| vertex | The new pointer of the vertex. |
|
inline |
Reserves memory for the specified number of vertices. You should call this before constructing the graph to avoid excessive reallocations.
| size | The number of vertices to reserve space for. |
|
inlineoverridevirtual |
Restores the state of the vertices from the backup asynchronously.
Implements graphite::BaseVertexDescriptor< T, S >.
|
inline |
Sets the fixed state of a vertex.
| id | The ID of the vertex to update. |
| fixed | Whether the vertex is fixed (true) or not (false). |
|
inlinevirtual |
Sets the Hessian column and block index for a vertex.
| global_id | The global ID of the vertex. |
| hessian_column | The Hessian column index. |
| block_index | The block index. |
Implements graphite::BaseVertexDescriptor< T, S >.
|
inlineoverridevirtual |
Prepares descriptor for GPU processing.
Implements graphite::BaseVertexDescriptor< T, S >.