Skip to content

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

@TillAlex

Description

@TillAlex

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions