Lib/Kernels/Matrix.cpp
/**
 * CPU version of matrix multiplication, naive implementation
 *
 * Matrixes are assumed to be square.
 *
 * @param N  dimension of square matrices
 * @param c  Pointer to result array
 */
CPU version of matrix multiplication, naive implementation
Matrixes are assumed to be square.

@param N  dimension of square matrices
@param c  Pointer to result array
CPU version of matrix multiplication naive implementation Matrixes are assumed to be square . @param N dimension of square matrices @param c Pointer to result array
void matrix_mult_scalar(int N, float *dst, float *a, float *b) {
  for (int x = 0; x < N; x++) {
    for (int y = 0; y < N; y++) {
      float result = 0;
      for (int i = 0; i < N; i++) {
        result += a[i + y*N] * b [x + i*N];
      }
      dst[x + y*N] = result;
    }
  }
}
void matrix_mult_scalar ( int N , float * dst , float * a , float * b ) { for ( int x = 0 ; x < N ; x ++ ) { for ( int y = 0 ; y < N ; y ++ ) { float result = 0 ; for ( int i = 0 ; i < N ; i ++ ) { result += a [ i + y * N ] * b [ x + i * N ] ; } dst [ x + y * N ] = result ; } } }
CPU version of matrix multiplication, naive implementation
 Matrixes are assumed to be square.
CPU version of matrix multiplication naive implementation Matrixes are assumed to be square .