PSCF v1.4.0
Pscf::DeviceArray< Data > Class Template Reference

Dynamic array on the GPU device with aligned data. More...

#include <DeviceArray.h>

Public Types

typedef Data ValueType
 Data type of each element.

Public Member Functions

 DeviceArray ()
 Default constructor.
 DeviceArray (int capacity)
 Allocating constructor.
 DeviceArray (DeviceArray< Data > const &other)
 Copy constructor.
 DeviceArray (DArray< Data > const &other)
 Copy constructor, deep copy DArray<Data> from host to device.
virtual ~DeviceArray ()
 Destructor.
void allocate (int capacity)
 Allocate the underlying C array on the device.
void deallocate ()
 Dellocate the underlying C array.
void associate (DeviceArray< Data > &arr, int beginId, int capacity)
 Associate this object with a slice of a different DeviceArray.
void associate (DeviceMemory &arr, int capacity)
 Associate this object with a DeviceMemory container.
void dissociate ()
 Dissociate this object from an externally owned memory block.
void addReference (CountedReference &reference)
 Associate a reference with reference counter for this container.
virtual DeviceArray< Data > & operator= (const DeviceArray< Data > &other)
 Assignment operator, assign from another DeviceArray<Data> array.
virtual DeviceArray< Data > & operator= (const DArray< Data > &other)
 Assignment operator, assignment from Util::DArray<Data> host array.
int capacity () const
 Return array capacity.
bool isAllocated () const
 Return true if the array has allocated data, false otherwise.
bool isOwner () const
 Does this container own an allocated memory block?
bool isAssociated () const
 Is this container associated with a memory block it does not own?
Data * cArray ()
 Return pointer to underlying C array.
Data const * cArray () const
 Return const pointer to underlying C array.

Protected Attributes

Data * dataPtr_
 Pointer to a C array of Data elements on the GPU device.
int capacity_
 Allocated size (capacity) of the array.
ReferenceCounter refCounter_
 Counter for any arrays that use data owned by this.
CountedReference ref_
 Reference to another array that owns memory used by this one.

Detailed Description

template<typename Data>
class Pscf::DeviceArray< Data >

Dynamic array on the GPU device with aligned data.

This class wraps an aligned C array with elements of type Data that is allocated in GPU device global memory. All member functions may be called from the CPU host, but this class does not offer access to individual elements via the subscript operator, operator[].

A DeviceArray can be in any of three states:

(1) Unallocated: In this state, there is no associated memory, so capacity() returns 0, while isAllocated(), isOwner() and isAssociated() all return false.

(2) A data owner: In this case, this object owns a block of memory that it is responsible for de-allocating. In this state, capacity() returns a positive integer value, isAllocated() and isOwner() return true, and isAssociated() returns false.

(3) A data user: In this case, this object has a pointer to a block of device memory that is owned by a different container. We describe this by saying this DeviceArray (the data user) is "associated" with or "references" memory owned by another container (the data owner). In this state, capacity() returns a positive value, isAllocated() and isAssociated() return true, and isOwner() returns false.

Memory that is owned by a DeviceArray may be allocated and deallocated by the allocate() and deallocate() member functions. Memory owned by a DeviceArray is also dellocated when the DeviceArray is destroyed.

A DeviceArray<Data> object may be associated as a data user with:

  • A slice of an array of Data objects owned by another DeviceArray<Data>, or
  • A block of bare memory owned by a DeviceMemory container

Associations with either type of data owner can be created and destroyed by calling the associate and dissociate member functions of the data user. Attempts to create an association cause an Exception to be thrown if the requested slice of shared data would exceed the bounds of the block owned by the data owner.

A DeviceArray<Data> that serves as an owner of data that is used by one or more other associated DeviceArray<Data> objects maintains a count of how many associated objects refer to its data. This counter is incremented when an association is created by a data user and decremented when the user destroys the association.

