 |
fml
0.1-0
Fused Matrix Library
|
5 #ifndef FML_GPU_LINALG_CROSSPROD_H
6 #define FML_GPU_LINALG_CROSSPROD_H
12 #include "../../_internals/linalgutils.hh"
14 #include "../arch/arch.hh"
16 #include "../gpumat.hh"
18 #include "internals/err.hh"
43 template <
typename REAL>
46 err::check_card(x, ret);
48 const len_t m = x.
nrows();
49 const len_t n = x.
ncols();
54 matmult(
true,
false, alpha, x, x, ret);
58 template <
typename REAL>
61 const len_t n = x.
ncols();
88 template <
typename REAL>
91 err::check_card(x, ret);
93 const len_t m = x.
nrows();
94 const len_t n = x.
ncols();
99 matmult(
false,
true, alpha, x, x, ret);
103 template <
typename REAL>
106 const len_t m = x.
nrows();
void crossprod(const REAL alpha, const cpumat< REAL > &x, cpumat< REAL > &ret)
Computes lower triangle of alpha*x^T*x.
Definition: crossprod.hh:37
len_t nrows() const
Number of rows.
Definition: unimat.hh:36
len_t ncols() const
Number of columns.
Definition: unimat.hh:38
Core namespace.
Definition: dimops.hh:10
void resize(len_t nrows, len_t ncols)
Resize the internal object storage.
Definition: gpumat.hh:256
Matrix class for data held on a single GPU.
Definition: gpumat.hh:35
void tcrossprod(const REAL alpha, const cpumat< REAL > &x, cpumat< REAL > &ret)
Computes lower triangle of alpha*x*x^T.
Definition: crossprod.hh:81
void matmult(const bool transx, const bool transy, const REAL alpha, const cpumat< REAL > &x, const cpumat< REAL > &y, cpumat< REAL > &ret)
Computes ret = alpha*op(x)*op(y) where op(A) is A or A^T.
Definition: matmult.hh:43