From 8946be85b1f4000da5ad95f7179e85582276dba1 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 27 Apr 2012 16:27:36 -0400 Subject: mat-mul: It works now --- mat_mul.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mat_mul.c b/mat_mul.c index fbe7cc8..802bfad 100644 --- a/mat_mul.c +++ b/mat_mul.c @@ -24,28 +24,27 @@ int main(int argc, char ** argv) size_t a_bytes; size_t b_bytes; -/* - int A[8] = {1, 3, 4, 7, + + /* 2 x 4 */ + int A[8] = {1, 3, 5, 7, 2, 4, 6, 8}; + /* 4 x 3 */ int B[12] = {1, 8, 9, 2, 7, 10, 3, 6, 11, 4, 5, 12}; -*/ - int A[1] = {5}; - int B[1] = {3}; - widthA = 1; - heightA = 1; + heightA = 2; + widthA = 4; - widthB = 1; - heightB = 1; + heightB = 4; + widthB = 3; global_work_size[0] = widthB; global_work_size[1] = heightA; - out_size = heightA * heightB; + out_size = heightA * widthB; out_bytes = sizeof(int) * out_size; a_bytes = sizeof(int) * widthA * heightA; @@ -96,7 +95,7 @@ int main(int argc, char ** argv) for (i = 0; i < out_size; i++) { fprintf(stderr, "%d ", out[i]); - if ((i + 1) % heightB == 0) { + if ((i + 1) % widthB == 0) { fprintf(stderr, "\n"); } } -- cgit v1.2.3