monolish  0.17.3-dev.16
MONOlithic LInear equation Solvers for Highly-parallel architecture
Public Member Functions | Private Attributes | List of all members
monolish::view_tensor_Dense< TYPE, Float > Class Template Reference

Dense view class. More...

#include <monolish_view_tensor_dense.hpp>

Collaboration diagram for monolish::view_tensor_Dense< TYPE, Float >:
Collaboration graph

Public Member Functions

template<typename... Args>
Float at (const size_t dim, const Args... args)
 get element A[pos[0]][pos[1]]... (onlu CPU) More...
 
template<typename... Args>
Float at (const size_t dim, const Args... args) const
 get element A[pos[0]][pos[1]]... More...
 
Float at (const size_t pos)
 get element A[index] (only CPU) More...
 
Float at (const size_t pos) const
 get element A[index] More...
 
Float at (const std::vector< size_t > &pos)
 get element A[pos[0]][pos[1]]... More...
 
Float at (const std::vector< size_t > &pos) const
 get element A[pos[0]][pos[1]]... More...
 
template<typename... Args>
Float at (const std::vector< size_t > &pos, const Args... args)
 get element A[pos[0]][pos[1]]... (onlu CPU) More...
 
template<typename... Args>
Float at (const std::vector< size_t > &pos, const size_t dim, const Args... args) const
 get element A[pos[0]][pos[1]]... More...
 
Float * begin ()
 returns begin iterator (include offset) More...
 
Float * begin () const
 returns begin iterator (include offset) More...
 
size_t calc_range () const
 calculate view_tensor_Dense size from shape More...
 
Float * data ()
 returns a direct pointer to the vector (dont include offset) More...
 
Float * data () const
 returns a direct pointer to the original vector (dont include offset) More...
 
void diag_add (const Float alpha)
 Scalar and diag. vector of Dense format matrix add. More...
 
void diag_add (const vector< Float > &vec)
 Vector and diag. vector of Dense format matrix add. More...
 
void diag_add (const view1D< matrix::Dense< Float >, Float > &vec)
 
void diag_add (const view1D< tensor::tensor_Dense< Float >, Float > &vec)
 
void diag_add (const view1D< vector< Float >, Float > &vec)
 
void diag_div (const Float alpha)
 Scalar and diag. vector of Dense format matrix div. More...
 
void diag_div (const vector< Float > &vec)
 Vector and diag. vector of Dense format matrix div. More...
 
void diag_div (const view1D< matrix::Dense< Float >, Float > &vec)
 
void diag_div (const view1D< tensor::tensor_Dense< Float >, Float > &vec)
 
void diag_div (const view1D< vector< Float >, Float > &vec)
 
void diag_mul (const Float alpha)
 Scalar and diag. vector of Dense format matrix mul. More...
 
void diag_mul (const vector< Float > &vec)
 Vector and diag. vector of Dense format matrix mul. More...
 
void diag_mul (const view1D< matrix::Dense< Float >, Float > &vec)
 
void diag_mul (const view1D< tensor::tensor_Dense< Float >, Float > &vec)
 
void diag_mul (const view1D< vector< Float >, Float > &vec)
 
void diag_sub (const Float alpha)
 Scalar and diag. vector of Dense format matrix sub. More...
 
void diag_sub (const vector< Float > &vec)
 Vector and diag. vector of Dense format matrix sub. More...
 
void diag_sub (const view1D< matrix::Dense< Float >, Float > &vec)
 
void diag_sub (const view1D< tensor::tensor_Dense< Float >, Float > &vec)
 
void diag_sub (const view1D< vector< Float >, Float > &vec)
 
Float * end ()
 returns a end iterator More...
 
Float * end () const
 returns a end iterator More...
 
void fill (Float value)
 fill vector elements with a scalar value More...
 
size_t get_alloc_nnz () const
 
size_t get_device_mem_stat () const
 true: sended, false: not send More...
 
size_t get_first () const
 get first position More...
 
std::shared_ptr< bool > get_gpu_status () const
 gpu status shared pointer More...
 
std::vector< size_t > get_index (const size_t pos) const
 get vector index from aligned index (A[pos[0]][pos[1]]... = A[ind]) More...
 
size_t get_index (const std::vector< size_t > &pos) const
 get aligned index from vector index (A[pos] = A[ind[0]][ind[1]]...) More...
 
size_t get_last () const
 get end position More...
 