When a DeviceArray<Data> object is destroyed, any data that it owns is automatically deallocated, and any association with external data is destroyed.

It is an error to deallocate memory owned by a DeviceArray or DeviceMemory container that is still referred to by one or more associated DeviceArray data users. Doing so is illegal because it creates dangling pointers. Attempts to prematurely deallocate such a shared memory block either cause an Exception to be thrown, if it occurs within the deallocate function, or cause an error message to be written to std::cout if the error occurs in the DeviceArray destructor function. All references to such a shared data block must thus be released, by calling the dissociate() member function of each data user, before the data owner can be safely destroyed.

Definition at line 95 of file DeviceArray.h.

Member Typedef Documentation

◆ ValueType

template<typename Data>
typedef Data Pscf::DeviceArray< Data >::ValueType

Data type of each element.

Definition at line 103 of file DeviceArray.h.

Constructor & Destructor Documentation

◆ DeviceArray() [1/4]

template<typename Data>
Pscf::DeviceArray< Data >::DeviceArray ( )

Default constructor.

Definition at line 346 of file DeviceArray.h.

References capacity_, and dataPtr_.

Referenced by associate(), DeviceArray(), and operator=().

◆ DeviceArray() [2/4]

template<typename Data>
Pscf::DeviceArray< Data >::DeviceArray ( int capacity)

Allocating constructor.

This function calls allocate(capacity) internally.

Parameters
capacitynumber of elements to allocate

Definition at line 355 of file DeviceArray.h.

References allocate(), capacity(), capacity_, and dataPtr_.

◆ DeviceArray() [3/4]

template<typename Data>
Pscf::DeviceArray< Data >::DeviceArray ( DeviceArray< Data > const & other)

Copy constructor.

Parameters
otherDeviceArray<Data> to be copied (input)

Definition at line 366 of file DeviceArray.h.

References allocate(), capacity_, cArray(), dataPtr_, DeviceArray(), and isAllocated().

◆ DeviceArray() [4/4]

template<typename Data>
Pscf::DeviceArray< Data >::DeviceArray ( DArray< Data > const & other)

Copy constructor, deep copy DArray<Data> from host to device.

Parameters
otherDArray<Data> to be copied (input)

Definition at line 386 of file DeviceArray.h.

References allocate(), Util::Array< Data >::capacity(), capacity_, Util::Array< Data >::cArray(), dataPtr_, and Util::DArray< Data >::isAllocated().

◆ ~DeviceArray()

template<typename Data>
Pscf::DeviceArray< Data >::~DeviceArray ( )
virtual

Destructor.

Deletes underlying C array, if allocated previously.

Definition at line 404 of file DeviceArray.h.

References dataPtr_, isOwner(), ref_, and refCounter_.

Member Function Documentation

◆ allocate()

template<typename Data>
void Pscf::DeviceArray< Data >::allocate ( int capacity)

Allocate the underlying C array on the device.

Exceptions
Exceptionif the array is already allocated.
Parameters
capacitynumber of elements to allocate.

Definition at line 424 of file DeviceArray.h.

References capacity(), capacity_, dataPtr_, isAllocated(), ref_, and UTIL_THROW.

Referenced by Pscf::Prdc::Cuda::CField< D >::allocate(), Pscf::Prdc::Cuda::RField< D >::allocate(), Pscf::Prdc::Cuda::RFieldDft< D >::allocate(), DeviceArray(), DeviceArray(), DeviceArray(), operator=(), and operator=().

◆ deallocate()

template<typename Data>
void Pscf::DeviceArray< Data >::deallocate ( )

Dellocate the underlying C array.

Exceptions
Exceptionif the array is not allocated.
Exceptionif this object does not own the array.

Definition at line 445 of file DeviceArray.h.

References capacity_, dataPtr_, ref_, refCounter_, and UTIL_CHECK.

◆ associate() [1/2]

template<typename Data>
void Pscf::DeviceArray< Data >::associate ( DeviceArray< Data > & arr,
int beginId,
int capacity )

