Changeset 5705 in /cluster/svnroot


Ignore:
Timestamp:
May 25, 2016 11:05:33 PM (5 years ago)
Author:
skylar
Message:

support ranged product matrix generation

Location:
bccd-ng/bw-institute/2016/day06/matmul
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/bw-institute/2016/day06/matmul/matmul.c

    r5704 r5705  
    120120#endif
    121121
    122 void matmul(struct matrix *m1,struct matrix *m2,struct matrix *dst_m) {
     122void matmul(
     123        struct matrix *m1,
     124        struct matrix *m2,
     125        struct matrix *dst_m,
     126        const unsigned int start_dst_row, // Start generating at this row of the product matrix
     127        const unsigned int end_dst_row // End generating at this row of the product matrix
     128        ) {
    123129    unsigned int dst_row,dst_col,i,dst_coord;
    124130
     
    133139    // Process each cell in the destination matrix, and calculate the result
    134140    // based on the two source matrices
    135     for(dst_row=0;dst_row<dst_m->rows;dst_row++) {
     141    for(dst_row=start_dst_row;dst_row<end_dst_row;dst_row++) {
    136142        for(dst_col=0;dst_col<dst_m->cols;dst_col++) {
    137143#ifdef DEBUG
  • bccd-ng/bw-institute/2016/day06/matmul/matmul.h

    r5704 r5705  
    5555// Takes in two sources matrices and a destination matrix
    5656// Populates destination matrix by multiplying the first two matrices
    57 void matmul(struct matrix *,struct matrix *,struct matrix *);
     57void matmul(struct matrix *,struct matrix *,struct matrix *,const unsigned int,const unsigned int);
    5858
    5959#endif
  • bccd-ng/bw-institute/2016/day06/matmul/serial-omp.c

    r5694 r5705  
    7171
    7272    // Matrix computation
    73     matmul(&m1,&m2,&dst_m);
     73    matmul(&m1,&m2,&dst_m,0,dst_m.rows);
    7474
    7575    if(print) {
Note: See TracChangeset for help on using the changeset viewer.