-
Notifications
You must be signed in to change notification settings - Fork 49
Feature/julia/fastsum #98
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
Conversation
…ctly (temporary pointer)
…ture/julia/fastsum
|
The request can now be properly reviewed. |
julia/fastsum/libfastsumjulia.c
Outdated
| if ( !(p->y) ) | ||
| fastsum_init_guru_target_nodes( p, M, nn, m ); | ||
| else { | ||
| fastsum_finalize_target_nodes( p ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the following line seem to be superfluous since N, nn, m cannot change in this Julia interface implementation. Moreover if this line is executed after alpha is set (i.e. you use set_x, set_alpha and then set_x again), alpha is quietly deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved initializing the source and target nodes to the plan initializer.
|
|
||
| for ( int k = 0; k < N; k++ ) | ||
| if ( p -> permutation_x_alpha == NULL ) | ||
| p -> alpha[k] = alpha[k]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p -> alpha is allocated in fastsum_init_guru_source_nodes, which is called in set_x. So if set_alpha is called before set_x, this means we write on the dangling pointer p -> alpha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can't happen with the new commit.
| } | ||
|
|
||
| void jfastsum_finalize( fastsum_plan* p ){ | ||
| fastsum_finalize_source_nodes( p ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should check if the source nodes were initialized before calling fastsum_finalize_source_nodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't be necessary with the new structure since the finalizer in julia checks if the plan was initialized.
adding a fastsum interface for Julia