Skip to content

Document in-place matrix addition, subtraction, and scaling - #337

Open
sylvesterkaczmarek wants to merge 1 commit into
ARM-software:mainfrom
sylvesterkaczmarek:docs/matrix-in-place-44
Open

Document in-place matrix addition, subtraction, and scaling#337
sylvesterkaczmarek wants to merge 1 commit into
ARM-software:mainfrom
sylvesterkaczmarek:docs/matrix-in-place-44

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

  • document the in-place contract for matrix addition, subtraction, and scaling
  • clarify that the destination may reuse a source matrix instance or the identical source data buffer
  • distinguish exact source and destination aliasing from unsupported partial buffer overlap

Context

Issue #44 asks which matrix operations support in-place use and notes that the behavior is absent from the documentation. A maintainer confirmed that operations such as scaling and addition support it and that the documentation should be improved.

The current addition, subtraction, and scaling implementations read each input element or vector block before writing the corresponding output. This permits exact destination aliasing for the available f16, f32, f64, q15, and q31 variants without changing their APIs or implementations.

This addresses #44.

Validation

  • git diff --check
  • compiled all 13 documented scalar implementations with GCC 13.3.0 and -Wall -Wextra -Werror, ARM_MATH_MATRIX_CHECK, and configurations both with and without ARM_MATH_LOOPUNROLL
  • ran focused tests for exact destination aliasing with either source matrix and with a distinct destination instance sharing a source data buffer
  • covered f16, f32, f64, q15, and q31 variants with seven-element matrices, including loop remainders and fixed-point saturation cases
  • audited the current Helium and Neon paths to confirm that each vector block is loaded before its destination block is written; those target-specific paths were not executed locally

Documentation-only change. The full repository test suite was not run.

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

Successfully merging this pull request may close these issues.

1 participant