Associate this object with a slice of a different DeviceArray.

Exceptions
Exceptionif the array is already allocated.
Parameters
arrparent array that owns the data
beginIdindex in the parent array at which this array starts
capacitynumber of elements associated with this container

Definition at line 459 of file DeviceArray.h.

References addReference(), capacity(), capacity_, cArray(), dataPtr_, DeviceArray(), isAllocated(), isOwner(), ref_, and UTIL_CHECK.

Referenced by Pscf::Prdc::Cuda::CField< D >::associate(), Pscf::Prdc::Cuda::RField< D >::associate(), Pscf::Prdc::Cuda::RFieldDft< D >::associate(), Pscf::Reduce::innerProduct(), Pscf::Reduce::maxAbs(), Pscf::Reduce::minAbs(), Pscf::Reduce::sumSq(), Pscf::Reduce::sumSq(), and Pscf::Reduce::sumSqAbs().

◆ associate() [2/2]

template<typename Data>
void Pscf::DeviceArray< Data >::associate ( DeviceMemory & arr,
int capacity )

Associate this object with a DeviceMemory container.

When a DeviceArray<Data> is associated with a DeviceMemory container, the shared data block begins at the first byte of the block owned by the DeviceMemory. The number of byes in such a shared block is equal to capacity * sizeof(Data). This must be less than or equal to the number of byes in the block owned by the DeviceMemory, or this function will throw an Exception.

Exceptions
Exceptionif the array is already allocated
Exceptionif the requested memory block is too large
Parameters
arrDeviceMemory container that owns the data
capacitynumber of elements of type Data

Definition at line 482 of file DeviceArray.h.

References Pscf::DeviceMemory::addReference(), capacity(), Pscf::DeviceMemory::capacity(), capacity_, Pscf::DeviceMemory::cArray(), dataPtr_, Pscf::DeviceMemory::isAllocated(), ref_, and UTIL_CHECK.

◆ dissociate()

template<typename Data>
void Pscf::DeviceArray< Data >::dissociate ( )

Dissociate this object from an externally owned memory block.

This function can destroy an association with either another DeviceArray or with a DeviceMemory. After successful exit, isAllocated() and isAssociated() will both return false.

Exceptions
Exceptionif this is not associated with external memory

Definition at line 502 of file DeviceArray.h.

References capacity_, dataPtr_, ref_, and UTIL_CHECK.

Referenced by Pscf::Reduce::innerProduct(), Pscf::Reduce::maxAbs(), Pscf::Reduce::minAbs(), Pscf::Rpg::Block< D >::stepThread(), Pscf::Reduce::sumSq(), Pscf::Reduce::sumSq(), and Pscf::Reduce::sumSqAbs().

◆ addReference()

template<typename Data>
void Pscf::DeviceArray< Data >::addReference ( CountedReference & reference)

Associate a reference with reference counter for this container.

This function should normally only be called within the associate member function of a container that is referring to data owned by this array, as part of the process of creating an association. It should not be called by users in any other context.

On exit, the ReferenceCounter owned by this DeviceMemory is incremented by one and the CountedReference contains a pointer to the ReferenceCounter. This pointer can later be used as part of the process of destroying the association.

Parameters
referencereference to be included by reference counter

Definition at line 520 of file DeviceArray.h.

References Util::CountedReference::associate(), and refCounter_.

Referenced by associate().

◆ operator=() [1/2]

template<typename Data>
DeviceArray< Data > & Pscf::DeviceArray< Data >::operator= ( const DeviceArray< Data > & other)
virtual

Assignment operator, assign from another DeviceArray<Data> array.

Performs a deep copy, by copying values of all elements from device memory to device memory.

This function will allocate memory if this (LHS) array is not allocated. If this array is arleady allocated, it must have the same capacity as the other (RHS) DeviceArray<Data>.

Parameters
otherDeviceArray<Data> on rhs of assignent (input)

