This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
typedef enum { | |
TKN_INT, | |
TKN_PLS, TKN_MNS, | |
TKN_AST, TKN_SLS, TKN_PER, | |
TKN_LP, TKN_RP, TKN_EOF | |
} TokenId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <time.h> | |
#include <cblas.h> | |
#define N 2000 | |
static struct timespec ts_start, ts_stop; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void my_dgemm(int m, int n, int k, double alpha, double *a, int lda, | |
double *b, int ldb, double beta, double *c, int ldc) | |
{ | |
int i, j, l; | |
for (i = 0; i < m; i++) { | |
for (j = 0; j < n; j++) { | |
c[i * ldc + j] *= beta; | |
} | |
} | |
for (i = 0; i < m; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void my_dgemm(int m, int n, int k, double alpha, double *a, int lda, | |
double *b, int ldb, double beta, double *c, int ldc) | |
{ | |
int i, j, l; | |
for (i = 0; i < m; i++) { | |
for (j = 0; j < n; j++) { | |
c[i * ldc + j] *= beta; | |
} | |
} | |
for (i = 0; i < m; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BN 500 | |
void my_dgemm(int m, int n, int k, double alpha, double *a, int lda, | |
double *b, int ldb, double beta, double *c, int ldc) | |
{ | |
int i, j, l; | |
int ii, jj, ll; | |
int max_ii, max_jj, max_ll; | |
for (i = 0; i < m; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BN2 500 | |
#define BN1 25 | |
void my_dgemm(int m, int n, int k, double alpha, double *a, int lda, | |
double *b, int ldb, double beta, double *c, int ldc) | |
{ | |
int x, y; | |
int i, j, l; | |
int ii, jj, ll; | |
int max_ii, max_jj, max_ll; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <immintrin.h> | |
#define BN2 480 | |
#define BN1 48 | |
void small_dgemm(double alpha, double *a, int lda, double *b, int ldb, | |
double *c, int ldc) | |
{ | |
int mm, nn, kk; | |
for (mm = 0; mm < BN1; mm += 3) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <immintrin.h> | |
#define BN2 480 | |
#define BN1 48 | |
void small_dgemm(double alpha, double *a, int lda, double *b, int ldb, | |
double *c, int ldc) | |
{ | |
int mm, nn, kk; | |
for (mm = 0; mm < BN1; mm += 3) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <immintrin.h> | |
#define BN2 480 | |
#define BN1 48 | |
void small_dgemm(double alpha, double *a, int lda, double *b, int ldb, | |
double *c, int ldc) | |
{ | |
int mm, nn, kk; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <immintrin.h> | |
#define BN2 480 | |
#define BN1 48 | |
double *alloc_matrix(int height, int width); | |
void free_matrix(double *matrix); | |
void small_dgemm(double alpha, double *a, int lda, double *b, int ldb, |
OlderNewer