size_t get_nnz () const
 get view_tensor_Dense size (same as size()) More...
 
size_t get_offset () const
 get first position (same as get_first()) More...
 
std::vector< size_t > get_shape () const
 get shape More...
 
TYPE & get_target ()
 returns a reference of the target More...
 
TYPE & get_target () const
 returns a reference of the target More...
 
std::shared_ptr< Float > get_val () const
 
void insert (const size_t i, const Float Val)
 set element A[index]... More...
 
void insert (const std::vector< size_t > &pos, const Float Val)
 set element A[pos[0]][pos[1]]... More...
 
void operator= (const tensor::tensor_Dense< Float > &tens)
 tensor copy More...
 
void operator= (const view_tensor_Dense< matrix::Dense< Float >, Float > &tens)
 tensor copy More...
 
void operator= (const view_tensor_Dense< tensor::tensor_Dense< Float >, Float > &tens)
 tensor copy More...
 
void operator= (const view_tensor_Dense< vector< Float >, Float > &tens)
 tensor copy More...
 
Float & operator[] (const size_t i)
 reference to the element at position More...
 
void print_all (bool force_cpu=false) const
 print all elements to standart I/O More...
 
void recv ()
 recv data from GPU, and free data on GPU More...
 
void resize (std::vector< size_t > &shape_)
 change last postion More...
 
void send () const
 send data to GPU More...
 
void set_first (size_t i)
 change first position More...
 
void set_last (size_t i)
 change last position More...
 
size_t size () const
 get view_tensor_Dense size (range) More...
 
std::string type () const
 get format name "view_tensor_Dense" More...
 
 view_tensor_Dense (matrix::Dense< Float > &A, const size_t start, const std::vector< size_t > &shape_)
 create view_tensor_Dense from Dense matrix(start:start+range) More...
 
 view_tensor_Dense (tensor::tensor_Dense< Float > &A, const size_t start, const std::vector< size_t > &shape_)
 create view_tensor_Dense from Dense tensor(start:start+range) More...
 
 view_tensor_Dense (vector< Float > &x, const size_t start, const std::vector< size_t > &shape_)
 create view_tensor_Dense from vector(start:start+range) More...
 
 view_tensor_Dense (view_tensor_Dense< matrix::Dense< Float >, Float > &x, const size_t start, const std::vector< size_t > &shape_)
 create view_tensor_Dense from monolish::matrix::Dense(start:start+range) More...
 
 view_tensor_Dense (view_tensor_Dense< tensor::tensor_Dense< Float >, Float > &x, const size_t start, const std::vector< size_t > &shape_)
 create view_tensor_Dense from monolish::tensor::tensor_Dense(start:start+range) More...
 
 view_tensor_Dense (view_tensor_Dense< vector< Float >, Float > &x, const size_t start, const std::vector< size_t > &shape_)
 create view_tensor_Dense from monolish::vector(start:start+range) More...
 

Private Attributes

size_t first
 
size_t last
 
size_t range
 
std::vector< size_t > shape
 
TYPE & target
 
Float * target_data
 

Detailed Description

template<typename TYPE, typename Float>
class monolish::view_tensor_Dense< TYPE, Float >

Dense view class.

Note
  • Multi-threading: true
  • GPU acceleration: true

Definition at line 50 of file monolish_view_tensor_dense.hpp.

Constructor & Destructor Documentation

◆ view_tensor_Dense() [1/6]

template<typename TYPE , typename Float >
monolish::view_tensor_Dense< TYPE, Float >::view_tensor_Dense ( vector< Float > &  x,
const size_t  start,
const std::vector< size_t > &  shape_ 
)
inline

create view_tensor_Dense from vector(start:start+range)

Parameters
xvector
startstart position
shape_shape of tensor
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 71 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ view_tensor_Dense() [2/6]

template<typename TYPE , typename Float >
monolish::view_tensor_Dense< TYPE, Float >::view_tensor_Dense ( matrix::Dense< Float > &  A,
const size_t  start,
const std::vector< size_t > &  shape_ 
)
inline

create view_tensor_Dense from Dense matrix(start:start+range)

Parameters
ADense matrix
startstart position
shape_shape of tensor
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 91 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ view_tensor_Dense() [3/6]

template<typename TYPE , typename Float >
monolish::view_tensor_Dense< TYPE, Float >::view_tensor_Dense ( tensor::tensor_Dense< Float > &  A,
const size_t  start,
const std::vector< size_t > &  shape_ 
)
inline

