Skip to content

Incorrect handling of negative vector increments in xLARF, xLARF1F and xLARF1L APIs #1314

Closed

Description

@sameer-amd-in

Description

While working with xLARF, xLARF1F and xLARF1L we found a bug with
handling of input vector V with negative increments. xLARF1F and xLARF1L
directly give incorrect result with negative increments.

xLARF with negative increment gives correct result for normal cases but
fails when there are trailing zeroes in the input vector V. The API
does not properly set the index for V while skipping the trailing zeroes.

We have created a standalone test program larf_test.f.txt to reproduce the issue and have attached it here for reference.

The test program takes the following input parameters:

  • M: Number of rows in matrix C
  • N: Number of columns in matrix C
  • INCV: Increment for vector V (can be negative)
  • LDC: Leading dimension of matrix C
  • NUM_V_ZEROES <optional>: Number of skippable leading/trailing zeroes in vector V
  • NUM_C_ZEROES <optional>: Number of skippable zero rows/columns in matrix C

Sample run to reproduce the issue: ./larf_test 10 10 -1 10 2

We have created a patch to fix these issues.
If you are interested, we can submit a pull request with the patch or share the patch file directly for further review.

Please let me know if you have any questions or need further information.

Best regards,

Checklist

  • I've included a minimal example to reproduce the issue
  • I'd be willing to make a PR to solve this issue

Activity

  1. mgates3 commented on Jun 19, 2026

    @mgates3
    Collaborator

    Yes, please submit a PR.

  2. sameer-amd-in commented on Jun 21, 2026

    @sameer-amd-in
    ContributorAuthor

    Submitted the PR. Please provide feedback whenever possible.
    Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions