diff options
Diffstat (limited to 'mt/an_matmul/an_matmul.c')
-rwxr-xr-x | mt/an_matmul/an_matmul.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mt/an_matmul/an_matmul.c b/mt/an_matmul/an_matmul.c index e7608fe..2150277 100755 --- a/mt/an_matmul/an_matmul.c +++ b/mt/an_matmul/an_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; @@ -163,33 +163,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); } |