create view_tensor_Dense from Dense tensor(start:start+range)

Parameters
ADense matrix
startstart position
shape_shape of tensor
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 111 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ view_tensor_Dense() [4/6]

template<typename TYPE , typename Float >
monolish::view_tensor_Dense< TYPE, Float >::view_tensor_Dense ( view_tensor_Dense< vector< Float >, Float > &  x,
const size_t  start,
const std::vector< size_t > &  shape_ 
)
inline

create view_tensor_Dense from monolish::vector(start:start+range)

Parameters
xview_tensor_Dense create from monolish::vector
startstart position (x.first + start)
shape_shape of tensor
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 131 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ view_tensor_Dense() [5/6]

template<typename TYPE , typename Float >
monolish::view_tensor_Dense< TYPE, Float >::view_tensor_Dense ( view_tensor_Dense< matrix::Dense< Float >, Float > &  x,
const size_t  start,
const std::vector< size_t > &  shape_ 
)
inline

create view_tensor_Dense from monolish::matrix::Dense(start:start+range)

Parameters
xview_tensor_Dense create from monolish::matrix::Dense
startstart position (x.first + start)
shape_shape of tensor
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 152 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ view_tensor_Dense() [6/6]

template<typename TYPE , typename Float >
monolish::view_tensor_Dense< TYPE, Float >::view_tensor_Dense ( view_tensor_Dense< tensor::tensor_Dense< Float >, Float > &  x,
const size_t  start,
const std::vector< size_t > &  shape_ 
)
inline

create view_tensor_Dense from monolish::tensor::tensor_Dense(start:start+range)

Parameters
xview_tensor_Dense create from monolish::tensor::tensor_Dense
startstart position (x.first + start)
shape_shape of tensor
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 173 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ at() [1/8]

template<typename TYPE , typename Float >
template<typename... Args>
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const size_t  dim,
const Args...  args 
)
inline

get element A[pos[0]][pos[1]]... (onlu CPU)

Parameters
posstd::vector position
Returns
A[pos[0]][pos[1]]...
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 407 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ at() [2/8]

template<typename TYPE , typename Float >
template<typename... Args>
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const size_t  dim,
const Args...  args 
) const
inline

get element A[pos[0]][pos[1]]...

Parameters
posstd::vector position
Returns
A[pos[0]][pos[1]]...
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 351 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ at() [3/8]

template<typename TYPE , typename Float >
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const size_t  pos)
inline

get element A[index] (only CPU)

Parameters
posaligned position index
Returns
A[index]
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 366 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ at() [4/8]

template<typename TYPE , typename Float >
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const size_t  pos) const
inline

get element A[index]

Parameters
posaligned position index
Returns
A[index]
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 307 of file monolish_view_tensor_dense.hpp.

Here is the caller graph for this function:

◆ at() [5/8]

template<typename TYPE , typename Float >
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const std::vector< size_t > &  pos)
inline

get element A[pos[0]][pos[1]]...

Parameters
posstd::vector position
Returns
A[pos[0]][pos[1]]...
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 379 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ at() [6/8]

template<typename TYPE , typename Float >
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const std::vector< size_t > &  pos) const
inline

get element A[pos[0]][pos[1]]...

Parameters
posstd::vector position
Returns
A[pos[0]][pos[1]]...
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 320 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ at() [7/8]

template<typename TYPE , typename Float >
template<typename... Args>
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const std::vector< size_t > &  pos,
const Args...  args 
)
inline

get element A[pos[0]][pos[1]]... (onlu CPU)

Parameters
posstd::vector position
Returns
A[pos[0]][pos[1]]...
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 393 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ at() [8/8]

template<typename TYPE , typename Float >
template<typename... Args>
Float monolish::view_tensor_Dense< TYPE, Float >::at ( const std::vector< size_t > &  pos,
const size_t  dim,
const Args...  args 
) const
inline

get element A[pos[0]][pos[1]]...

Parameters
posstd::vector position
Returns
A[pos[0]][pos[1]]...
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 334 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ begin() [1/2]

template<typename TYPE , typename Float >
Float* monolish::view_tensor_Dense< TYPE, Float >::begin ( )
inline

