Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
Alien::SYCLVector< ValueT > Class Template Reference
Inheritance diagram for Alien::SYCLVector< ValueT >:
Collaboration diagram for Alien::SYCLVector< ValueT >:

Public Types

typedef ValueT ValueType
typedef Integer IndexType
typedef SYCLInternal::VectorInternal< ValueType > VectorInternal
Public Types inherited from Alien::IVectorImpl
typedef Arccore::Real ValueType
 Type of the values stored in the vectors.

Public Member Functions

 SYCLVector ()
 Constructeur sans association un MultiImpl.
 SYCLVector (const MultiVectorImpl *multi_impl)
 Constructeur avec association ? un MultiImpl.
VectorInternal * internal ()
VectorInternal const * internal () const
Integer blockSize () const
void setBlockSize (Integer block_size)
Integer getAllocSize () const
void allocate ()
void resize (Integer alloc_size) const
void clear ()
 Wipe out internal data.
void init (const VectorDistribution &dist, const bool need_allocate)
 Initialize vector datas.
void init (const VectorDistribution &dist, Integer block_size, const bool need_allocate)
const VectorDistributiondistribution () const
 Get the distribution of the vector.
Arccore::Integer scalarizedLocalSize () const
 Get the "scalarized" local size.
Arccore::Integer scalarizedGlobalSize () const
 Get the "scalarized" global size.
Arccore::Integer scalarizedOffset () const
 Get the "scalarized" offset.
ValueType * getDataPtr ()
ValueType * data ()
ValueType const * getDataPtr () const
ValueType const * data () const
ValueType const * getAddressData () const
void initDevicePointers (int **rows, ValueType **values) const
template<typename LambdaT>
void apply (LambdaT const &lambda)
void setValues (std::size_t size, ValueType const *ptr)
void setValuesFromHost (std::size_t size, ValueType const *ptr)
void setValuesFromDevice (std::size_t size, ValueType const *ptr)
void setValuesFromHost ()
void copyValuesTo (std::size_t size, ValueType *ptr) const
void copyValuesToDevice (std::size_t size, ValueType *ptr) const
void copyValuesToDevice (ValueType *ptr) const
void pointWiseMult (SYCLVector const &y, SYCLVector &z) const
template<typename E>
SYCLVectoroperator= (E const &expr)
Public Member Functions inherited from Alien::IVectorImpl
 IVectorImpl (const MultiVectorImpl *multi_impl, BackEndId backend="")
 Constructor.
virtual ~IVectorImpl () override
 Free resources.
 IVectorImpl (const IVectorImpl &src)=delete
 IVectorImpl (IVectorImpl &&src)=delete
IVectorImploperator= (const IVectorImpl &src)=delete
IVectorImploperator= (IVectorImpl &&src)=delete
virtual const ISpacespace () const
 Get the vector space.
virtual BackEndId backend () const
virtual const Blockblock () const
 Get block datas of the vector.
virtual const VBlockvblock () const
 Get block datas of the vector.
const MultiVectorImplimpls () const
Public Member Functions inherited from Alien::Timestamp
 Timestamp (const TimestampMng *manager)
virtual ~Timestamp ()
 Destructeur de la classe.
virtual Int64 timestamp () const
 Donne la valeur courante du timestamp.
void updateTimestamp ()
 Met à jour le timestamp.
void copyTimestamp (const Timestamp &v)
 Copy un autre timestamp.
void setTimestamp (const TimestampMng *manager, const Int64 timestamp)
Public Member Functions inherited from Alien::ObjectWithTrace
template<typename T>
void alien_info (T &&t) const
template<typename T>
void alien_debug (T &&t) const
template<typename T>
void alien_warning (T &&t) const
template<typename T>
void alien_fatal (T &&t) const
ITraceMng * traceMng () const

Static Public Member Functions

static void allocateDevicePointers (std::size_t local_size, int **rows, ValueType **values)
static void allocateDevicePointers (std::size_t local_size, ValueType **values)
static void freeDevicePointers (int *rows, ValueType *values)
static void freeDevicePointers (ValueType *values)
static void initDevicePointers (std::size_t local_size, ValueType const *host_values, int **rows, ValueType **values)
static void copyDeviceToHost (std::size_t local_size, ValueType const *device_values, ValueType *host_values)

Private Attributes

std::unique_ptr< VectorInternal > m_internal
std::vector< ValueType > m_h_values
std::size_t m_local_size = 0
Integer m_own_block_size = 1
VectorDistribution m_own_distribution
std::unique_ptr< VBlockImplm_vblock

Additional Inherited Members

Protected Member Functions inherited from Alien::ObjectWithTrace
TraceMessage cout () const
Protected Attributes inherited from Alien::IVectorImpl
const MultiVectorImplm_multi_impl
 Pointer on vectors implementations.
BackEndId m_backend
 Backend id.
VBlockSizesm_vblock_sizes
 Variable blocks size data.

Detailed Description

template<typename ValueT>
class Alien::SYCLVector< ValueT >

