Add GPU backend selection with load_cuda(), load_metal(), load_amdgpu(), load_oneapi() - #23
Merged
cncastillo merged 9 commits intoJul 31, 2026
Conversation
cncastillo
requested changes
Jul 29, 2026
cncastillo
left a comment
Member
There was a problem hiding this comment.
Just minor comments.
Do you have some "evidence" that this works? maybe add a screenshot of a succesful run using your pc or ultron.
I would also add one line showing km.load_cuda() to the README.
…ghal/komamripy into gpu-backend-selection
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Enables GPU backend selection in komamripy, mirroring KomaMRI.jl's package extension system exactly. Users can now load CUDA, Metal, AMDGPU, or oneAPI backends to enable GPU acceleration with a single function call. Addresses JuliaHealth/KomaMRI.jl#736.
Included
src/komamripy/_backends.py(new)using CUDA-> Python:km.load_cuda()using Metal-> Python:km.load_metal()using AMDGPU-> Python:km.load_amdgpu()using oneAPI-> Python:km.load_oneapi()Each function calls
jl.seval()to load the corresponding Julia GPU package into the Julia session.src/komamripy/__init__.py(modified)examples/gpu_backend_selection_example.py(new)test_integration_examples.pyDetails
No Python-side state management needed, Julia handles backend detection and defaulting.