monolish
0.17.3-dev.16
MONOlithic LInear equation Solvers for Highly-parallel architecture
|
Dense view class. More...
#include <monolish_view_tensor_dense.hpp>
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 |
Dense view class.
Definition at line 50 of file monolish_view_tensor_dense.hpp.
|
inline |
create view_tensor_Dense from vector(start:start+range)
x | vector |
start | start position |
shape_ | shape of tensor |
Definition at line 71 of file monolish_view_tensor_dense.hpp.
|
inline |
create view_tensor_Dense from Dense matrix(start:start+range)
A | Dense matrix |
start | start position |
shape_ | shape of tensor |
Definition at line 91 of file monolish_view_tensor_dense.hpp.
|
inline |
create view_tensor_Dense from Dense tensor(start:start+range)
A | Dense matrix |
start | start position |
shape_ | shape of tensor |
Definition at line 111 of file monolish_view_tensor_dense.hpp.
|
inline |
create view_tensor_Dense from monolish::vector(start:start+range)
x | view_tensor_Dense create from monolish::vector |
start | start position (x.first + start) |
shape_ | shape of tensor |
Definition at line 131 of file monolish_view_tensor_dense.hpp.
|
inline |
create view_tensor_Dense from monolish::matrix::Dense(start:start+range)
x | view_tensor_Dense create from monolish::matrix::Dense |
start | start position (x.first + start) |
shape_ | shape of tensor |
Definition at line 152 of file monolish_view_tensor_dense.hpp.
|
inline |
create view_tensor_Dense from monolish::tensor::tensor_Dense(start:start+range)
x | view_tensor_Dense create from monolish::tensor::tensor_Dense |
start | start position (x.first + start) |
shape_ | shape of tensor |
Definition at line 173 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[pos[0]][pos[1]]... (onlu CPU)
pos | std::vector position |
Definition at line 407 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[pos[0]][pos[1]]...
pos | std::vector position |
Definition at line 351 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[index] (only CPU)
pos | aligned position index |
Definition at line 366 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[index]
pos | aligned position index |
Definition at line 307 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[pos[0]][pos[1]]...
pos | std::vector position |
Definition at line 379 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[pos[0]][pos[1]]...
pos | std::vector position |
Definition at line 320 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[pos[0]][pos[1]]... (onlu CPU)
pos | std::vector position |
Definition at line 393 of file monolish_view_tensor_dense.hpp.
|
inline |
get element A[pos[0]][pos[1]]...
pos | std::vector position |
Definition at line 334 of file monolish_view_tensor_dense.hpp.
|
inline |
returns begin iterator (include offset)
Definition at line 506 of file monolish_view_tensor_dense.hpp.
|
inline |
returns begin iterator (include offset)
Definition at line 498 of file monolish_view_tensor_dense.hpp.
|
inline |
calculate view_tensor_Dense size from shape
Definition at line 220 of file monolish_view_tensor_dense.hpp.
|
inline |
returns a direct pointer to the vector (dont include offset)
Definition at line 474 of file monolish_view_tensor_dense.hpp.
|
inline |
returns a direct pointer to the original vector (dont include offset)
Definition at line 466 of file monolish_view_tensor_dense.hpp.
void monolish::view_tensor_Dense< TYPE, Float >::diag_add | ( | const Float | alpha | ) |
Scalar and diag. vector of Dense format matrix add.
alpha | scalar |
void monolish::view_tensor_Dense< TYPE, Float >::diag_add | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of Dense format matrix add.
vec | vector |
void monolish::view_tensor_Dense< TYPE, Float >::diag_add | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_add | ( | const view1D< tensor::tensor_Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_add | ( | const view1D< vector< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_div | ( | const Float | alpha | ) |
Scalar and diag. vector of Dense format matrix div.
alpha | scalar |
void monolish::view_tensor_Dense< TYPE, Float >::diag_div | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of Dense format matrix div.
vec | vector |
void monolish::view_tensor_Dense< TYPE, Float >::diag_div | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_div | ( | const view1D< tensor::tensor_Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_div | ( | const view1D< vector< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul | ( | const Float | alpha | ) |
Scalar and diag. vector of Dense format matrix mul.
alpha | scalar |
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of Dense format matrix mul.
vec | vector |
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul | ( | const view1D< tensor::tensor_Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_mul | ( | const view1D< vector< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub | ( | const Float | alpha | ) |
Scalar and diag. vector of Dense format matrix sub.
alpha | scalar |
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub | ( | const vector< Float > & | vec | ) |
Vector and diag. vector of Dense format matrix sub.
vec | vector |
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub | ( | const view1D< tensor::tensor_Dense< Float >, Float > & | vec | ) |
void monolish::view_tensor_Dense< TYPE, Float >::diag_sub | ( | const view1D< vector< Float >, Float > & | vec | ) |
|
inline |
returns a end iterator
Definition at line 522 of file monolish_view_tensor_dense.hpp.
|
inline |
returns a end iterator
Definition at line 514 of file monolish_view_tensor_dense.hpp.
void monolish::view_tensor_Dense< TYPE, Float >::fill | ( | Float | value | ) |
fill vector elements with a scalar value
value | scalar value |
|
inline |
Definition at line 279 of file monolish_view_tensor_dense.hpp.
|
inline |
true: sended, false: not send
Definition at line 447 of file monolish_view_tensor_dense.hpp.
|
inline |
get first position
Definition at line 259 of file monolish_view_tensor_dense.hpp.
|
inline |
gpu status shared pointer
Definition at line 455 of file monolish_view_tensor_dense.hpp.
|
inline |
get vector index from aligned index (A[pos[0]][pos[1]]... = A[ind])
pos | position (scalar) |
Definition at line 664 of file monolish_view_tensor_dense.hpp.
|
inline |
get aligned index from vector index (A[pos] = A[ind[0]][ind[1]]...)
pos | position (std::vector) |
Definition at line 643 of file monolish_view_tensor_dense.hpp.
|
inline |
get end position
Definition at line 267 of file monolish_view_tensor_dense.hpp.
|
inline |
get view_tensor_Dense size (same as size())
Definition at line 251 of file monolish_view_tensor_dense.hpp.
|
inline |
get first position (same as get_first())
Definition at line 275 of file monolish_view_tensor_dense.hpp.
|
inline |
get shape
Definition at line 235 of file monolish_view_tensor_dense.hpp.
|
inline |
returns a reference of the target
Definition at line 490 of file monolish_view_tensor_dense.hpp.
|
inline |
returns a reference of the target
Definition at line 482 of file monolish_view_tensor_dense.hpp.
|
inline |
Definition at line 277 of file monolish_view_tensor_dense.hpp.
|
inline |
set element A[index]...
pos | aligned position index |
Val | scalar value |
Definition at line 420 of file monolish_view_tensor_dense.hpp.
|
inline |
set element A[pos[0]][pos[1]]...
pos | std::vector position |
Val | scalar value |
Definition at line 434 of file monolish_view_tensor_dense.hpp.
void monolish::view_tensor_Dense< TYPE, Float >::operator= | ( | const tensor::tensor_Dense< Float > & | tens | ) |
tensor copy
tens | Dense tensor |
gpu_statius == true
; coping data on CPUvoid monolish::view_tensor_Dense< TYPE, Float >::operator= | ( | const view_tensor_Dense< matrix::Dense< Float >, Float > & | tens | ) |
tensor copy
tens | Dense tensor |
gpu_statius == true
; coping data on CPUvoid monolish::view_tensor_Dense< TYPE, Float >::operator= | ( | const view_tensor_Dense< tensor::tensor_Dense< Float >, Float > & | tens | ) |
tensor copy
tens | Dense tensor |
gpu_statius == true
; coping data on CPUvoid monolish::view_tensor_Dense< TYPE, Float >::operator= | ( | const view_tensor_Dense< vector< Float >, Float > & | tens | ) |
tensor copy
tens | Dense tensor |
gpu_statius == true
; coping data on CPU
|
inline |
reference to the element at position
i | Position of an element in the vector |
Definition at line 627 of file monolish_view_tensor_dense.hpp.
void monolish::view_tensor_Dense< TYPE, Float >::print_all | ( | bool | force_cpu = false | ) | const |
print all elements to standart I/O
force_cpu | Ignore device status and output CPU data |
|
inline |
recv data from GPU, and free data on GPU
Definition at line 212 of file monolish_view_tensor_dense.hpp.
|
inline |
change last postion
N | vector length |
Definition at line 544 of file monolish_view_tensor_dense.hpp.
|
inline |
send data to GPU
Definition at line 203 of file monolish_view_tensor_dense.hpp.
|
inline |
change first position
Definition at line 286 of file monolish_view_tensor_dense.hpp.
|
inline |
change last position
Definition at line 293 of file monolish_view_tensor_dense.hpp.
|
inline |
get view_tensor_Dense size (range)
Definition at line 243 of file monolish_view_tensor_dense.hpp.
|
inline |
get format name "view_tensor_Dense"
Definition at line 190 of file monolish_view_tensor_dense.hpp.
|
private |
Definition at line 54 of file monolish_view_tensor_dense.hpp.
|
private |
Definition at line 55 of file monolish_view_tensor_dense.hpp.
|
private |
Definition at line 56 of file monolish_view_tensor_dense.hpp.
|
private |
Definition at line 58 of file monolish_view_tensor_dense.hpp.
|
private |
Definition at line 52 of file monolish_view_tensor_dense.hpp.
|
private |
Definition at line 53 of file monolish_view_tensor_dense.hpp.