monolish
0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
|
vector class More...
#include <monolish_coo.hpp>
Public Member Functions | |
Float * | begin () |
returns a begin iterator More... | |
const Float * | begin () const |
returns a begin iterator More... | |
Float * | data () |
returns a direct pointer to the vector More... | |
const Float * | data () const |
returns a direct pointer to the vector 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 vector< Float > &vec, bool compare_cpu_and_device=false) const |
Comparing matricies (A == mat) More... | |
bool | equal (const view1D< matrix::Dense< Float >, Float > &vec, bool compare_cpu_and_device=false) const |
Comparing matricies (A == mat) More... | |
bool | equal (const view1D< vector< Float >, Float > &vec, bool compare_cpu_and_device=false) const |
Comparing matricies (A == mat) More... | |
void | fill (Float value) |
fill vector elements with a scalar value More... | |
bool | get_device_mem_stat () const |
true: sended, false: not send More... | |
auto | get_nnz () const |
get vector size More... | |
size_t | get_offset () const |
void | nonfree_recv () |
recv data from GPU (w/o free) More... | |
bool | operator!= (const vector< Float > &vec) const |
Comparing vectors (v != vec) More... | |
bool | operator!= (const view1D< matrix::Dense< Float >, Float > &vec) const |
Comparing vectors (v != vec) More... | |
bool | operator!= (const view1D< vector< Float >, Float > &vec) const |
Comparing vectors (v != vec) More... | |
vector< Float > | operator- () |
Sign inversion. More... | |
void | operator= (const std::vector< Float > &vec) |
copy vector from std::vector More... | |
void | operator= (const vector< Float > &vec) |
copy vector, It is same as copy ( Copy the memory on CPU and GPU ) More... | |
void | operator= (const view1D< matrix::Dense< Float >, Float > &vec) |
copy vector, It is same as copy ( Copy the memory on CPU and GPU ) More... | |
void | operator= (const view1D< vector< Float >, Float > &vec) |
copy vector, It is same as copy ( Copy the memory on CPU and GPU ) More... | |
bool | operator== (const vector< Float > &vec) const |
Comparing vectors (v == vec) More... | |
bool | operator== (const view1D< matrix::Dense< Float >, Float > &vec) const |
Comparing vectors (v == vec) More... | |
bool | operator== (const view1D< vector< Float >, Float > &vec) const |
Comparing vectors (v == vec) More... | |
Float & | operator[] (size_t i) |
refetrence to the element at position (v[i]) More... | |
void | print_all (bool force_cpu=false) const |
print all elements to standart I/O More... | |
void | print_all (std::string filename) const |
print all elements to file More... | |
void | push_back (Float val) |
Add a new element at the end of the vector (only CPU) More... | |
void | recv () |
recv data from GPU, and free data on GPU More... | |
void | resize (size_t N) |
resize vector (only CPU) More... | |
void | send () const |
send data to GPU More... | |
auto | size () const |
get vector size More... | |
vector () | |
vector (const Float *start, const Float *end) | |
copy from pointer More... | |
vector (const size_t N) | |
allocate size N vector More... | |
vector (const size_t N, const Float min, const Float max) | |
create N length rand(min~max) vector More... | |
vector (const size_t N, const Float value) | |
initialize size N vector, value to fill the container More... | |
vector (const std::initializer_list< Float > &list) | |
copy from initializer_list More... | |
vector (const std::vector< Float > &vec) | |
copy from std::vector More... | |
vector (const vector< Float > &vec) | |
copy from monolish::vector More... | |
vector (const view1D< matrix::Dense< Float >, Float > &vec) | |
copy from monolish::view1D from monolish::matrix::Dense More... | |
vector (const view1D< vector< Float >, Float > &vec) | |
copy from monolish::view1D from vector More... | |
~vector () | |
destructor of vector, free GPU memory More... | |
Private Attributes | |
bool | gpu_status = false |
true: sended, false: not send More... | |
std::vector< Float > | val |
size N vector data More... | |
vector class
Definition at line 25 of file monolish_coo.hpp.
|
inline |
Definition at line 49 of file monolish_vector.hpp.
template monolish::vector< Float >::vector | ( | const size_t | N | ) |
allocate size N vector
N | vector length |
Definition at line 8 of file vector_constructor.cpp.
monolish::vector< Float >::vector | ( | const size_t | N, |
const Float | value | ||
) |
initialize size N vector, value to fill the container
N | vector length |
value | fill Float type value to all elements |
monolish::vector< Float >::vector | ( | const std::vector< Float > & | vec | ) |
copy from std::vector
vec | input std::vector |
monolish::vector< Float >::vector | ( | const std::initializer_list< Float > & | list | ) |
copy from initializer_list
list | input initializer_list |
monolish::vector< Float >::vector | ( | const vector< Float > & | vec | ) |
copy from monolish::vector
vec | input monolish::vector |
gpu_status == true
; coping data on CPU and GPU respectivelymonolish::vector< Float >::vector | ( | const view1D< vector< Float >, Float > & | vec | ) |
copy from monolish::view1D from vector
vec | input monolish::view1D from vector |
gpu_status == true
; coping data on CPU and GPU respectivelymonolish::vector< Float >::vector | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
copy from monolish::view1D from monolish::matrix::Dense
vec | input monolish::view1D from monolish::matrix::Dense |
gpu_status == true
; coping data on CPU and GPU respectivelymonolish::vector< Float >::vector | ( | const Float * | start, |
const Float * | end | ||
) |
copy from pointer
start | start pointer |
end | end pointer |
monolish::vector< Float >::vector | ( | const size_t | N, |
const Float | min, | ||
const Float | max | ||
) |
create N length rand(min~max) vector
N | vector length |
min | rand min |
max | rand max |
|
inline |
destructor of vector, free GPU memory
Definition at line 213 of file monolish_vector.hpp.
|
inline |
returns a begin iterator
Definition at line 282 of file monolish_vector.hpp.
|
inline |
returns a begin iterator
Definition at line 274 of file monolish_vector.hpp.
|
inline |
returns a direct pointer to the vector
Definition at line 238 of file monolish_vector.hpp.
|
inline |
returns a direct pointer to the vector
Definition at line 230 of file monolish_vector.hpp.
template void monolish::vector< Float >::device_free | ( | ) | const |
free data on GPU
Definition at line 60 of file gpu_comm.cpp.
|
inline |
returns a end iterator
Definition at line 298 of file monolish_vector.hpp.
|
inline |
returns a end iterator
Definition at line 290 of file monolish_vector.hpp.
bool monolish::vector< Float >::equal | ( | const vector< Float > & | vec, |
bool | compare_cpu_and_device = false |
||
) | const |
Comparing matricies (A == mat)
vec | vector |
compare_cpu_and_device | compare data on both CPU and GPU |
bool monolish::vector< Float >::equal | ( | const view1D< matrix::Dense< Float >, Float > & | vec, |
bool | compare_cpu_and_device = false |
||
) | const |
Comparing matricies (A == mat)
vec | vieq1D from monolish::matrix::Dense |
compare_cpu_and_device | compare data on both CPU and GPU |
bool monolish::vector< Float >::equal | ( | const view1D< vector< Float >, Float > & | vec, |
bool | compare_cpu_and_device = false |
||
) | const |
Comparing matricies (A == mat)
vec | view1D from monolish::vector |
compare_cpu_and_device | compare data on both CPU and GPU |
template void monolish::vector< Float >::fill | ( | Float | value | ) |
fill vector elements with a scalar value
value | scalar value |
Definition at line 9 of file fill_vector.cpp.
|
inline |
true: sended, false: not send
Definition at line 204 of file monolish_vector.hpp.
|
inline |
get vector size
Definition at line 314 of file monolish_vector.hpp.
|
inline |
Definition at line 219 of file monolish_vector.hpp.
template void monolish::vector< Float >::nonfree_recv | ( | ) |
recv data from GPU (w/o free)
Definition at line 45 of file gpu_comm.cpp.
bool monolish::vector< Float >::operator!= | ( | const vector< Float > & | vec | ) | const |
Comparing vectors (v != vec)
vec | vector (size N) |
gpu_status == true
; compare data on GPUbool monolish::vector< Float >::operator!= | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) | const |
Comparing vectors (v != vec)
vec | vector (size N) |
gpu_status == true
; compare data on GPUbool monolish::vector< Float >::operator!= | ( | const view1D< vector< Float >, Float > & | vec | ) | const |
Comparing vectors (v != vec)
vec | vector (size N) |
gpu_status == true
; compare data on GPUtemplate vector< float > monolish::vector< Float >::operator- | ( | ) |
Sign inversion.
Definition at line 8 of file vector_minus.cpp.
void monolish::vector< Float >::operator= | ( | const std::vector< Float > & | vec | ) |
copy vector from std::vector
vec | source std::vector |
void monolish::vector< Float >::operator= | ( | const vector< Float > & | vec | ) |
copy vector, It is same as copy ( Copy the memory on CPU and GPU )
vec | source vector |
gpu_statius == true
; coping data on GPUvoid monolish::vector< Float >::operator= | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) |
copy vector, It is same as copy ( Copy the memory on CPU and GPU )
vec | source view1D from monolish::matrix::Dense |
gpu_statius == true
; coping data on GPUvoid monolish::vector< Float >::operator= | ( | const view1D< vector< Float >, Float > & | vec | ) |
copy vector, It is same as copy ( Copy the memory on CPU and GPU )
vec | source view1D from monolish::vector |
gpu_statius == true
; coping data on GPUbool monolish::vector< Float >::operator== | ( | const vector< Float > & | vec | ) | const |
Comparing vectors (v == vec)
vec | vector (size N) |
gpu_status == true
; compare data on GPUbool monolish::vector< Float >::operator== | ( | const view1D< matrix::Dense< Float >, Float > & | vec | ) | const |
Comparing vectors (v == vec)
vec | view1D from monolish::matrix::Dense (size N) |
gpu_status == true
; compare data on GPUbool monolish::vector< Float >::operator== | ( | const view1D< vector< Float >, Float > & | vec | ) | const |
Comparing vectors (v == vec)
vec | view1D from monolish::vector (size N) |
gpu_status == true
; compare data on GPU
|
inline |
refetrence to the element at position (v[i])
i | Position of an element in the vector |
Definition at line 421 of file monolish_vector.hpp.
template void monolish::vector< Float >::print_all | ( | bool | force_cpu = false | ) | const |
print all elements to standart I/O
force_cpu | Ignore device status and output CPU data |
Definition at line 17 of file IO_vector.cpp.
template void monolish::vector< Float >::print_all | ( | std::string | filename | ) | const |
print all elements to file
filename | output filename |
Definition at line 45 of file IO_vector.cpp.
|
inline |
Add a new element at the end of the vector (only CPU)
val | new element |
Definition at line 261 of file monolish_vector.hpp.
template void monolish::vector< Float >::recv | ( | ) |
recv data from GPU, and free data on GPU
Definition at line 27 of file gpu_comm.cpp.
|
inline |
resize vector (only CPU)
N | vector length |
Definition at line 248 of file monolish_vector.hpp.
template void monolish::vector< Float >::send | ( | ) | const |
send data to GPU
Definition at line 8 of file gpu_comm.cpp.
|
inline |
get vector size
Definition at line 306 of file monolish_vector.hpp.
|
mutableprivate |
true: sended, false: not send
Definition at line 46 of file monolish_vector.hpp.
|
private |
size N vector data
Definition at line 41 of file monolish_vector.hpp.