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

Documentation does not make clear when output matrices are allocated by the library and when they have to be supplied by the user #207

Open
TillAlex opened this issue Feb 8, 2017 · 0 comments

Comments

@TillAlex
Copy link

TillAlex commented Feb 8, 2017

Some of the methods calculating sparse matrices are allocating their outputs internally (e.g. clsparseScsrSpGemm) which makes sense, because it is not known in advance how many non-zero entries there will be.

Other methods need the user to allocate the output buffers ( e.g. Sdense2Csr). In this case the user has to know in advance how many non-zero entries there will be. However, internally Sdense2Csr counts non-zero entries to be able to allocate the intermediate CooMatrix anyway, so zeros are counted twice in the end.

  1. Documentation should clearly state when the user has to allocate output buffers and when the library does

  2. Methods calculating sparse outputs should either allocate internally after counting non-zero entries or trust the non-zero count passed by the user in the user allocated output matrix to speed up calculations.

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

No branches or pull requests

1 participant