Definition at line 528 of file DeviceArray.h.

References allocate(), capacity(), capacity_, cArray(), dataPtr_, DeviceArray(), isAllocated(), and UTIL_THROW.

Referenced by Pscf::Prdc::Cuda::CField< D >::operator=(), Pscf::Prdc::Cuda::CField< D >::operator=(), Pscf::Prdc::Cuda::RField< D >::operator=(), Pscf::Prdc::Cuda::RField< D >::operator=(), Pscf::Prdc::Cuda::RFieldDft< D >::operator=(), and Pscf::Prdc::Cuda::RFieldDft< D >::operator=().

◆ operator=() [2/2]

template<typename Data>
DeviceArray< Data > & Pscf::DeviceArray< Data >::operator= ( const DArray< Data > & other)
virtual

Assignment operator, assignment from Util::DArray<Data> host array.

Performs a deep copy from a RHS DArray<Data> host array to this LHS DeviceArray<Data>, by copying underlying C array from host memory to device memory.

If this (LHS) DeviceArray<Data> is not allocated on entry, required memory will be allocated before data is copied. If this LHS object is already allocated, it must have the same capacity as the RHS DArray<Data>.

Parameters
otherDArray<Data> on RHS of assignent (input)

Definition at line 561 of file DeviceArray.h.

References allocate(), Util::Array< Data >::capacity(), capacity_, Util::Array< Data >::cArray(), dataPtr_, isAllocated(), Util::DArray< Data >::isAllocated(), and UTIL_THROW.

◆ capacity()

template<typename Data>
int Pscf::DeviceArray< Data >::capacity ( ) const
inline

Return array capacity.

Returns
number of elements in array

Definition at line 308 of file DeviceArray.h.

References capacity_.

