Skip to content

Hackathon project08: Preserve moved array storage in VoxelsOnCartesianGrid for CUDA-managed images#1693

Merged
KrisThielemans merged 7 commits intoUCL:masterfrom
Dimitra-Kyriakopoulou:Hackathon_Project08
Mar 12, 2026
Merged

Hackathon project08: Preserve moved array storage in VoxelsOnCartesianGrid for CUDA-managed images#1693
KrisThielemans merged 7 commits intoUCL:masterfrom
Dimitra-Kyriakopoulou:Hackathon_Project08

Conversation

@Dimitra-Kyriakopoulou
Copy link
Contributor

@Dimitra-Kyriakopoulou Dimitra-Kyriakopoulou commented Mar 12, 2026

This PR is PART of Hackathon Project 8: update STIR data to CUDA managed pointers, then adapt sirf.STIR data-containers (images first) and expose the underlying CUDA managed pointer to Python. This PR contains the STIR part of that work. The companion SIRF changes are in the fork under Dimitra-Kyriakopoulou/SIRF on branch Hackathon_Project8, and the runnable end-to-end benchmark is in the separate repository Dimitra-Kyriakopoulou/hackathon_project_08_stir_cuda_managed_pointers.

Changes in this pull request

  • VoxelsOnCartesianGrid now preserves moved array storage instead of forcing the storage through the old copy path during image construction.
  • This is the low-level STIR change needed so that managed-memory-backed image data can survive the STIR container construction path.
  • The scope is intentionally narrow and standalone at STIR level.

Role

  • Project 8 is not only about a Python handle; it first needs STIR image containers to stop losing the managed-memory storage.
  • Without this change, the managed pointer path breaks before SIRF/Python can expose it.

Testing performed

  • These are targeted CUDA validation probes, not yet integrated into the permanent STIR ctest suite.
  • managed_array_probe.cu: verifies that cudaMallocManaged-backed storage can be wrapped by stir::Array<3,float>, updated, and read back correctly.
  • managed_voxels_probe.cu: verifies the same for stir::VoxelsOnCartesianGrid.
  • managed_voxels_sptr_probe.cu: verifies the actual patch point, namely that the VoxelsOnCartesianGrid construction/shared-pointer path preserves the managed storage instead of copying it away.

Related issues

Checklist before requesting a review

  • [] I have performed a self-review of my code
  • [] I have added docstrings/doxygen in line with the guidance in the developer guide
  • [] I have implemented unit tests that cover any new or modified functionality (if applicable)
  • The code builds and runs on my machine
  • [] documentation/release_XXX.md has been updated with any functionality change (if applicable)

Contribution Notes

Please tick the following:

  • [ x] The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in STIR (the Work) under the terms and conditions of the Apache-2.0 License.
  • I (or my institution) have signed the STIR Contribution License Agreement (not required for small changes).

Copy link
Collaborator

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

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

merging master first, but looks good.

@Dimitra-Kyriakopoulou
Copy link
Contributor Author

Dear Professor @KrisThielemans,
THANK YOU WHOLEHEARTEDLY!!!
Dimitra

fix to version 1.*

[actions skip]
@KrisThielemans
Copy link
Collaborator

appveyor fix to use libparallelproj=1 (as opposed to skipping it), pending #1689

@KrisThielemans KrisThielemans merged commit 5ec2cbe into UCL:master Mar 12, 2026
1 of 2 checks passed
@KrisThielemans KrisThielemans deleted the Hackathon_Project08 branch March 12, 2026 15:58
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.

3 participants