monolish
0.17.3-dev.23
MONOlithic LInear equation Solvers for Highly-parallel architecture
|
#include <monolish_tensor_crs.hpp>
Public Member Functions | |
Float * | begin () |
returns a begin iterator More... | |
const Float * | begin () const |
returns a begin iterator More... | |
void | compute_hash () |
compute index array hash (to compare structure) More... | |
void | convert (const matrix::CRS< Float > &crs) |
void | convert (const tensor::tensor_COO< Float > &coo) |
void | convert (const tensor::tensor_CRS< Float > &crs) |
Float * | data () |
returns a direct pointer to the tensor More... | |
const Float * | data () const |
returns a direct pointer to the tensor More... | |
void | device_free () const |
free data on GPU More... | |
Float * | end () |
returns a end iterator More... | |
const Float * | end () const |
returns a end iterator More... | |
bool | equal (const tensor_CRS< Float > &mat, bool compare_cpu_and_device=false) const |
Comparing matrices (A == mat) More... | |
void | fill (Float value) |
fill tensor elements with a scalar value More... | |
size_t | get_alloc_nnz () const |
get # of alloced non-zeros More... | |
double | get_data_size () const |
Memory data space required by the matrix. More... | |
bool | 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... | |
size_t | get_hash () const |
get index array hash (to compare structure) More... | |
size_t | get_nnz () const |
get # of non-zeros More... | |
size_t | get_offset () const |
get first position (same as get_first()) More... | |
std::vector< size_t > | get_shape () const |
get shape More... | |
std::shared_ptr< Float > | get_val () |
get shared_ptr of val More... | |
const std::shared_ptr< Float > | get_val () const |
get shared_ptr of val More... | |
void | nonfree_recv () |
recv. data to GPU (w/o free) More... | |
bool | operator!= (const tensor_CRS< Float > &mat) const |
Comparing matrices (A != mat) More... | |
void | operator= (const tensor_CRS< Float > &mat) |
matrix copy More... | |
bool | operator== (const tensor_CRS< Float > &mat) const |
Comparing matrices (A == mat) More... | |
Float & | operator[] (size_t i) |
reference to the element at position (v[i]) More... | |
void | print_all (bool force_cpu=false) const |
void | recv () |
recv. data to GPU, and free data on GPU More... | |
void | resize (const size_t N, Float Val=0) |
resize tensor value More... | |
void | send () const |
send data to GPU More... | |
void | set_first (size_t i) |
change first position More... | |
void | set_ptr (const std::vector< size_t > &shape, const std::vector< std::vector< int >> &rowptrs, const std::vector< std::vector< int >> &colinds, const size_t vsize, const Float *value) |
void | set_ptr (const std::vector< size_t > &shape, const std::vector< std::vector< int >> &rowptrs, const std::vector< std::vector< int >> &colinds, const size_t vsize, const Float value) |
void | set_ptr (const std::vector< size_t > &shape, const std::vector< std::vector< int >> &rowptrs, const std::vector< std::vector< int >> &colinds, const std::vector< Float > &value) |
void | set_shape (const std::vector< size_t > &shape) |
Set shape. More... | |
tensor_CRS () | |
tensor_CRS (const matrix::CRS< Float > &crs) | |
tensor_CRS (const std::initializer_list< size_t > &shape_) | |
tensor_CRS (const std::vector< size_t > &shape_) | |
tensor_CRS (const std::vector< size_t > &shape_, const std::vector< std::vector< int >> &row_ptrs_, const std::vector< std::vector< int >> &col_inds_, const Float *value) | |
tensor_CRS (const tensor::tensor_COO< Float > &coo) | |
tensor_CRS (const tensor::tensor_CRS< Float > &crs) | |
tensor_CRS (const tensor_CRS< Float > &crs, Float value) | |
std::string | type () const |
get format name "tensor_CRS" More... | |
~tensor_CRS () | |
Public Attributes | |
size_t | alloc_nnz = 0 |
std::vector< std::vector< int > > | col_inds |
std::vector< std::vector< int > > | row_ptrs |
std::shared_ptr< Float > | val |
bool | val_create_flag = false |
size_t | val_nnz = 0 |
Private Attributes | |
size_t | first = 0 |
std::shared_ptr< bool > | gpu_status = std::make_shared<bool>(false) |
std::vector< size_t > | shape |
size_t | structure_hash |
Definition at line 12 of file monolish_tensor_crs.hpp.
|
inline |
Definition at line 35 of file monolish_tensor_crs.hpp.
|
inline |
Definition at line 39 of file monolish_tensor_crs.hpp.
|
inline |
Definition at line 44 of file monolish_tensor_crs.hpp.
|
inline |
|
inline |
|
inline |
monolish::tensor::tensor_CRS< Float >::tensor_CRS | ( | const std::vector< size_t > & | shape_, |
const std::vector< std::vector< int >> & | row_ptrs_, | ||
const std::vector< std::vector< int >> & | col_inds_, | ||
const Float * | value | ||
) |
monolish::tensor::tensor_CRS< Float >::tensor_CRS | ( | const tensor_CRS< Float > & | crs, |
Float | value | ||
) |
|
inline |
|
inline |
returns a begin iterator
Definition at line 335 of file monolish_tensor_crs.hpp.
|
inline |
returns a begin iterator
Definition at line 327 of file monolish_tensor_crs.hpp.
void monolish::tensor::tensor_CRS< Float >::compute_hash | ( | ) |
compute index array hash (to compare structure)
void monolish::tensor::tensor_CRS< Float >::convert | ( | const matrix::CRS< Float > & | crs | ) |
void monolish::tensor::tensor_CRS< Float >::convert | ( | const tensor::tensor_COO< Float > & | coo | ) |
void monolish::tensor::tensor_CRS< Float >::convert | ( | const tensor::tensor_CRS< Float > & | crs | ) |
|
inline |
returns a direct pointer to the tensor
Definition at line 257 of file monolish_tensor_crs.hpp.
|
inline |
returns a direct pointer to the tensor
Definition at line 249 of file monolish_tensor_crs.hpp.
void monolish::tensor::tensor_CRS< Float >::device_free | ( | ) | const |
free data on GPU
|
inline |
returns a end iterator
Definition at line 353 of file monolish_tensor_crs.hpp.
|
inline |
returns a end iterator
Definition at line 343 of file monolish_tensor_crs.hpp.
bool monolish::tensor::tensor_CRS< Float >::equal | ( | const tensor_CRS< Float > & | mat, |
bool | compare_cpu_and_device = false |
||
) | const |
Comparing matrices (A == mat)
mat | CRS matrix |
compare_cpu_and_device | compare data on both CPU and GPU |
void monolish::tensor::tensor_CRS< Float >::fill | ( | Float | value | ) |
fill tensor elements with a scalar value
value | scalar value |
|
inline |
get # of alloced non-zeros
Definition at line 187 of file monolish_tensor_crs.hpp.
|
inline |
Memory data space required by the matrix.
Definition at line 125 of file monolish_tensor_crs.hpp.
|
inline |
true: sended, false: not send
Definition at line 225 of file monolish_tensor_crs.hpp.
|
inline |
get first position
Definition at line 195 of file monolish_tensor_crs.hpp.
|
inline |
gpu status shared pointer
Definition at line 231 of file monolish_tensor_crs.hpp.
|
inline |
get index array hash (to compare structure)
Definition at line 319 of file monolish_tensor_crs.hpp.
|
inline |
get # of non-zeros
Definition at line 178 of file monolish_tensor_crs.hpp.
|
inline |
get first position (same as get_first())
Definition at line 203 of file monolish_tensor_crs.hpp.
|
inline |
get shape
Definition at line 151 of file monolish_tensor_crs.hpp.
|
inline |
get shared_ptr of val
Definition at line 160 of file monolish_tensor_crs.hpp.
|
inline |
get shared_ptr of val
Definition at line 169 of file monolish_tensor_crs.hpp.
void monolish::tensor::tensor_CRS< Float >::nonfree_recv | ( | ) |
recv. data to GPU (w/o free)
bool monolish::tensor::tensor_CRS< Float >::operator!= | ( | const tensor_CRS< Float > & | mat | ) | const |
Comparing matrices (A != mat)
mat | CRS matrix |
gpu_status == true
; compare data on GPUvoid monolish::tensor::tensor_CRS< Float >::operator= | ( | const tensor_CRS< Float > & | mat | ) |
matrix copy
gpu_status == true
; coping data on GPUbool monolish::tensor::tensor_CRS< Float >::operator== | ( | const tensor_CRS< Float > & | mat | ) | const |
Comparing matrices (A == mat)
mat | CRS matrix |
gpu_status == true
; compare data on GPU
|
inline |
reference to the element at position (v[i])
i | Position of an element in the vector |
Definition at line 386 of file monolish_tensor_crs.hpp.
void monolish::tensor::tensor_CRS< Float >::print_all | ( | bool | force_cpu = false | ) | const |
void monolish::tensor::tensor_CRS< Float >::recv | ( | ) |
recv. data to GPU, and free data on GPU
|
inline |
resize tensor value
N | tensor size |
Definition at line 267 of file monolish_tensor_crs.hpp.
void monolish::tensor::tensor_CRS< Float >::send | ( | ) | const |
send data to GPU
|
inline |
change first position
Definition at line 210 of file monolish_tensor_crs.hpp.
void monolish::tensor::tensor_CRS< Float >::set_ptr | ( | const std::vector< size_t > & | shape, |
const std::vector< std::vector< int >> & | rowptrs, | ||
const std::vector< std::vector< int >> & | colinds, | ||
const size_t | vsize, | ||
const Float * | value | ||
) |
void monolish::tensor::tensor_CRS< Float >::set_ptr | ( | const std::vector< size_t > & | shape, |
const std::vector< std::vector< int >> & | rowptrs, | ||
const std::vector< std::vector< int >> & | colinds, | ||
const size_t | vsize, | ||
const Float | value | ||
) |
void monolish::tensor::tensor_CRS< Float >::set_ptr | ( | const std::vector< size_t > & | shape, |
const std::vector< std::vector< int >> & | rowptrs, | ||
const std::vector< std::vector< int >> & | colinds, | ||
const std::vector< Float > & | value | ||
) |
|
inline |
Set shape.
shape | shape of tensor
|
Definition at line 219 of file monolish_tensor_crs.hpp.
|
inline |
get format name "tensor_CRS"
Definition at line 303 of file monolish_tensor_crs.hpp.
size_t monolish::tensor::tensor_CRS< Float >::alloc_nnz = 0 |
Definition at line 27 of file monolish_tensor_crs.hpp.
std::vector<std::vector<int> > monolish::tensor::tensor_CRS< Float >::col_inds |
Definition at line 33 of file monolish_tensor_crs.hpp.
|
private |
Definition at line 20 of file monolish_tensor_crs.hpp.
|
mutableprivate |
Definition at line 16 of file monolish_tensor_crs.hpp.
std::vector<std::vector<int> > monolish::tensor::tensor_CRS< Float >::row_ptrs |
Definition at line 31 of file monolish_tensor_crs.hpp.
|
private |
Definition at line 14 of file monolish_tensor_crs.hpp.
|
private |
Definition at line 18 of file monolish_tensor_crs.hpp.
std::shared_ptr<Float> monolish::tensor::tensor_CRS< Float >::val |
Definition at line 23 of file monolish_tensor_crs.hpp.
bool monolish::tensor::tensor_CRS< Float >::val_create_flag = false |
Definition at line 29 of file monolish_tensor_crs.hpp.
size_t monolish::tensor::tensor_CRS< Float >::val_nnz = 0 |
Definition at line 25 of file monolish_tensor_crs.hpp.