Definition at line 32 of file SYCLVector.h.

Member Typedef Documentation

◆ IndexType

template<typename ValueT>
typedef Integer Alien::SYCLVector< ValueT >::IndexType

Definition at line 36 of file SYCLVector.h.

◆ ValueType

template<typename ValueT>
typedef ValueT Alien::SYCLVector< ValueT >::ValueType

Definition at line 35 of file SYCLVector.h.

◆ VectorInternal

template<typename ValueT>
typedef SYCLInternal::VectorInternal<ValueType> Alien::SYCLVector< ValueT >::VectorInternal

Definition at line 38 of file SYCLVector.h.

Constructor & Destructor Documentation

◆ SYCLVector() [1/2]

template<typename ValueT>
Alien::SYCLVector< ValueT >::SYCLVector ( )

Constructeur sans association un MultiImpl.

Definition at line 23 of file SYCLVector.cc.

References Alien::IVectorImpl::IVectorImpl().

Here is the call graph for this function:

◆ SYCLVector() [2/2]

template<typename ValueT>
Alien::SYCLVector< ValueT >::SYCLVector ( const MultiVectorImpl * multi_impl)

Constructeur avec association ? un MultiImpl.

Definition at line 29 of file SYCLVector.cc.

References Alien::IVectorImpl::IVectorImpl().

Here is the call graph for this function:

◆ ~SYCLVector()

template<typename ValueT>
Alien::SYCLVector< ValueT >::~SYCLVector ( )
virtual

Definition at line 35 of file SYCLVector.cc.

Member Function Documentation

◆ allocate()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::allocate ( )

Definition at line 39 of file SYCLVector.cc.

