www.cemf.ir
indexContainer< IndexType > Class Template Reference

It holds two vectors of indecis on Host and Device. More...

Classes

class  IndexAccessor
 Helper class for accessing index on host or device. More...
 

Public Types

using DVType = DualViewType1D< IndexType >
 
using DeviceViewType = typename DVType::t_dev
 Device type on device. More...
 
using HostViewType = typename DVType::t_host
 Host type on device. More...
 
using HostType = typename HostViewType::device_type
 Host memory type. More...
 
using DeviceType = typename DeviceViewType::device_type
 Device memory ype. More...
 

Public Member Functions

 TypeInfoTemplateNV11 ("indexContainer", IndexType)
 
 indexContainer ()
 Default. More...
 
template<typename T >
 indexContainer (const Range< T > &rng)
 Construct from a Range (half open) More...
 
 indexContainer (IndexType begin, IndexType end)
 Construct half open [begin,end) More...
 
 indexContainer (IndexType *data, int32 numElems)
 From data and number of elements in data. More...
 
 indexContainer (std::vector< IndexType > &ind)
 
 indexContainer (const DeviceViewType &ind)
 
 indexContainer (const indexContainer &)=default
 Copy. More...
 
indexContaineroperator= (const indexContainer &)=default
 Copy assignment. More...
 
 indexContainer (indexContainer &&)=default
 Move. More...
 
indexContaineroperator= (indexContainer &&)=default
 Mover assignement. More...
 
 ~indexContainer ()=default
 Destructor. More...
 
INLINE_FUNCTION_HD auto size () const
 Size. More...
 
INLINE_FUNCTION_HD bool empty () const
 If the container empty. More...
 
INLINE_FUNCTION_HD IndexType min () const
 Min value of indices. More...
 
INLINE_FUNCTION_HD IndexType max () const
 Max value of indices. More...
 
const HostViewTypehostView () const
 Return Host veiw. More...
 
const DeviceViewTypedeviceView () const
 Return Device view. More...
 
HostViewTypehostView ()
 Return Host veiw. More...
 
DeviceViewTypedeviceView ()
 Return Device veiw. More...
 
auto indicesHost () const
 Return index accessor that works on Host. More...
 
auto indicesDevice () const
 Return index accessor that works on Device. More...
 
void modifyOnHost ()
 Mark host is modified. More...
 
void modifyOnDevice ()
 Mark device is modified. More...
 
void syncViews ()
 synchronize views More...
 
void syncViews (uint32 newSize)
 

Protected Attributes

IndexType min_ = 0
 min value in indices More...
 
IndexType max_ = 0
 max value in the indices More...
 
uint32 size_ = 0
 number/size of index vector More...
 
DVType views_
 views to hold indices on Host and Device More...
 

Detailed Description

template<typename IndexType>
class pFlow::indexContainer< IndexType >

It holds two vectors of indecis on Host and Device.

Host vector should be used for threads running on Host and Device vector should be used for threads running on Device.

Definition at line 39 of file indexContainer.hpp.

Member Typedef Documentation

◆ DVType

using DVType = DualViewType1D<IndexType>

Definition at line 43 of file indexContainer.hpp.

◆ DeviceViewType

using DeviceViewType = typename DVType::t_dev

Device type on device.

Definition at line 45 of file indexContainer.hpp.

◆ HostViewType

using HostViewType = typename DVType::t_host

Host type on device.

Definition at line 48 of file indexContainer.hpp.

◆ HostType

using HostType = typename HostViewType::device_type

Host memory type.

Definition at line 51 of file indexContainer.hpp.

◆ DeviceType

using DeviceType = typename DeviceViewType::device_type

Device memory ype.

Definition at line 54 of file indexContainer.hpp.

Constructor & Destructor Documentation

◆ indexContainer() [1/8]

indexContainer ( )
inline

Default.

Definition at line 102 of file indexContainer.hpp.

◆ indexContainer() [2/8]

indexContainer ( const Range< T > &  rng)
inline

Construct from a Range (half open)

Definition at line 106 of file indexContainer.hpp.

◆ indexContainer() [3/8]

indexContainer ( IndexType  begin,
IndexType  end 
)
inline

Construct half open [begin,end)

Definition at line 116 of file indexContainer.hpp.

References pFlow::copy(), pFlow::fillSequence(), indexContainer< IndexType >::min_, indexContainer< IndexType >::size_, and indexContainer< IndexType >::views_.

