Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gauss Jordan Matrix Inversion #80

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Gauss Jordan Matrix Inversion #80

wants to merge 22 commits into from

Conversation

mbertuletti
Copy link
Collaborator

@mbertuletti mbertuletti commented Apr 13, 2023

Added

Add fixed point matrix inversion kernels, following Gauss-Jordan elimination method.

  • Add single-core kernel
  • Add parallel kernel with naive parallelization scheme
  • Add parallel kernel with parallelization scheme that privileges local accesses

Checklist

  • Automated tests pass
  • Changelog updated
  • Code style guideline is observed

Copy link
Member

@SamuelRiedel SamuelRiedel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good to me. I just have two minor questions.

Comment on lines +52 to +73
void Transpose(int32_t *matrix, int32_t *t_matrix, int32_t n, int32_t m) {
int32_t i, j;
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
t_matrix[j * n + i] = matrix[i * m + j];
}
}
}

void MatrixMult(int32_t *matrix_1, int32_t *matrix_2, int32_t *matrix_product,
int32_t n, int32_t m, int32_t o) {
int32_t i, j, k;
for (i = 0; i < n; i++) {
for (j = 0; j < o; j++) {
matrix_product[i * o + j] = 0;
for (k = 0; k < m; k++) {
matrix_product[i * o + j] +=
FIX_MUL(matrix_1[i * m + k], matrix_2[k * o + j]);
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are unused, right? Do we need them somewhere else?


#define N 16
#define M 16
#define N_BANKS (1024)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the number of banks in the system? Because for this, we have a globally set define by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants