ThunderSVM
ThunderSVM: An Open-Source SVM Library on GPUs and CPUs
Public Member Functions | List of all members
SyncArray< T > Class Template Reference

Wrapper of SyncMem with a type. More...

#include <syncarray.h>

Inheritance diagram for SyncArray< T >:

Public Member Functions

 SyncArray (size_t count)
 
const T * host_data () const
 
const T * device_data () const
 
T * host_data ()
 
T * device_data ()
 
void set_host_data (T *host_ptr)
 
void set_device_data (T *device_ptr)
 
void to_host () const
 
void to_device () const
 
void copy_from (const T *source, size_t count)
 
void copy_from (const SyncArray< T > &source)
 
void mem_set (const T &value)
 
void resize (size_t count)
 
size_t mem_size () const
 
size_t size () const
 
SyncMem::HEAD head () const
 
void log (el::base::type::ostream_t &ostream) const override
 

Detailed Description

template<typename T>
class SyncArray< T >

Wrapper of SyncMem with a type.

Template Parameters
Ttype of element

Constructor & Destructor Documentation

◆ SyncArray()

template<typename T >
SyncArray< T >::SyncArray ( size_t  count)
explicit

initialize class that can store given count of elements

Parameters
countthe given count

Member Function Documentation

◆ copy_from()

template<typename T>
void SyncArray< T >::copy_from ( const T *  source,
size_t  count 
)

random access operator

Parameters
indexthe index of the elements
Returns
host element at the index copy device data. This will call to_device() implicitly.
Parameters
sourcesource device data pointer
countthe count of elements

◆ mem_set()

template<typename T>
void SyncArray< T >::mem_set ( const T &  value)

set all elements to the given value. This method will set device data.

Parameters
value

◆ resize()

template<typename T >
void SyncArray< T >::resize ( size_t  count)

resize to a new size. This will also clear all data.

Parameters
count

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