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

[BUG] Using incx or incy with linalg::axpy results in invalid memory access #944

Closed
benfred opened this issue Oct 22, 2022 · 1 comment · Fixed by #942
Closed

[BUG] Using incx or incy with linalg::axpy results in invalid memory access #944

benfred opened this issue Oct 22, 2022 · 1 comment · Fixed by #942
Assignees
Labels
bug Something isn't working

Comments

@benfred
Copy link
Member

benfred commented Oct 22, 2022

Describe the bug
Settingincx or incy to a value other than 1 in linalg::axpy results in invalid memory access, for the mdspan versions of lingalg::axpy

This is because the input x/y mdspan's are assumed to be c_contiguous - and having incx or incy > 1 will cause the cublasaxpy function to access memory past whats valid from the mdspan .data_handle() / .size().

Steps/Code to reproduce bug

Set incx/incy > 1 when calling linalg::axpy

Expected behavior

It seems like the incx/incy parameters shouldn't be part of the public API for the mdspan version of linalg::axpy - and maybe should be gotten from the mdspan::stride accessor (for layout_stride spans).

@benfred benfred added the bug Something isn't working label Oct 22, 2022
@cjnolet
Copy link
Member

cjnolet commented Oct 24, 2022

This is because the input x/y mdspan's are assumed to be c_contiguous

You are correct, and I think that's because the layout is not being captured in the templates here , causing only the default layout to be assumed. I think we should change this sooner rather than later (before the new API functions gets more heavy use).

@benfred benfred self-assigned this Oct 26, 2022
rapids-bot bot pushed a commit that referenced this issue Oct 27, 2022
Closes #873
Closes #944

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #942
@rapids-bot rapids-bot bot closed this as completed in #942 Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants