Skip to content
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

Reorganize the CUDA code #519

Merged
merged 6 commits into from
Mar 19, 2024
Merged

Reorganize the CUDA code #519

merged 6 commits into from
Mar 19, 2024

Conversation

jeremykubica
Copy link
Contributor

Reorganize the CUDA code by moving the CUDA functions into a kernels subdirectory (with the appropriate change to CMakeLists.txt) and changing how memory management is wrapped for the other C++ functions. Specifically:

  • Remove the type specific functions, such as move_floats_to_gpu
  • Add thin wrapper on the CUDA functions for void* pointers only (e.g. allocate_gpu_block). Put these in their own file kernel_memory.cu with a corresponding header file.
  • Add a new templated class for handling types like float or Trajectory. The GPUArray class handles allocating space on the GPU, freeing space on the GPU (including an auto free when the array object is destroyed), and transferring data between the CPU and GPU.

@jeremykubica jeremykubica requested a review from wilsonbb March 12, 2024 19:45
Copy link
Collaborator

@wilsonbb wilsonbb left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me, but am not as familiar with CUDA and this part of the code so there may be something subtle I"m missing. Up to you if you want to wait for @maxwest-uw to have a pass at reviewing as well

@jeremykubica jeremykubica requested a review from maxwest-uw March 18, 2024 19:23
@jeremykubica
Copy link
Contributor Author

Thanks @wilsonbb. I will have @maxwest-uw take a look as well.

@jeremykubica jeremykubica merged commit 92ac125 into main Mar 19, 2024
2 checks passed
@jeremykubica jeremykubica deleted the cuda_reorg branch March 19, 2024 11:59
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