From d537de7deffa6036dab573ff174b7f8c8e470437 Mon Sep 17 00:00:00 2001 From: Henry Cook Date: Thu, 6 Nov 2014 17:24:39 -0800 Subject: Clean up canonical mt benchmarks and reorganize extra versions in /mt. All versions support support at least 1/2/4 threads. --- mt/bm_matmul.c | 205 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 mt/bm_matmul.c (limited to 'mt/bm_matmul.c') diff --git a/mt/bm_matmul.c b/mt/bm_matmul.c new file mode 100644 index 0000000..ae225d4 --- /dev/null +++ b/mt/bm_matmul.c @@ -0,0 +1,205 @@ +#include "stdlib.h" + +#include "util.h" + +#include "dataset.h" +void __attribute__((noinline)) matmul(const int coreid, const int ncores, const int lda, const data_t A[], const data_t B[], data_t C[] ) +{ + + // ***************************** // + // **** ADD YOUR CODE HERE ***** // + // ***************************** // + // + // feel free to make a separate function for MI and MSI versions. + int i, j, k; + int space=lda/ncores; + int max= space*coreid+space; + data_t temp=0; + + data_t temp1=0; + data_t temp2=0; + data_t temp3=0; + data_t temp4=0; + + data_t temp_1=0; + + data_t temp1_1=0; + data_t temp2_1=0; + data_t temp3_1=0; + data_t temp4_1=0; + + data_t temp_2=0; + + data_t temp1_2=0; + data_t temp2_2=0; + data_t temp3_2=0; + data_t temp4_2=0; + + data_t temp_3=0; + + data_t temp1_3=0; + data_t temp2_3=0; + data_t temp3_3=0; + data_t temp4_3=0; + + if (coreid!=ncores-1){ + //main loop + for (i=space*coreid;i