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

Implement slab transport contribution on the GPU #2

Closed
tlestang opened this issue Apr 14, 2023 · 0 comments
Closed

Implement slab transport contribution on the GPU #2

tlestang opened this issue Apr 14, 2023 · 0 comments
Labels
core Issue affecting core mechanisms of the software cuda Related to CUDA backend

Comments

@tlestang
Copy link
Collaborator

tlestang commented Apr 14, 2023

Slab transport is evaluating the contribution to the transport term coming from derivatives along a single direction. Considering a slab of data in the $j$-orientation, we want to compute

$$u_i * \frac{\partial u_i}{\partial x_j} + \frac{\partial u_i u_j}{\partial x_j} + \nu \frac{\partial^2 u_i}{\partial x_j}$$$

Implementation of slab transport can then split into three steps:

  1. Add a new cuda_diffengine_t derived type providing a diff bound procedure executing a cuda kernel performing the differentiation (Implement differentiation on the GPU #3).
  2. Compute and combine derivatives into a transport_dir bound procedure on the cuda slab.
  3. Implement the top level transport bound procedure on the cuda slab type.

Although the GPU implementation might eventually differ from the CPU implementation for performance reasons (e.g. computation of all derivatives and their sum within a single CUDA kernel), I suggest that the first working version follows the CPU implementation closely.

Just like the diffengine_t type is responsible for instanciating a tridiagonal solver from the bulk and boundary differentiation schemes, the cuda_diffengine_t could hold device arrays and stencil instances for the thomas solver coefficeints and stencil, respectively. These device objects could be initialised from host code before calling the differentatiation kernel.

@tlestang tlestang added core Issue affecting core mechanisms of the software cuda Related to CUDA backend labels Apr 14, 2023
@semi-h semi-h closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issue affecting core mechanisms of the software cuda Related to CUDA backend
Projects
None yet
Development

No branches or pull requests

2 participants