CUFCTL / face-recognition

A GPU-accelerated real-time face recognition system based on classical machine learning algorithms
MIT License
23 stars 11 forks source link

Debug information for matrix operations #17

Closed bentsherman closed 7 years ago

bentsherman commented 8 years ago

Someone suggested that it would be helpful to print something for each matrix operation (if verbose output is enabled) that gives the equation and matrix dimensions, something like this:

matrix_t *A, *B;

// initialize A, B ...

if ( LOGLEVEL >= LL_DEBUG ) {
    printf("C [%d, %d] <- A [%d, %d] * B [%d, %d]\n", A->rows, B->cols, A->rows, A->cols, B->rows, B->cols);
}

matrix_t *C = m_product(A, B);

This method is pretty straightforward, you would have to add a print statement to every matrix operation throughout the code. We could put the print statements in the matrix library functions so that they don't clutter the rest of the code, but then we would need a way to provide the variable names. You could have a "name" field in the matrix_t struct, I think that would cover most cases without changing the matrix API.

arlindohall commented 7 years ago

This would be useful for the whole code base. Good project for someone looking for something to fill out the remainder of the semester.

bentsherman commented 7 years ago

I added this feature over the break. We can tweak it as needed but it's basically done now.