+ Here is the call graph for this function:

◆ indexContainer() [4/8]

indexContainer ( IndexType *  data,
int32  numElems 
)
inline

From data and number of elements in data.

data is a pointer in the Host memory

Definition at line 129 of file indexContainer.hpp.

References pFlow::copy(), pFlow::max(), indexContainer< IndexType >::max_, pFlow::min(), indexContainer< IndexType >::min_, and indexContainer< IndexType >::views_.

+ Here is the call graph for this function:

◆ indexContainer() [5/8]

indexContainer ( std::vector< IndexType > &  ind)
inline

Definition at line 141 of file indexContainer.hpp.

◆ indexContainer() [6/8]

◆ indexContainer() [7/8]

indexContainer ( const indexContainer< IndexType > &  )
default

Copy.

◆ indexContainer() [8/8]

indexContainer ( indexContainer< IndexType > &&  )
default

Move.

◆ ~indexContainer()

~indexContainer ( )
default

Destructor.

Member Function Documentation

◆ TypeInfoTemplateNV11()

TypeInfoTemplateNV11 ( "indexContainer< IndexType >"  ,
IndexType   
)

◆ operator=() [1/2]

indexContainer& operator= ( const indexContainer< IndexType > &  )
default

Copy assignment.

◆ operator=() [2/2]

indexContainer& operator= ( indexContainer< IndexType > &&  )
default

Mover assignement.

◆ size()

◆ empty()

INLINE_FUNCTION_HD bool empty ( ) const
inline

If the container empty.

Definition at line 182 of file indexContainer.hpp.

References indexContainer< IndexType >::size_.

Referenced by VectorSingle< uint32, HostSpace >::insertSetElement().

+ Here is the caller graph for this function:

◆ min()

INLINE_FUNCTION_HD IndexType min ( ) const
inline

Min value of indices.

Definition at line 189 of file indexContainer.hpp.

References indexContainer< IndexType >::min_.

Referenced by VectorDual< multiRotatingAxis >::insertSetElement().

+ Here is the caller graph for this function:

◆ max()

INLINE_FUNCTION_HD IndexType max ( ) const
inline

◆ hostView() [1/2]

const HostViewType& hostView ( ) const
inline

◆ deviceView() [1/2]

◆ hostView() [2/2]

HostViewType& hostView ( )
inline

Return Host veiw.

Definition at line 214 of file indexContainer.hpp.

References indexContainer< IndexType >::views_.

◆ deviceView() [2/2]

DeviceViewType& deviceView ( )
inline

Return Device veiw.

Definition at line 220 of file indexContainer.hpp.

References indexContainer< IndexType >::views_.

◆ indicesHost()

auto indicesHost ( ) const
inline

Return index accessor that works on Host.

Definition at line 226 of file indexContainer.hpp.

References indexContainer< IndexType >::views_.

◆ indicesDevice()

auto indicesDevice ( ) const
inline

Return index accessor that works on Device.

Definition at line 232 of file indexContainer.hpp.

References indexContainer< IndexType >::views_.

◆ modifyOnHost()

void modifyOnHost ( )
inline

Mark host is modified.

Definition at line 238 of file indexContainer.hpp.

References indexContainer< IndexType >::views_.

◆ modifyOnDevice()

void modifyOnDevice ( )
inline

Mark device is modified.

Definition at line 244 of file indexContainer.hpp.

References indexContainer< IndexType >::views_.

Referenced by pFlow::getSortedIndices().

+ Here is the caller graph for this function:

◆ syncViews() [1/2]

void syncViews ( )
inline

synchronize views

Definition at line 250 of file indexContainer.hpp.

References pFlow::max(), indexContainer< IndexType >::max_, pFlow::min(), indexContainer< IndexType >::min_, indexContainer< IndexType >::size_, and indexContainer< IndexType >::views_.

Referenced by pFlow::getSortedIndices(), and indexContainer< IndexType >::syncViews().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ syncViews() [2/2]

void syncViews ( uint32  newSize)
inline

Definition at line 273 of file indexContainer.hpp.

References indexContainer< IndexType >::size_, and indexContainer< IndexType >::syncViews().

+ Here is the call graph for this function:

Member Data Documentation

◆ min_

IndexType min_ = 0
protected

◆ max_

IndexType max_ = 0
protected

◆ size_

◆ views_


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