Referenced by Pscf::VecOp::absV(), Pscf::VecOp::absV(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqVc(), Pscf::VecOp::addVcS(), Pscf::VecOp::addVcVc(), Pscf::VecOp::addVcVcS(), Pscf::VecOp::addVcVcVc(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), allocate(), associate(), associate(), Pscf::Prdc::Cuda::CFieldComparison< D >::compare(), Pscf::Prdc::Cuda::RFieldComparison< D >::compare(), Pscf::Prdc::Cuda::RFieldComparison< D >::compare(), Pscf::Prdc::Cuda::RFieldDftComparison< D >::compare(), Pscf::Prdc::Cuda::WaveList< D >::computedKSq(), Pscf::Rpg::IntraCorrelation< D >::computeOmegaTotal(), Pscf::Rpg::FieldIo< D >::convertBasisToKGrid(), Pscf::Rpg::FieldIo< D >::convertKGridToBasis(), Pscf::HostDArray< Data >::copySlice(), DeviceArray(), Pscf::VecOp::divEqS(), Pscf::VecOp::divEqS(), Pscf::VecOp::divEqS(), Pscf::VecOp::divEqS(), Pscf::VecOp::divEqV(), Pscf::VecOp::divEqV(), Pscf::VecOp::divEqV(), Pscf::VecOp::divEqV(), Pscf::VecOp::divEqVc(), Pscf::VecOp::divSV(), Pscf::VecOp::divSV(), Pscf::VecOp::divVS(), Pscf::VecOp::divVS(), Pscf::VecOp::divVS(), Pscf::VecOp::divVS(), Pscf::VecOp::divVV(), Pscf::VecOp::divVV(), Pscf::VecOp::divVV(), Pscf::VecOp::divVV(), Pscf::VecOp::eqS(), Pscf::VecOp::eqS(), Pscf::VecOp::eqS(), Pscf::VecOp::eqS(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqVPair(), Pscf::VecOp::expV(), Pscf::VecOp::expV(), Pscf::VecOp::expV(), Pscf::VecOp::expV(), Pscf::VecOp::expVc(), Pscf::Prdc::Cuda::FFT< D >::forwardTransform(), Pscf::Prdc::Cuda::FFT< D >::forwardTransform(), Pscf::Prdc::Cuda::FFTBatched< D >::forwardTransform(), Pscf::Rpg::FieldIo< D >::hasSymmetry(), Pscf::HostDArray< Data >::HostDArray(), Pscf::Reduce::innerProduct(), Pscf::Prdc::Cuda::FFT< D >::inverseTransform(), Pscf::Prdc::Cuda::FFT< D >::inverseTransformUnsafe(), Pscf::Prdc::Cuda::FFTBatched< D >::inverseTransformUnsafe(), Pscf::Reduce::max(), Pscf::Reduce::max(), Pscf::Reduce::maxAbs(), Pscf::Reduce::min(), Pscf::Reduce::min(), Pscf::Reduce::minAbs(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqVPair(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVVPair(), Pscf::CudaVecRandom::normal(), Pscf::CudaVecRandom::normal(), operator=(), Pscf::HostDArray< Data >::operator=(), Pscf::VecOp::sqAbsV(), Pscf::VecOp::sqAbsV(), Pscf::VecOp::sqSqAbsV(), Pscf::VecOp::sqV(), Pscf::VecOp::sqV(), Pscf::VecOp::sqV(), Pscf::VecOp::sqV(), Pscf::Rpg::Block< D >::stepBondBead(), Pscf::Rpg::Block< D >::stepFieldBead(), Pscf::Rpg::Block< D >::stepHalfBondBead(), Pscf::Rpg::FilmFieldGenMask< D >::stress(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqV(), Pscf::VecOp::subEqV(), Pscf::VecOp::subEqV(), Pscf::VecOp::subEqV(), Pscf::VecOp::subEqV(), Pscf::VecOp::subEqV(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::Reduce::sum(), Pscf::Reduce::sum(), Pscf::Reduce::sum(), Pscf::Reduce::sum(), Pscf::Reduce::sumSq(), Pscf::Reduce::sumSq(), Pscf::Reduce::sumSqAbs(), Pscf::CudaVecRandom::uniform(), Pscf::CudaVecRandom::uniform(), and Pscf::Rpg::FieldIo< D >::writeFieldRGrid().

◆ isAllocated()

◆ isOwner()

template<typename Data>
bool Pscf::DeviceArray< Data >::isOwner ( ) const
inline

Does this container own an allocated memory block?

If isAllocated() is false, isOwner() must be false.

Definition at line 322 of file DeviceArray.h.

References dataPtr_, and ref_.

Referenced by associate(), and ~DeviceArray().

◆ isAssociated()

template<typename Data>
bool Pscf::DeviceArray< Data >::isAssociated ( ) const
inline

Is this container associated with a memory block it does not own?

If isAllocated() is false, isAssociated() must be false.

Definition at line 329 of file DeviceArray.h.

References dataPtr_, and ref_.

◆ cArray() [1/2]

template<typename Data>
Data * Pscf::DeviceArray< Data >::cArray ( )

Return pointer to underlying C array.

Definition at line 590 of file DeviceArray.h.

References dataPtr_, and UTIL_CHECK.

Referenced by Pscf::VecOp::absV(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqS(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqV(), Pscf::VecOp::addEqVc(), Pscf::VecOp::addVcS(), Pscf::VecOp::addVcVc(), Pscf::VecOp::addVcVcS(), Pscf::VecOp::addVcVcVc(), Pscf::VecOp::addVMany(), Pscf::VecOp::addVMany(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVS(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), Pscf::VecOp::addVV(), associate(), Pscf::Rpg::FilmFieldGenExt< D >::compute(), Pscf::Rpg::FilmFieldGenMask< D >::compute(), Pscf::Prdc::Cuda::WaveList< D >::computedKSq(), Pscf::Prdc::Cuda::WaveList< D >::computeKSq(), Pscf::Prdc::Cuda::WaveList< D >::computeMinimumImages(), Pscf::HostDArray< Data >::copySlice(), DeviceArray(), Pscf::VecOp::divEqS(), Pscf::VecOp::divEqS(), Pscf::VecOp::divEqV(), Pscf::VecOp::divEqV(), Pscf::VecOp::divEqVc(), Pscf::VecOp::divSV(), Pscf::VecOp::divVS(), Pscf::VecOp::divVS(), Pscf::VecOp::divVV(), Pscf::VecOp::divVV(), Pscf::VecOp::eqS(), Pscf::VecOp::eqS(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqV(), Pscf::VecOp::eqVPair(), Pscf::VecOp::expV(), Pscf::VecOp::expV(), Pscf::VecOp::expVc(), Pscf::Prdc::Cuda::FFT< D >::forwardTransform(), Pscf::Prdc::Cuda::FFT< D >::forwardTransform(), Pscf::Prdc::Cuda::FFTBatched< D >::forwardTransform(), Pscf::HostDArray< Data >::HostDArray(), Pscf::Prdc::Cuda::FFT< D >::inverseTransform(), Pscf::Prdc::Cuda::FFT< D >::inverseTransformUnsafe(), Pscf::Prdc::Cuda::FFTBatched< D >::inverseTransformUnsafe(), Pscf::Reduce::max(), Pscf::Reduce::max(), Pscf::Reduce::min(), Pscf::Reduce::min(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqS(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqV(), Pscf::VecOp::mulEqVPair(), Pscf::VecOp::mulVMany(), Pscf::VecOp::mulVMany(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVS(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVV(), Pscf::VecOp::mulVVPair(), Pscf::CudaVecRandom::normal(), Pscf::CudaVecRandom::normal(), operator=(), Pscf::HostDArray< Data >::operator=(), Pscf::VecOp::sqAbsV(), Pscf::VecOp::sqSqAbsV(), Pscf::VecOp::sqV(), Pscf::VecOp::sqV(), Pscf::Rpg::FilmFieldGenExt< D >::stress(), Pscf::Rpg::FilmFieldGenMask< D >::stress(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqS(), Pscf::VecOp::subEqV(), Pscf::VecOp::subEqV(), Pscf::VecOp::subEqV(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVS(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::VecOp::subVV(), Pscf::Reduce::sum(), Pscf::Reduce::sum(), Pscf::Reduce::sum(), Pscf::Reduce::sum(), Pscf::CudaVecRandom::uniform(), and Pscf::CudaVecRandom::uniform().

◆ cArray() [2/2]

template<typename Data>
const Data * Pscf::DeviceArray< Data >::cArray ( ) const

Return const pointer to underlying C array.

Definition at line 600 of file DeviceArray.h.

References dataPtr_, and UTIL_CHECK.

Member Data Documentation

◆ dataPtr_

template<typename Data>
Data* Pscf::DeviceArray< Data >::dataPtr_
protected

◆ capacity_

template<typename Data>
int Pscf::DeviceArray< Data >::capacity_
protected

Allocated size (capacity) of the array.

Definition at line 292 of file DeviceArray.h.

Referenced by allocate(), associate(), associate(), capacity(), deallocate(), DeviceArray(), DeviceArray(), DeviceArray(), DeviceArray(), dissociate(), operator=(), and operator=().

◆ refCounter_

template<typename Data>
ReferenceCounter Pscf::DeviceArray< Data >::refCounter_
protected

Counter for any arrays that use data owned by this.

Definition at line 295 of file DeviceArray.h.

Referenced by addReference(), deallocate(), and ~DeviceArray().

◆ ref_

template<typename Data>
CountedReference Pscf::DeviceArray< Data >::ref_
protected

Reference to another array that owns memory used by this one.

Definition at line 298 of file DeviceArray.h.

Referenced by allocate(), associate(), associate(), deallocate(), dissociate(), isAssociated(), isOwner(), and ~DeviceArray().


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