diff options
Diffstat (limited to 'mat_mul.c')
-rw-r--r-- | mat_mul.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -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"); } } |