Skip to content

Commit

Permalink
Benchmark cleanup #56
Browse files Browse the repository at this point in the history
  • Loading branch information
nakatamaho committed Sep 24, 2022
1 parent c88d388 commit 0562aba
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 37 deletions.
2 changes: 1 addition & 1 deletion benchmark/mpblas/Raxpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) {
mplapackint n = 1;
mplapackint incx = 1, incy = 1, STEP = 97, LOOPS = 3, TOTALSTEPS = 3092;
char normtype = 'm';
REAL alpha, dummy, *dummywork = new REAL[1];
REAL alpha, dummy, dummywork[1];
double elapsedtime;
int i, p;
int check_flag = 1;
Expand Down
2 changes: 1 addition & 1 deletion benchmark/mpblas/Rgemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ double flops_gemm(mplapackint k_i, mplapackint m_i, mplapackint n_i) {

int main(int argc, char *argv[]) {
REAL alpha, beta, dummy;
REAL *dummywork = new REAL[1];
REAL dummywork[1];
double elapsedtime;
char transa = 'n', transb = 'n', normtype = 'm';
int m = 1, n = 1, k = 1, STEPN = 3, STEPM = 3, STEPK = 3, LOOPS = 3, TOTALSTEPS = 333;
Expand Down
21 changes: 7 additions & 14 deletions benchmark/mpblas/Rgemm_dd_cuda_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ void SetDevice() {

int main(int argc, char *argv[]) {
REAL alpha, beta, dummy;
REAL *dummywork;
REAL dummywork[1];
double elapsedtime;
double *dummyd;
char transa, transb, normtype;
int N0, M0, K0, STEPN = 7, STEPM = 7, STEPK = 7, LOOPS = 3, TOTALSTEPS = 720;
char transa = 'n', transb = 'n', normtype = 'm';
int m = 1, n = 1, k = 1, STEPN = 7, STEPM = 7, STEPK = 7, LOOPS = 3, TOTALSTEPS = 720;
int lda, ldb, ldc;
int i, j, m, n, k, ka, kb, p, q;
int i, ka, kb, p;
int check_flag = 1;

const char mpblas_sym[] = SYMBOL_GCC_RGEMM;
Expand All @@ -107,18 +107,14 @@ int main(int argc, char *argv[]) {
using std::chrono::nanoseconds;

// initialization
N0 = M0 = K0 = 1;
STEPM = STEPN = STEPK = 1;
transa = transb = 'n';
normtype = 'm';
if (argc != 1) {
for (i = 1; i < argc; i++) {
if (strcmp("-N", argv[i]) == 0) {
N0 = atoi(argv[++i]);
n = atoi(argv[++i]);
} else if (strcmp("-M", argv[i]) == 0) {
M0 = atoi(argv[++i]);
m = atoi(argv[++i]);
} else if (strcmp("-K", argv[i]) == 0) {
K0 = atoi(argv[++i]);
k = atoi(argv[++i]);
} else if (strcmp("-STEPN", argv[i]) == 0) {
STEPN = atoi(argv[++i]);
} else if (strcmp("-STEPM", argv[i]) == 0) {
Expand Down Expand Up @@ -168,9 +164,6 @@ int main(int argc, char *argv[]) {
cudaMalloc((void **)&dummyd, 16);
cudaFree(dummyd);

m = M0;
n = N0;
k = K0;
for (p = 0; p < TOTALSTEPS; p++) {
if (Mlsame(&transa, "n")) {
ka = k;
Expand Down
2 changes: 1 addition & 1 deletion benchmark/mpblas/Rgemv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) {
mplapackint STEPN = 1, STEPM = 1, LOOPS = 3, TOTALSTEPS = 283;
mplapackint incx = 1, incy = 1;
char trans = 'n', normtype = 'm';
REAL alpha, beta, dummy, *dummywork = new REAL[1];
REAL alpha, beta, dummy, dummywork[1];
REAL mOne = -1;
double elapsedtime;
int i, p;
Expand Down
2 changes: 1 addition & 1 deletion benchmark/mpblas/Rsyrk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ double flops_syrk(mplapackint k_i, mplapackint n_i) {

int main(int argc, char *argv[]) {
REAL alpha, beta, dummy;
REAL *dummywork = new REAL[1];
REAL dummywork[1];
double elapsedtime;
char uplo = 'u', trans = 'n', normtype = 'm';
int n = 1, k = 1, STEPN = 3, STEPK = 3, LOOPS = 3, TOTALSTEPS = 340;
Expand Down
20 changes: 6 additions & 14 deletions benchmark/mpblas/Rsyrk_dd_cuda_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ double flops_syrk(mplapackint k_i, mplapackint n_i) {

int main(int argc, char *argv[]) {
REAL alpha, beta, dummy;
REAL *dummywork;
REAL dummywork[1];
double elapsedtime;
double *dummyd;
char uplo, trans, normtype;
int N0, K0, STEPN, STEPK, LOOPS = 3, TOTALSTEPS = 100;
char uplo = 'u', trans = 'n', normtype = 'm';
int STEPN = 1, STEPK = 1, LOOPS = 3, TOTALSTEPS = 100;
int lda, ldc;
int i, j, n, k, ka, kb, p, q;
int i, n = 1, k = 1, ka, p;
int check_flag = 1;

const char mpblas_sym[] = SYMBOL_GCC_RSYRK;
Expand All @@ -106,17 +106,12 @@ int main(int argc, char *argv[]) {
using std::chrono::nanoseconds;

// initialization
N0 = K0 = 1;
STEPN = STEPK = 1;
uplo = 'u';
trans = 'n';
normtype = 'm';
if (argc != 1) {
for (i = 1; i < argc; i++) {
if (strcmp("-N", argv[i]) == 0) {
N0 = atoi(argv[++i]);
n = atoi(argv[++i]);
} else if (strcmp("-K", argv[i]) == 0) {
K0 = atoi(argv[++i]);
k = atoi(argv[++i]);
} else if (strcmp("-STEPN", argv[i]) == 0) {
STEPN = atoi(argv[++i]);
} else if (strcmp("-STEPK", argv[i]) == 0) {
Expand Down Expand Up @@ -153,7 +148,6 @@ int main(int argc, char *argv[]) {
fprintf(stderr, "%s\n", error);
return 1;
}

raxpy_ref = (void (*)(mplapackint, REAL, REAL *, mplapackint, REAL *, mplapackint))dlsym(handle, raxpy_sym);
if ((error = dlerror()) != NULL) {
fprintf(stderr, "%s\n", error);
Expand All @@ -166,8 +160,6 @@ int main(int argc, char *argv[]) {
cudaMalloc((void **)&dummyd, 16);
cudaFree(dummyd);

n = N0;
k = K0;
for (p = 0; p < TOTALSTEPS; p++) {
if (Mlsame(&trans, "n")) {
ka = k;
Expand Down
4 changes: 2 additions & 2 deletions benchmark/mpblas/dgemm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ int main(int argc, char *argv[]) {
double elapsedtime;
char transa = 'n', transb = 'n';
int STEPN = 7, STEPM = 7, STEPK = 7, LOOPS = 7, TOTALSTEPS = 428;
int lda, ldb, ldc;
int i, m = 1, n = 1, k = 1, ka, kb, p;
int m = 1, n = 1, k = 1, int lda, ldb, ldc;
int i, ka, kb, p;

using Clock = std::chrono::high_resolution_clock;
using std::chrono::duration_cast;
Expand Down
5 changes: 2 additions & 3 deletions benchmark/mpblas/dgemv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,12 @@ double flops_gemv(int m_i, int n_i) {
}

int main(int argc, char *argv[]) {
int k, l, m, n;
int STEPN = 1, STEPM = 1, LOOPS = 3, TOTALSTEPS = 283;
int incx = 1, incy = 1;
int m = 1, n = 1, incx = 1, incy = 1;
char trans = 'n';
double alpha, beta, dummy;
double elapsedtime;
int i, p;
int i, k, l, p;

using Clock = std::chrono::high_resolution_clock;
using std::chrono::duration_cast;
Expand Down

0 comments on commit 0562aba

Please sign in to comment.