Loading...
Searching...
No Matches
q3::execution::gpu::device::GPUDeviceBuffer< T > Class Template Reference

#include <buffer.hpp>

Public Member Functions

 GPUDeviceBuffer (const GPUDeviceBuffer &)=delete
 
 GPUDeviceBuffer (GPUDeviceBuffer &&other) noexcept
 
 GPUDeviceBuffer (size_t element_count, std::shared_ptr< GPUDeviceBackend > backend)
 
 ~GPUDeviceBuffer ()
 
const T * data () const noexcept
 
T * data () noexcept
 
GPUDeviceBuffer & operator= (const GPUDeviceBuffer &)=delete
 
GPUDeviceBuffer & operator= (GPUDeviceBuffer &&other) noexcept
 
size_t size () const noexcept
 
size_t size_bytes () const noexcept
 

Detailed Description

template<typename T>
class q3::execution::gpu::device::GPUDeviceBuffer< T >

Definition at line 37 of file buffer.hpp.

Constructor & Destructor Documentation

◆ GPUDeviceBuffer() [1/3]

template<typename T >
q3::execution::gpu::device::GPUDeviceBuffer< T >::GPUDeviceBuffer ( size_t  element_count,
std::shared_ptr< GPUDeviceBackend >  backend 
)
inline

Construct a buffer of the given number of elements.

Parameters
element_countNumber of elements of type T to allocate. If zero, no allocation is performed and data() returns nullptr.
backendShared pointer to the GPU device backend. Must not be null.
Exceptions
std::runtime_errorIf allocation fails (e.g., out of GPU memory).

Definition at line 48 of file buffer.hpp.

◆ GPUDeviceBuffer() [2/3]

template<typename T >
q3::execution::gpu::device::GPUDeviceBuffer< T >::GPUDeviceBuffer ( const GPUDeviceBuffer< T > &  )
delete

◆ GPUDeviceBuffer() [3/3]

template<typename T >
q3::execution::gpu::device::GPUDeviceBuffer< T >::GPUDeviceBuffer ( GPUDeviceBuffer< T > &&  other)
inlinenoexcept

Move constructor. Transfers ownership of the allocation. The source buffer is left in a valid but empty state.

Definition at line 66 of file buffer.hpp.

◆ ~GPUDeviceBuffer()

template<typename T >
q3::execution::gpu::device::GPUDeviceBuffer< T >::~GPUDeviceBuffer ( )
inline

Definition at line 90 of file buffer.hpp.

Member Function Documentation

◆ data() [1/2]

template<typename T >
const T * q3::execution::gpu::device::GPUDeviceBuffer< T >::data ( ) const
inlinenoexcept

Raw const pointer to the underlying unified memory.

Definition at line 105 of file buffer.hpp.

◆ data() [2/2]

template<typename T >
T * q3::execution::gpu::device::GPUDeviceBuffer< T >::data ( )
inlinenoexcept

Raw pointer to the underlying unified memory. Returns nullptr if the buffer was zero-sized or moved-from.

Definition at line 98 of file buffer.hpp.

Referenced by q3::GPUPlanewaveHamiltonianApplicator::apply_batch(), q3::GPUPlanewaveHamiltonianApplicator::apply_batch_single_precision(), q3::GPUPlanewaveSubspaceManager::apply_preconditioner(), q3::GPUDavidsonWorkspace::band_scratch(), q3::GPUDavidsonWorkspace::band_scratch(), q3::GPUDavidsonWorkspace::basis_vectors(), q3::GPUDavidsonWorkspace::basis_vectors(), q3::GPUPlanewaveSubspaceManager::build_correction_vectors(), q3::GPUPlanewaveSubspaceManager::collapse_subspace(), q3::GPUDavidsonWorkspace::eigenvalues_device(), q3::GPUDavidsonWorkspace::eigenvalues_device(), q3::GPUPlanewaveSubspaceManager::extract_eigenvectors(), q3::GPUDavidsonWorkspace::hamiltonian_basis_vectors(), q3::GPUDavidsonWorkspace::hamiltonian_basis_vectors(), q3::GPUPlanewaveSubspaceManager::orthogonalize_batch(), q3::GPUDavidsonWorkspace::overlap_basis_vectors(), q3::GPUDavidsonWorkspace::overlap_basis_vectors(), q3::GPUPlanewaveHamiltonianApplicator::prepare_kpoint(), q3::GPUDavidsonWorkspace::resize(), q3::GPUDavidsonWorkspace::subspace_hamiltonian(), q3::GPUDavidsonWorkspace::subspace_hamiltonian(), q3::GPUDavidsonWorkspace::subspace_overlap(), q3::GPUDavidsonWorkspace::subspace_overlap(), q3::GPUDavidsonWorkspace::sync_to_device(), q3::GPUPlanewaveHamiltonianApplicator::update_potential(), and q3::GPUPlanewaveSubspaceManager::update_subspace_matrices().

◆ operator=() [1/2]

template<typename T >
GPUDeviceBuffer & q3::execution::gpu::device::GPUDeviceBuffer< T >::operator= ( const GPUDeviceBuffer< T > &  )
delete

◆ operator=() [2/2]

template<typename T >
GPUDeviceBuffer & q3::execution::gpu::device::GPUDeviceBuffer< T >::operator= ( GPUDeviceBuffer< T > &&  other)
inlinenoexcept

Move assignment operator. Releases the current allocation (if any) before taking ownership of the source's allocation.

Definition at line 78 of file buffer.hpp.

◆ size()

template<typename T >
size_t q3::execution::gpu::device::GPUDeviceBuffer< T >::size ( ) const
inlinenoexcept

◆ size_bytes()

template<typename T >
size_t q3::execution::gpu::device::GPUDeviceBuffer< T >::size_bytes ( ) const
inlinenoexcept

Total size of the allocation in bytes.

Definition at line 119 of file buffer.hpp.


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