1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
#ifndef HPC_ULMBLAS_GER_H
#define HPC_ULMBLAS_GER_H 1

#include <utility>

namespace hpc { namespace ulmblas {

template <typename Index, typename Alpha, typename TX, typename TY, typename TA>
void
ger(Index m, Index n, const Alpha &alpha,
    const TX *x, Index incX,
    const TY *y, Index incY,
    TA *A, Index incRowA, Index incColA)
{
    for (Index j=0; j<n; ++j) {
        for (Index i=0; i<m; ++i) {
            A[i*incRowA+j*incColA] += alpha*x[i*incX]*y[j*incY];
        }
    }
}

} } // namespace ulmblas, hpc

#endif // HPC_ULMBLAS_GER_H