Skip to content

fix cuda_device_ptr() method#6864

Closed
a10y wants to merge 1 commit intodevelopfrom
aduffy/device-ptr-fix
Closed

fix cuda_device_ptr() method#6864
a10y wants to merge 1 commit intodevelopfrom
aduffy/device-ptr-fix

Conversation

@a10y
Copy link
Contributor

@a10y a10y commented Mar 10, 2026

Summary

Previously we'd return the pointer to the front of the allocation.

We should be returning the pointer to the beginning of the pointed range, e.g. for sliced allocations like what happens when you try and load the patches out of a CudaFlatLayout.

I encountered this after wasting a lot of time trying to unpack why patches.indices.buffer_handle() and patches.values.buffer_handle() were the same pointer.

Testing

Added a simple unit test + existing test suite.

@a10y a10y added the changelog/fix A bug fix label Mar 10, 2026
Signed-off-by: Andrew Duffy <andrew@a10y.dev>
@a10y a10y force-pushed the aduffy/device-ptr-fix branch from 185c414 to 0eb716e Compare March 10, 2026 15:27
@a10y a10y marked this pull request as ready for review March 10, 2026 15:28
@a10y a10y requested review from 0ax1 and joseph-isaacs March 10, 2026 15:30
@a10y
Copy link
Contributor Author

a10y commented Mar 10, 2026

Github is throwing another one of its tantrums it seems

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 10, 2026

Merging this PR will improve performance by 12.36%

⚡ 2 improved benchmarks
✅ 998 untouched benchmarks
⏩ 1466 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation map_each[BufferMut<i32>, 128] 858.1 ns 770.6 ns +11.36%
Simulation bitwise_not_vortex_buffer_mut[128] 530.3 ns 471.9 ns +12.36%

Comparing aduffy/device-ptr-fix (0eb716e) with develop (6ff018b)

Open in CodSpeed

Footnotes

  1. 1466 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@robert3005
Copy link
Contributor

I think #6862 might already fix it

@a10y a10y closed this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants