/perf/kseta

To get this branch, use:
bzr branch http://darksoft.org/webbzr/perf/kseta

« back to all changes in this revision

Viewing changes to sources/mm/mkl.c

  • Committer: Suren A. Chilingaryan
  • Date: 2013-09-30 06:47:09 UTC
  • Revision ID: csa@dside.dyndns.org-20130930064709-55cde0k5ci76t8z5
Simple matrix multiplication

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include "mkl_types.h"
 
3
#include "mkl_cblas.h"
 
4
 
 
5
int exercise_init(const char *name, size_t size) {
 
6
    return 0;
 
7
}
 
8
 
 
9
int exercise_allocate(float **res, float **a, float **b, size_t size) {
 
10
    return  0;
 
11
}
 
12
 
 
13
void exercise_free() {
 
14
}
 
15
 
 
16
int exercise_required_alignment = 0;
 
17
 
 
18
size_t exercise(float *res, float *a, float *b, size_t size, int iterations) {
 
19
    long i;
 
20
 
 
21
    float alpha = 1, beta = 0;
 
22
    CBLAS_TRANSPOSE transA = CblasNoTrans, transB = CblasNoTrans, order = CblasRowMajor;
 
23
 
 
24
    for (i = 0; i < iterations; i++) {
 
25
        cblas_sgemm(order, transA, transB, size, size, size, alpha,
 
26
                  a, size, b, size, beta, res, size);
 
27
    }
 
28
 
 
29
    return 0;
 
30
}