returns begin iterator (include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 506 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ begin() [2/2]

template<typename TYPE , typename Float >
Float* monolish::view_tensor_Dense< TYPE, Float >::begin ( ) const
inline

returns begin iterator (include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 498 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ calc_range()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::calc_range ( ) const
inline

calculate view_tensor_Dense size from shape

Returns
view_tensor_Dense size
Note
  • # of computation: dim

Definition at line 220 of file monolish_view_tensor_dense.hpp.

Here is the caller graph for this function:

◆ data() [1/2]

template<typename TYPE , typename Float >
Float* monolish::view_tensor_Dense< TYPE, Float >::data ( )
inline

returns a direct pointer to the vector (dont include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 474 of file monolish_view_tensor_dense.hpp.

◆ data() [2/2]

template<typename TYPE , typename Float >
Float* monolish::view_tensor_Dense< TYPE, Float >::data ( ) const
inline

returns a direct pointer to the original vector (dont include offset)

Returns
A pointer to the first element
Note
  • # of computation: 1

Definition at line 466 of file monolish_view_tensor_dense.hpp.

◆ diag_add() [1/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_add ( const Float  alpha)

Scalar and diag. vector of Dense format matrix add.

Parameters
alphascalar
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_add() [2/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_add ( const vector< Float > &  vec)

Vector and diag. vector of Dense format matrix add.

Parameters
vecvector
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_add() [3/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_add ( const view1D< matrix::Dense< Float >, Float > &  vec)

◆ diag_add() [4/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_add ( const view1D< tensor::tensor_Dense< Float >, Float > &  vec)

◆ diag_add() [5/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_add ( const view1D< vector< Float >, Float > &  vec)

◆ diag_div() [1/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_div ( const Float  alpha)

Scalar and diag. vector of Dense format matrix div.

Parameters
alphascalar
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_div() [2/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_div ( const vector< Float > &  vec)

Vector and diag. vector of Dense format matrix div.

Parameters
vecvector
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_div() [3/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_div ( const view1D< matrix::Dense< Float >, Float > &  vec)

◆ diag_div() [4/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_div ( const view1D< tensor::tensor_Dense< Float >, Float > &  vec)

◆ diag_div() [5/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_div ( const view1D< vector< Float >, Float > &  vec)

◆ diag_mul() [1/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul ( const Float  alpha)

Scalar and diag. vector of Dense format matrix mul.

Parameters
alphascalar
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_mul() [2/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul ( const vector< Float > &  vec)

Vector and diag. vector of Dense format matrix mul.

Parameters
vecvector
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_mul() [3/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul ( const view1D< matrix::Dense< Float >, Float > &  vec)

◆ diag_mul() [4/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul ( const view1D< tensor::tensor_Dense< Float >, Float > &  vec)

◆ diag_mul() [5/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul ( const view1D< vector< Float >, Float > &  vec)

◆ diag_sub() [1/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub ( const Float  alpha)

Scalar and diag. vector of Dense format matrix sub.

Parameters
alphascalar
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_sub() [2/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub ( const vector< Float > &  vec)

Vector and diag. vector of Dense format matrix sub.

Parameters
vecvector
Note
  • # of computation: M
  • Multi-threading: true
  • GPU acceleration: true

◆ diag_sub() [3/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub ( const view1D< matrix::Dense< Float >, Float > &  vec)

◆ diag_sub() [4/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub ( const view1D< tensor::tensor_Dense< Float >, Float > &  vec)

◆ diag_sub() [5/5]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub ( const view1D< vector< Float >, Float > &  vec)

◆ end() [1/2]

template<typename TYPE , typename Float >
Float* monolish::view_tensor_Dense< TYPE, Float >::end ( )
inline

returns a end iterator

Returns
end iterator
Note
  • # of computation: 1

Definition at line 522 of file monolish_view_tensor_dense.hpp.

◆ end() [2/2]

template<typename TYPE , typename Float >
Float* monolish::view_tensor_Dense< TYPE, Float >::end ( ) const
inline

returns a end iterator

Returns
end iterator
Note
  • # of computation: 1

Definition at line 514 of file monolish_view_tensor_dense.hpp.

◆ fill()

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::fill ( Float  value)

fill vector elements with a scalar value

Parameters
valuescalar value
Note
  • # of computation: N
  • Multi-threading: true
  • GPU acceleration: true

◆ get_alloc_nnz()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::get_alloc_nnz ( ) const
inline

Definition at line 279 of file monolish_view_tensor_dense.hpp.

◆ get_device_mem_stat()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::get_device_mem_stat ( ) const
inline

true: sended, false: not send

Returns
gpu status
Note
  • # of data transfer: 0
  • Multi-threading: false
  • GPU acceleration: true

Definition at line 447 of file monolish_view_tensor_dense.hpp.

◆ get_first()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::get_first ( ) const
inline

get first position

Returns
first position
Note
  • # of computation: 1

Definition at line 259 of file monolish_view_tensor_dense.hpp.

◆ get_gpu_status()

template<typename TYPE , typename Float >
std::shared_ptr<bool> monolish::view_tensor_Dense< TYPE, Float >::get_gpu_status ( ) const
inline

gpu status shared pointer

Returns
gpu status shared pointer

Definition at line 455 of file monolish_view_tensor_dense.hpp.

◆ get_index() [1/2]

template<typename TYPE , typename Float >
std::vector<size_t> monolish::view_tensor_Dense< TYPE, Float >::get_index ( const size_t  pos) const
inline

get vector index from aligned index (A[pos[0]][pos[1]]... = A[ind])

Parameters
posposition (scalar)
Returns
vector position
Note
  • # of computation: shape size
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 664 of file monolish_view_tensor_dense.hpp.

◆ get_index() [2/2]

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::get_index ( const std::vector< size_t > &  pos) const
inline

get aligned index from vector index (A[pos] = A[ind[0]][ind[1]]...)

Parameters
posposition (std::vector)
Returns
aligned position
Note
  • # of computation: shape size
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 643 of file monolish_view_tensor_dense.hpp.

Here is the caller graph for this function:

◆ get_last()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::get_last ( ) const
inline

get end position

Returns
end position
Note
  • # of computation: 1

Definition at line 267 of file monolish_view_tensor_dense.hpp.

◆ get_nnz()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::get_nnz ( ) const
inline

get view_tensor_Dense size (same as size())

Returns
view_tensor_Dense size
Note
  • # of computation: 1

Definition at line 251 of file monolish_view_tensor_dense.hpp.

◆ get_offset()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::get_offset ( ) const
inline

get first position (same as get_first())

Returns
first position
Note
  • # of computation: 1

Definition at line 275 of file monolish_view_tensor_dense.hpp.

Here is the caller graph for this function:

◆ get_shape()

template<typename TYPE , typename Float >
std::vector<size_t> monolish::view_tensor_Dense< TYPE, Float >::get_shape ( ) const
inline

get shape

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 235 of file monolish_view_tensor_dense.hpp.

◆ get_target() [1/2]

template<typename TYPE , typename Float >
TYPE& monolish::view_tensor_Dense< TYPE, Float >::get_target ( )
inline

returns a reference of the target

Returns
target
Note
  • # of computation: 1

Definition at line 490 of file monolish_view_tensor_dense.hpp.

◆ get_target() [2/2]

template<typename TYPE , typename Float >
TYPE& monolish::view_tensor_Dense< TYPE, Float >::get_target ( ) const
inline

returns a reference of the target

Returns
target
Note
  • # of computation: 1

Definition at line 482 of file monolish_view_tensor_dense.hpp.

◆ get_val()

template<typename TYPE , typename Float >
std::shared_ptr<Float> monolish::view_tensor_Dense< TYPE, Float >::get_val ( ) const
inline

Definition at line 277 of file monolish_view_tensor_dense.hpp.

◆ insert() [1/2]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::insert ( const size_t  i,
const Float  Val 
)
inline

set element A[index]...

Parameters
posaligned position index
Valscalar value
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 420 of file monolish_view_tensor_dense.hpp.

◆ insert() [2/2]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::insert ( const std::vector< size_t > &  pos,
const Float  Val 
)
inline

set element A[pos[0]][pos[1]]...

Parameters
posstd::vector position
Valscalar value
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 434 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ operator=() [1/4]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::operator= ( const tensor::tensor_Dense< Float > &  tens)

tensor copy

Parameters
tensDense tensor
Returns
copied dense tensor
Note
  • # of computation: size
  • Multi-threading: true
  • GPU acceleration: true
    • # of data transfer: 0
      • if gpu_statius == true; coping data on CPU
      • else; coping data on CPU

◆ operator=() [2/4]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::operator= ( const view_tensor_Dense< matrix::Dense< Float >, Float > &  tens)

tensor copy

Parameters
tensDense tensor
Returns
copied dense tensor
Note
  • # of computation: size
  • Multi-threading: true
  • GPU acceleration: true
    • # of data transfer: 0
      • if gpu_statius == true; coping data on CPU
      • else; coping data on CPU

◆ operator=() [3/4]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::operator= ( const view_tensor_Dense< tensor::tensor_Dense< Float >, Float > &  tens)

tensor copy

Parameters
tensDense tensor
Returns
copied dense tensor
Note
  • # of computation: size
  • Multi-threading: true
  • GPU acceleration: true
    • # of data transfer: 0
      • if gpu_statius == true; coping data on CPU
      • else; coping data on CPU

◆ operator=() [4/4]

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::operator= ( const view_tensor_Dense< vector< Float >, Float > &  tens)

tensor copy

Parameters
tensDense tensor
Returns
copied dense tensor
Note
  • # of computation: size
  • Multi-threading: true
  • GPU acceleration: true
    • # of data transfer: 0
      • if gpu_statius == true; coping data on CPU
      • else; coping data on CPU

◆ operator[]()

template<typename TYPE , typename Float >
Float& monolish::view_tensor_Dense< TYPE, Float >::operator[] ( const size_t  i)
inline

reference to the element at position

Parameters
iPosition of an element in the vector
Returns
vector element (v[i])
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 627 of file monolish_view_tensor_dense.hpp.

◆ print_all()

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::print_all ( bool  force_cpu = false) const

print all elements to standart I/O

Parameters
force_cpuIgnore device status and output CPU data
Note
  • # of computation: end-start
  • Multi-threading: false
  • GPU acceleration: true (doesn't work in parallel)

◆ recv()

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::recv ( )
inline

recv data from GPU, and free data on GPU

Note
  • # of data transfer: N
  • Multi-threading: false
  • GPU acceleration: true

Definition at line 212 of file monolish_view_tensor_dense.hpp.

◆ resize()

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::resize ( std::vector< size_t > &  shape_)
inline

change last postion

Parameters
Nvector length
Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: true
Warning
Cannot be resized beyond the range of the referenced vector

Definition at line 544 of file monolish_view_tensor_dense.hpp.

Here is the call graph for this function:

◆ send()

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::send ( ) const
inline

send data to GPU

Note
  • # of data transfer: N
  • Multi-threading: false
  • GPU acceleration: true

Definition at line 203 of file monolish_view_tensor_dense.hpp.

◆ set_first()

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::set_first ( size_t  i)
inline

change first position

Note
  • # of computation: 1

Definition at line 286 of file monolish_view_tensor_dense.hpp.

◆ set_last()

template<typename TYPE , typename Float >
void monolish::view_tensor_Dense< TYPE, Float >::set_last ( size_t  i)
inline

change last position

Note
  • # of computation: 1

Definition at line 293 of file monolish_view_tensor_dense.hpp.

◆ size()

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::size ( ) const
inline

get view_tensor_Dense size (range)

Returns
view_tensor_Dense size
Note
  • # of computation: 1

Definition at line 243 of file monolish_view_tensor_dense.hpp.

◆ type()

template<typename TYPE , typename Float >
std::string monolish::view_tensor_Dense< TYPE, Float >::type ( ) const
inline

get format name "view_tensor_Dense"

Note
  • # of computation: 1
  • Multi-threading: false
  • GPU acceleration: false

Definition at line 190 of file monolish_view_tensor_dense.hpp.

Member Data Documentation

◆ first

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::first
private

Definition at line 54 of file monolish_view_tensor_dense.hpp.

◆ last

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::last
private

Definition at line 55 of file monolish_view_tensor_dense.hpp.

◆ range

template<typename TYPE , typename Float >
size_t monolish::view_tensor_Dense< TYPE, Float >::range
private

Definition at line 56 of file monolish_view_tensor_dense.hpp.

◆ shape

template<typename TYPE , typename Float >
std::vector<size_t> monolish::view_tensor_Dense< TYPE, Float >::shape
private

Definition at line 58 of file monolish_view_tensor_dense.hpp.

◆ target

template<typename TYPE , typename Float >
TYPE& monolish::view_tensor_Dense< TYPE, Float >::target
private

Definition at line 52 of file monolish_view_tensor_dense.hpp.

◆ target_data

template<typename TYPE , typename Float >
Float* monolish::view_tensor_Dense< TYPE, Float >::target_data
private

Definition at line 53 of file monolish_view_tensor_dense.hpp.


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