-
Notifications
You must be signed in to change notification settings - Fork 1
add cuda context #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/qgpu
Are you sure you want to change the base?
add cuda context #65
Conversation
There was a problem hiding this comment.
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 introduces a centralized CudaContext singleton class to manage GPU memory allocations across all CUDA kernels, replacing the previous per-module memory management approach. The refactoring consolidates device memory pointers into a single context object and introduces initialization functions (init_*_kernel_data()) to separate per-kernel data from shared context data.
Key Changes:
- Introduces
CudaContextsingleton class to centralize GPU memory management - Replaces per-module device memory allocations with shared context pointers
- Adds
init_cuda_kernel_data()function to initialize all kernel-specific data - Updates nonbonded force calculations to use new
_v2versions - Adds
check_cuda()helper function for CUDA error checking - Converts header guards from
#ifndefto#pragma once
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/cuda/include/CudaContext.cuh | New singleton class declaration with all shared GPU memory pointers |
| src/core/cuda/src/CudaContext.cu | Implementation of context initialization, synchronization, and cleanup |
| src/core/utils.h | Added check_cuda() function declaration for error handling |
| src/core/utils.cu | Added check_cuda() implementation for CUDA error checking |
| src/core/system.cu | Integrated context initialization, added init_cuda_kernel_data(), updated nonbonded force calls to _v2 versions |
| src/core/cuda/src/Cuda*Force.cu | Refactored 15+ force calculation modules to use CudaContext instead of local allocations |
| src/core/cuda/include/Cuda*.cuh | Updated headers to use #pragma once and added init_*_kernel_data() declarations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 47 out of 47 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| ccharge_t* d_ccharges; | ||
| charge_t *d_charges; | ||
| p_atom_t *d_p_atoms; |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolons after the member variable declarations. In C++, class member declarations require semicolons at the end. Lines 104-106 are missing semicolons.
No description provided.