aboutsummaryrefslogtreecommitdiff
path: root/mt/bb_matmul
diff options
context:
space:
mode:
authorHenry Cook <hcook@eecs.berkeley.edu>2014-09-24 18:11:42 -0700
committerHenry Cook <hcook@eecs.berkeley.edu>2014-09-24 18:34:50 -0700
commit9f7ed92e1aeb91593ceb8baf26ff4fe0a1a9efa6 (patch)
tree81654ff43e33b08a117cb9b199e60dbce8b32fe5 /mt/bb_matmul
parentdbde501592ce20c536cbc97e99d03f54f3e30294 (diff)
downloadriscv-tests-9f7ed92e1aeb91593ceb8baf26ff4fe0a1a9efa6.zip
riscv-tests-9f7ed92e1aeb91593ceb8baf26ff4fe0a1a9efa6.tar.gz
riscv-tests-9f7ed92e1aeb91593ceb8baf26ff4fe0a1a9efa6.tar.bz2
Updated mt tests
Diffstat (limited to 'mt/bb_matmul')
-rwxr-xr-xmt/bb_matmul/bb_matmul.c26
-rwxr-xr-xmt/bb_matmul/matmul_mi.c26
2 files changed, 26 insertions, 26 deletions
diff --git a/mt/bb_matmul/bb_matmul.c b/mt/bb_matmul/bb_matmul.c
index 067e3e3..d9b2add 100755
--- a/mt/bb_matmul/bb_matmul.c
+++ b/mt/bb_matmul/bb_matmul.c
@@ -52,7 +52,7 @@ unsigned long ncores;
//--------------------------------------------------------------------------
// Helper functions
-void printArray( char name[], int n, data_t arr[] )
+void printArrayMT( char name[], int n, data_t arr[] )
{
int i;
if (coreid != 0)
@@ -64,7 +64,7 @@ void printArray( char name[], int n, data_t arr[] )
printf( "\n" );
}
-void __attribute__((noinline)) verify(size_t n, const data_t* test, const data_t* correct)
+void __attribute__((noinline)) verifyMT(size_t n, const data_t* test, const data_t* correct)
{
if (coreid != 0)
return;
@@ -184,7 +184,7 @@ void __attribute__((noinline)) matmul_mi(const int lda, const data_t A[], const
}
}
- barrier();
+ barrier(ncores);
curhalf++;
curhalf %= ncores;
@@ -240,33 +240,33 @@ void thread_entry(int cid, int nc)
// // Execute the provided, naive matmul
-// barrier();
-// stats(matmul_naive(DIM_SIZE, input1_data, input2_data, results_data); barrier());
+// barrier(nc);
+// stats(matmul_naive(DIM_SIZE, input1_data, input2_data, results_data); barrier(nc));
//
//
// // verify
-// verify(ARRAY_SIZE, results_data, verify_data);
+// verifyMT(ARRAY_SIZE, results_data, verify_data);
//
// // clear results from the first trial
// size_t i;
// if (coreid == 0)
// for (i=0; i < ARRAY_SIZE; i++)
// results_data[i] = 0;
-// barrier();
+// barrier(nc);
// Execute your faster matmul
- barrier();
- stats(matmul(DIM_SIZE, input1_data, input2_data, results_data); barrier());
+ barrier(nc);
+ stats(matmul(DIM_SIZE, input1_data, input2_data, results_data); barrier(nc));
#ifdef DEBUG
- printArray("results:", ARRAY_SIZE, results_data);
- printArray("verify :", ARRAY_SIZE, verify_data);
+ printArrayMT("results:", ARRAY_SIZE, results_data);
+ printArrayMT("verify :", ARRAY_SIZE, verify_data);
#endif
// verify
- verify(ARRAY_SIZE, results_data, verify_data);
- barrier();
+ verifyMT(ARRAY_SIZE, results_data, verify_data);
+ barrier(nc);
exit(0);
}
diff --git a/mt/bb_matmul/matmul_mi.c b/mt/bb_matmul/matmul_mi.c
index 919e2ce..346f178 100755
--- a/mt/bb_matmul/matmul_mi.c
+++ b/mt/bb_matmul/matmul_mi.c
@@ -52,7 +52,7 @@ unsigned long ncores;
//--------------------------------------------------------------------------
// Helper functions
-void printArray( char name[], int n, data_t arr[] )
+void printArrayMT( char name[], int n, data_t arr[] )
{
int i;
if (coreid != 0)
@@ -64,7 +64,7 @@ void printArray( char name[], int n, data_t arr[] )
printf( "\n" );
}
-void __attribute__((noinline)) verify(size_t n, const data_t* test, const data_t* correct)
+void __attribute__((noinline)) verifyMT(size_t n, const data_t* test, const data_t* correct)
{
if (coreid != 0)
return;
@@ -184,7 +184,7 @@ void __attribute__((noinline)) matmul_mi(const int lda, const data_t A[], const
}
}
- barrier();
+ barrier(nc);
curhalf++;
curhalf %= ncores;
@@ -240,33 +240,33 @@ void thread_entry(int cid, int nc)
// // Execute the provided, naive matmul
-// barrier();
-// stats(matmul_naive(DIM_SIZE, input1_data, input2_data, results_data); barrier());
+// barrier(nc);
+// stats(matmul_naive(DIM_SIZE, input1_data, input2_data, results_data); barrier(nc));
//
//
// // verify
-// verify(ARRAY_SIZE, results_data, verify_data);
+// verifyMT(ARRAY_SIZE, results_data, verify_data);
//
// // clear results from the first trial
// size_t i;
// if (coreid == 0)
// for (i=0; i < ARRAY_SIZE; i++)
// results_data[i] = 0;
-// barrier();
+// barrier(nc);
// Execute your faster matmul
- barrier();
- stats(matmul(DIM_SIZE, input1_data, input2_data, results_data); barrier());
+ barrier(nc);
+ stats(matmul(DIM_SIZE, input1_data, input2_data, results_data); barrier(nc));
#ifdef DEBUG
- printArray("results:", ARRAY_SIZE, results_data);
- printArray("verify :", ARRAY_SIZE, verify_data);
+ printArrayMT("results:", ARRAY_SIZE, results_data);
+ printArrayMT("verify :", ARRAY_SIZE, verify_data);
#endif
// verify
- verify(ARRAY_SIZE, results_data, verify_data);
- barrier();
+ verifyMT(ARRAY_SIZE, results_data, verify_data);
+ barrier(nc);
exit(0);
}