Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rozukke committed Jun 26, 2024
1 parent 17fcabc commit 05063db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int main(int argc, char* argv[]) {
printf("Not enough arguments.");
return EXIT_FAILURE;
}

// Start timing
struct timeval stop, start;
gettimeofday(&start, NULL);
Expand Down
24 changes: 11 additions & 13 deletions src/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ void matrix_mul(const matrix* weights, const matrix* inputs, const matrix* __res

int u_limit = w_width - (UNROLL_FACTOR - 1);

for (int cur_row = 0; cur_row < res_rows; cur_row++) {
for (int cur_row = 0; cur_row < res_rows; cur_row++) {
float sum0 = 0;
float sum1 = 0;
float sum2 = 0;
float sum3 = 0;
float sum4 = 0;
float sum5 = 0;
float sum6 = 0;
float sum1 = 0;
float sum2 = 0;
float sum3 = 0;
float sum4 = 0;
float sum5 = 0;
float sum6 = 0;
float sum7 = 0;
// float sum8 = 0;
// float sum8 = 0;
// float sum9 = 0;
int row_offs = cur_row * w_width;

int k = 0;
for (; k < u_limit; k += UNROLL_FACTOR) {
sum0 += w_data[row_offs + k] * i_data[k];
Expand All @@ -52,10 +52,8 @@ void matrix_mul(const matrix* weights, const matrix* inputs, const matrix* __res
for (; k < w_width; k++) {
sum0 += w_data[row_offs + k] * i_data[k];
}

(result->data)[cur_row] =
sum0 + sum1 + sum2 + sum3 + sum4
+ sum5 + sum6 + sum7; // + sum8 + sum9;

(result->data)[cur_row] = sum0 + sum1 + sum2 + sum3 + sum4 + sum5 + sum6 + sum7; // + sum8 + sum9;
}
}

Expand Down

0 comments on commit 05063db

Please sign in to comment.