◆ allocateDevicePointers() [1/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::allocateDevicePointers ( std::size_t local_size,
int ** rows,
ValueType ** values )
static

Definition at line 163 of file SYCLVector.cc.

◆ allocateDevicePointers() [2/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::allocateDevicePointers ( std::size_t local_size,
ValueType ** values )
static

Definition at line 195 of file SYCLVector.cc.

◆ apply()

template<typename ValueT>
template<typename LambdaT>
void Alien::SYCLVector< ValueT >::apply ( LambdaT const & lambda)
inline

Definition at line 197 of file SYCLVector.h.

◆ blockSize()

template<typename ValueT>
Integer Alien::SYCLVector< ValueT >::blockSize ( ) const
inline

Definition at line 60 of file SYCLVector.h.

◆ clear()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::clear ( )
virtual

Wipe out internal data.

Reimplemented from Alien::IVectorImpl.

Definition at line 56 of file SYCLVector.cc.

◆ copyDeviceToHost()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::copyDeviceToHost ( std::size_t local_size,
ValueType const * device_values,
ValueType * host_values )
static

Definition at line 258 of file SYCLVector.cc.

◆ copyValuesTo()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::copyValuesTo ( std::size_t size,
ValueType * ptr ) const

Definition at line 96 of file SYCLVector.cc.

◆ copyValuesToDevice() [1/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::copyValuesToDevice ( std::size_t size,
ValueType * ptr ) const

Definition at line 104 of file SYCLVector.cc.

◆ copyValuesToDevice() [2/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::copyValuesToDevice ( ValueType * ptr) const
inline

Definition at line 218 of file SYCLVector.h.

◆ data() [1/2]

template<typename ValueT>
ValueType * Alien::SYCLVector< ValueT >::data ( )
inline

Definition at line 168 of file SYCLVector.h.

◆ data() [2/2]

template<typename ValueT>
ValueType const * Alien::SYCLVector< ValueT >::data ( ) const
inline

Definition at line 171 of file SYCLVector.h.

◆ distribution()

template<typename ValueT>
const VectorDistribution & Alien::SYCLVector< ValueT >::distribution ( ) const
inlinevirtual

Get the distribution of the vector.

Returns
The vector distribution

Reimplemented from Alien::IVectorImpl.

Definition at line 135 of file SYCLVector.h.

◆ freeDevicePointers() [1/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::freeDevicePointers ( int * rows,
ValueType * values )
static

Definition at line 146 of file SYCLVector.cc.

◆ freeDevicePointers() [2/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::freeDevicePointers ( ValueType * values)
static

Definition at line 155 of file SYCLVector.cc.

◆ getAddressData()

template<typename ValueT>
ValueType const * Alien::SYCLVector< ValueT >::getAddressData ( ) const
inline

Definition at line 172 of file SYCLVector.h.

◆ getAllocSize()

template<typename ValueT>
Integer Alien::SYCLVector< ValueT >::getAllocSize ( ) const
inline

Definition at line 82 of file SYCLVector.h.

◆ getDataPtr() [1/2]

template<typename ValueT>
ValueType * Alien::SYCLVector< ValueT >::getDataPtr ( )
inline

Definition at line 167 of file SYCLVector.h.

◆ getDataPtr() [2/2]

template<typename ValueT>
ValueType const * Alien::SYCLVector< ValueT >::getDataPtr ( ) const
inline

Definition at line 170 of file SYCLVector.h.

◆ init() [1/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::init ( const VectorDistribution & dist,
const bool do_alloc )
inlinevirtual

Initialize vector datas.

Parameters
[in]distThe vector distribution
[in]do_allocAllocate memory or not
Todo
Fix this method : could be removed during the process of solver refactoring

Reimplemented from Alien::IVectorImpl.

Definition at line 93 of file SYCLVector.h.

◆ init() [2/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::init ( const VectorDistribution & dist,
Integer block_size,
const bool need_allocate )
inline

Definition at line 112 of file SYCLVector.h.

◆ initDevicePointers() [1/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::initDevicePointers ( int ** rows,
ValueType ** values ) const

Definition at line 113 of file SYCLVector.cc.

◆ initDevicePointers() [2/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::initDevicePointers ( std::size_t local_size,
ValueType const * host_values,
int ** rows,
ValueType ** values )
static

Definition at line 223 of file SYCLVector.cc.

◆ internal() [1/2]

template<typename ValueT>
VectorInternal * Alien::SYCLVector< ValueT >::internal ( )
inline

Definition at line 50 of file SYCLVector.h.

◆ internal() [2/2]

template<typename ValueT>
VectorInternal const * Alien::SYCLVector< ValueT >::internal ( ) const
inline

Definition at line 55 of file SYCLVector.h.

◆ pointWiseMult()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::pointWiseMult ( SYCLVector< ValueT > const & y,
SYCLVector< ValueT > & z ) const

Definition at line 287 of file SYCLVector.cc.

◆ resize()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::resize ( Integer alloc_size) const

Definition at line 48 of file SYCLVector.cc.

◆ scalarizedGlobalSize()

template<typename ValueT>
Arccore::Integer Alien::SYCLVector< ValueT >::scalarizedGlobalSize ( ) const
inlinevirtual

Get the "scalarized" global size.

See also
VBlockSizes for "scalarized" definition
Returns
The actual global size

Reimplemented from Alien::IVectorImpl.

Definition at line 151 of file SYCLVector.h.

◆ scalarizedLocalSize()

template<typename ValueT>
Arccore::Integer Alien::SYCLVector< ValueT >::scalarizedLocalSize ( ) const
inlinevirtual

Get the "scalarized" local size.

See also
VBlockSizes for "scalarized" definition
Returns
The actual local size

Reimplemented from Alien::IVectorImpl.

Definition at line 143 of file SYCLVector.h.

◆ scalarizedOffset()

template<typename ValueT>
Arccore::Integer Alien::SYCLVector< ValueT >::scalarizedOffset ( ) const
inlinevirtual

Get the "scalarized" offset.

See also
VBlockSizes for "scalarized" definition
Returns
The actual offset

Reimplemented from Alien::IVectorImpl.

Definition at line 159 of file SYCLVector.h.

◆ setBlockSize()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::setBlockSize ( Integer block_size)
inline

Definition at line 74 of file SYCLVector.h.

◆ setValues()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::setValues ( std::size_t size,
ValueType const * ptr )

Definition at line 72 of file SYCLVector.cc.

◆ setValuesFromDevice()

template<typename ValueT>
void Alien::SYCLVector< ValueT >::setValuesFromDevice ( std::size_t size,
ValueType const * ptr )

Definition at line 81 of file SYCLVector.cc.

◆ setValuesFromHost() [1/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::setValuesFromHost ( )

Definition at line 65 of file SYCLVector.cc.

◆ setValuesFromHost() [2/2]

template<typename ValueT>
void Alien::SYCLVector< ValueT >::setValuesFromHost ( std::size_t size,
ValueType const * ptr )

Definition at line 88 of file SYCLVector.cc.

Member Data Documentation

◆ m_h_values

template<typename ValueT>
std::vector<ValueType> Alien::SYCLVector< ValueT >::m_h_values
mutableprivate

Definition at line 233 of file SYCLVector.h.

◆ m_internal

template<typename ValueT>
std::unique_ptr<VectorInternal> Alien::SYCLVector< ValueT >::m_internal
mutableprivate

Definition at line 232 of file SYCLVector.h.

◆ m_local_size

template<typename ValueT>
std::size_t Alien::SYCLVector< ValueT >::m_local_size = 0
private

Definition at line 234 of file SYCLVector.h.

◆ m_own_block_size

template<typename ValueT>
Integer Alien::SYCLVector< ValueT >::m_own_block_size = 1
private

Definition at line 235 of file SYCLVector.h.

◆ m_own_distribution

template<typename ValueT>
VectorDistribution Alien::SYCLVector< ValueT >::m_own_distribution
private

Definition at line 236 of file SYCLVector.h.

◆ m_vblock

template<typename ValueT>
std::unique_ptr<VBlockImpl> Alien::SYCLVector< ValueT >::m_vblock
mutableprivate

Definition at line 237 of file SYCLVector.h.


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