Skip to content

Add device guards in pytorch cuda kernels. - #60

Merged
hzhangxyz merged 1 commit into
mainfrom
fix/mismatch-cuda-device-and-stream
Jul 2, 2025
Merged

Add device guards in pytorch cuda kernels.#60
hzhangxyz merged 1 commit into
mainfrom
fix/mismatch-cuda-device-and-stream

Conversation

@hzhangxyz

Copy link
Copy Markdown
Member

Description

Closes: #54

Checklist:

Copilot AI review requested due to automatic review settings July 1, 2025 09:15

This comment was marked as outdated.

@hzhangxyz
hzhangxyz force-pushed the fix/mismatch-cuda-device-and-stream branch from 0c7d6ce to 0479211 Compare July 1, 2025 16:25
@hzhangxyz
hzhangxyz force-pushed the fix/mismatch-cuda-device-and-stream branch from 0479211 to 14d7ac3 Compare July 1, 2025 16:30
@hzhangxyz
hzhangxyz requested review from Copilot and msg-bq and removed request for Copilot July 1, 2025 16:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds CUDA device guards to ensure kernels run on the correct GPU device.

  • Added CUDAGuard header include.
  • Instantiated at::cuda::CUDAGuard in three host functions before launching kernels.

Comment thread qmb/_hamiltonian_cuda.cu
Comment thread qmb/_hamiltonian_cuda.cu
Comment thread qmb/_hamiltonian_cuda.cu
@hzhangxyz

Copy link
Copy Markdown
Member Author

手动at @stevapple @CuSO4Deposit @msg-bq @BrevityD

@hzhangxyz
hzhangxyz merged commit aa7dd73 into main Jul 2, 2025
8 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.

🐛 [BUG] - wrong cuda device in kernel for multiple devices.

3 participants