Skip to content

[Feature Request] Add Save-Area Size Helper API (Caller Preallocation) #48

@k8ika0s

Description

@k8ika0s

Proposed PR branch: qe/issue-09-save-area-size-api

Category: Feature Request (performance + usability)

Problem

  • Save-area allocation requirements are non-obvious to integrators.
  • Precomputing sizes enables reuse and avoids repeated allocation overhead.

Justification / why this is needed

  • Like work-area sizing, save-area sizing is needed to avoid hidden runtime
    allocations, especially when a caller wants strict memory control.
  • Helps keep higher-level integration code smaller and less error-prone.

Proposed change

  • Add zdnn_get_save_area_size(...).
  • Add tests.
  • (Optional follow-up) Add README guidance where save-area usage is currently unclear.

Acceptance criteria

  • Helper returns required bytes (return 0 on invalid inputs).
  • Tests validate sizing and invalid argument handling.

Test plan

  • make test (expects tests/testDriver_save_area_size_apis.c to pass).

References

  • Key files: zdnn/save_area.c, zdnn/zdnn.h, zdnn/zdnn.map,
    tests/testDriver_save_area_size_apis.c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions