![]() |
fml
0.1-0
Fused Matrix Library
|
Copiers. More...
Functions | |
template<typename REAL_IN , typename REAL_OUT > | |
void | cpu2cpu (const cpuvec< REAL_IN > &cpu_in, cpuvec< REAL_OUT > &cpu_out) |
Copy data from a CPU object to another. More... | |
template<typename REAL > | |
cpuvec< REAL > | cpu2cpu (const cpuvec< REAL > &cpu_in) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | cpu2cpu (const cpumat< REAL_IN > &cpu_in, cpumat< REAL_OUT > &cpu_out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL > | |
cpumat< REAL > | cpu2cpu (const cpumat< REAL > &cpu_in) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | gpu2cpu (const gpuvec< REAL_IN > &gpu, cpuvec< REAL_OUT > &cpu) |
Copy data from a GPU object to a CPU object. More... | |
template<typename REAL > | |
gpuvec< REAL > | gpu2cpu (const gpuvec< REAL > &gpu) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | gpu2cpu (const gpumat< REAL_IN > &gpu, cpumat< REAL_OUT > &cpu) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL > | |
cpumat< REAL > | gpu2cpu (const gpumat< REAL > &gpu) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | cpu2gpu (const cpuvec< REAL_IN > &cpu, gpuvec< REAL_OUT > &gpu) |
Copy data from a CPU object to a GPU object. More... | |
template<typename REAL_IN , typename REAL_OUT > | |
void | cpu2gpu (const cpumat< REAL_IN > &cpu, gpumat< REAL_OUT > &gpu) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | gpu2gpu (const gpuvec< REAL_IN > &gpu_in, gpuvec< REAL_OUT > &gpu_out) |
Copy data from a GPU object to another. More... | |
template<typename REAL > | |
gpuvec< REAL > | gpu2gpu (const gpuvec< REAL > &gpu_in) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | gpu2gpu (const gpumat< REAL_IN > &gpu_in, gpumat< REAL_OUT > &gpu_out) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL > | |
gpumat< REAL > | gpu2gpu (const gpumat< REAL > &gpu_in) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | mpi2cpu_all (const mpimat< REAL_IN > &mpi, cpumat< REAL_OUT > &cpu) |
Copy data from an MPI object to a CPU object. More... | |
template<typename REAL > | |
cpumat< REAL > | mpi2cpu_all (const mpimat< REAL > &mpi) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | mpi2cpu (const mpimat< REAL_IN > &mpi, cpumat< REAL_OUT > &cpu, int rdest=0, int cdest=0) |
Copy data from an MPI object to a CPU object. More... | |
template<typename REAL > | |
cpumat< REAL > | mpi2cpu (const mpimat< REAL > &mpi) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename REAL_IN , typename REAL_OUT > | |
void | cpu2mpi (const cpumat< REAL_IN > &cpu, mpimat< REAL_OUT > &mpi) |
Copy data from a CPU object to an MPI object. More... | |
template<typename REAL_IN , typename REAL_OUT > | |
void | mpi2mpi (const mpimat< REAL_IN > &mpi_in, mpimat< REAL_OUT > &mpi_out) |
Copy data from an MPI object to another. More... | |
template<typename REAL_IN , typename REAL_OUT > | |
void | par2cpu (const parmat_cpu< REAL_IN > &par, cpumat< REAL_OUT > &cpu) |
Copy data from an PAR object to a CPU object. More... | |
template<typename REAL_IN , typename REAL_OUT > | |
void | cpu2par (const cpumat< REAL_IN > &cpu, parmat_cpu< REAL_OUT > &par) |
Copy data from an CPU object to a PAR object. More... | |
template<typename REAL_IN , typename REAL_OUT > | |
void | par2par (const parmat_cpu< REAL_IN > &par_in, parmat_cpu< REAL_OUT > &par_out) |
Copy data from a PAR object to another. More... | |
template<typename REAL_IN , typename REAL_OUT > | |
void | par2par (const parmat_gpu< REAL_IN > &par_in, parmat_gpu< REAL_OUT > &par_out) |
Copy data from a PAR object to another. More... | |
Copiers.
MPI class helpers.
void fml::copy::cpu2cpu | ( | const cpuvec< REAL_IN > & | cpu_in, |
cpuvec< REAL_OUT > & | cpu_out | ||
) |
Copy data from a CPU object to another.
[in] | cpu_in | Input data. |
[out] | cpu_out | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::cpu2gpu | ( | const cpuvec< REAL_IN > & | cpu, |
gpuvec< REAL_OUT > & | gpu | ||
) |
Copy data from a CPU object to a GPU object.
[in] | cpu | Input data. |
[out] | gpu | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. Additionally, REAL_OUT can be __half . |
void fml::copy::cpu2mpi | ( | const cpumat< REAL_IN > & | cpu, |
mpimat< REAL_OUT > & | mpi | ||
) |
Copy data from a CPU object to an MPI object.
The CPU matrix should be replicated across all processes in the grid. This is just for testing purposes and should not be used in production.
[in] | cpu | Input data. |
[out] | mpi | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
Communication Details
The method has no communication.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::cpu2par | ( | const cpumat< REAL_IN > & | cpu, |
parmat_cpu< REAL_OUT > & | par | ||
) |
Copy data from an CPU object to a PAR object.
Every process should have a copy of the data on input.
[in] | par | Input data. |
[out] | cpu | Output. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::gpu2cpu | ( | const gpuvec< REAL_IN > & | gpu, |
cpuvec< REAL_OUT > & | cpu | ||
) |
Copy data from a GPU object to a CPU object.
[in] | gpu | Input data. |
[out] | cpu | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. Additionally, REAL_IN can be __half . |
void fml::copy::gpu2gpu | ( | const gpuvec< REAL_IN > & | gpu_in, |
gpuvec< REAL_OUT > & | gpu_out | ||
) |
Copy data from a GPU object to another.
The GPU objects should be on the same card.
[in] | gpu_in | Input data. |
[out] | gpu_out | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown. If the objects are on different cards, a logic_error
exception will be thrown.
REAL_IN,REAL_OUT | should be __half , float , or double . They do not have to be the same type. |
void fml::copy::mpi2cpu | ( | const mpimat< REAL_IN > & | mpi, |
cpumat< REAL_OUT > & | cpu, | ||
int | rdest = 0 , |
||
int | cdest = 0 |
||
) |
Copy data from an MPI object to a CPU object.
The process at grid positiong (rdest, cdest) will receive the full matrix.
[in] | mpi | Input data. |
[out] | cpu | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
[in] | rdest,cdest | Row/column position in the communicator grid of the receiving process. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated. Each process also needs temporary storage of the size mpi.bf_rows()
.
Exceptions
If an allocation or reallocation is triggered and fails, a bad_alloc
exception will be thrown.
Communication Details
The method will communicate across all processes in the BLACS grid.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::mpi2cpu_all | ( | const mpimat< REAL_IN > & | mpi, |
cpumat< REAL_OUT > & | cpu | ||
) |
Copy data from an MPI object to a CPU object.
Every process in the grid receives a copy of the data.
[in] | mpi | Input data. |
[out] | cpu | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
Communication Details
The method will communicate across all processes in the BLACS grid.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::mpi2mpi | ( | const mpimat< REAL_IN > & | mpi_in, |
mpimat< REAL_OUT > & | mpi_out | ||
) |
Copy data from an MPI object to another.
[in] | mpi_in | Input data. |
[out] | mpi_out | Output. Dimensions should match those of the input data. If not, the matrix will automatically be resized. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::par2cpu | ( | const parmat_cpu< REAL_IN > & | par, |
cpumat< REAL_OUT > & | cpu | ||
) |
Copy data from an PAR object to a CPU object.
Every process receives a copy of the data. The number of rows of the input should fit in the storage of a len_t
.
[in] | par | Input data. |
[out] | cpu | Output. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
Communication Details
The method will communicate across all processes in the communicator.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::par2par | ( | const parmat_cpu< REAL_IN > & | par_in, |
parmat_cpu< REAL_OUT > & | par_out | ||
) |
Copy data from a PAR object to another.
[in] | par_in | Input data. |
[out] | par_out | Output. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |
void fml::copy::par2par | ( | const parmat_gpu< REAL_IN > & | par_in, |
parmat_gpu< REAL_OUT > & | par_out | ||
) |
Copy data from a PAR object to another.
[in] | par_in | Input data. |
[out] | par_out | Output. |
Memory Allocations
If the output dimensions do not match those of the input, the internal data will automatically be re-allocated.
Exceptions
If a reallocation is triggered and fails, a bad_alloc
exception will be thrown.
REAL_IN,REAL_OUT | Should be float or double . They do not have to be the same type. |