Skip to content

Fixes for OpenCL - #196

Open
szymonlopaciuk wants to merge 2 commits into
xsuite:mainfrom
szymonlopaciuk:opencl-fixes
Open

szymonlopaciuk wants to merge 2 commits into
xsuite:mainfrom
szymonlopaciuk:opencl-fixes

Conversation

@szymonlopaciuk

Copy link
Copy Markdown
Contributor

Description

  • Make test_grow independent of the buffer alignment
  • Allow empty arrays in BufferPyopencl.update_from_nplike

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

szymonlopaciuk and others added 2 commits November 20, 2026 14:26
An empty pyopencl array has no backing buffer (base_data is None), and
pyopencl rejects None as the source of a copy. Nothing needs copying for
an empty array, so return early.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The expected capacities assumed a small minimum alignment. On devices
that need larger alignments (e.g. 256 bytes on AMD gfx906) the buffer
grows by more, so derive the expected offsets and capacities from
default_alignment.
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