Skip to content

Pass Cholesky workspace as buffer_view - #12

Merged
karl-kes merged 1 commit into
UWHPC:mainfrom
KerelosGayed:kg/cusolver-workspace-buffer-view
Sep 30, 2026
Merged

karl-kes merged 1 commit into
UWHPC:mainfrom
KerelosGayed:kg/cusolver-workspace-buffer-view

Conversation

@KerelosGayed

Copy link
Copy Markdown
Contributor

Follow-up to #11.

cusolver_potrf took the workspace as a separate pointer and size, which is how the size()/count() mismatch in #11 slipped in. It now takes an xpu::buffer_view<T>, so the pointer and element count come from the same object, and the call site passes workspace_.view().

To support this, buffer_view gets a data() accessor that follows the same constness deduction as operator[].

This is the only internal helper that passes a pointer with a separate length. cusolver_getrf takes no workspace size, and fill_n/copy_n are left alone since they are public std-style APIs.

Validation:

  • Built and ran the CPU buffer tests, including new checks for buffer_view::data() on mutable, const, empty, and owner views.
  • Syntax-checked the CPU linear algebra tests.
  • git diff --check passed.
  • CUDA compilation/runtime tests were not run locally because nvcc is unavailable.

@karl-kes karl-kes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

@karl-kes
karl-kes merged commit 863ceca into UWHPC:main Sep 30, 2026
2 checks passed
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.

2 participants