|
4 | 4 | functions in hydro_cuda.cu. */ |
5 | 5 | #ifdef CUDA |
6 | 6 |
|
| 7 | +#pragma once |
| 8 | + |
7 | 9 | #include <stdio.h> |
8 | | -#include <math.h> |
9 | | -#include "../utils/gpu.hpp" |
10 | | -#include "../global/global.h" |
11 | | -#include "../global/global_cuda.h" |
12 | | -#include "../gravity/gravity_cuda.h" |
| 10 | +#include <math.h> // provides sqrt log cos sin atan etc. |
| 11 | +#include "../global/global.h" // provides GN etc. |
13 | 12 |
|
14 | 13 | // Work around lack of pow(Real,int) in Hip Clang for Rocm 3.5 |
15 | 14 | static inline __device__ Real pow2(const Real x) { return x*x; } |
16 | 15 |
|
17 | | -__device__ void calc_g_1D(int xid, int x_off, int n_ghost, Real dx, Real xbound, Real *gx) |
| 16 | +inline __device__ void calc_g_1D(int xid, int x_off, int n_ghost, Real dx, Real xbound, Real *gx) |
18 | 17 | { |
19 | 18 | Real x_pos, r_disk, r_halo; |
20 | 19 | x_pos = (x_off + xid - n_ghost + 0.5)*dx + xbound; |
@@ -52,7 +51,7 @@ __device__ void calc_g_1D(int xid, int x_off, int n_ghost, Real dx, Real xbound, |
52 | 51 | } |
53 | 52 |
|
54 | 53 |
|
55 | | -__device__ void calc_g_2D(int xid, int yid, int x_off, int y_off, int n_ghost, Real dx, Real dy, Real xbound, Real ybound, Real *gx, Real *gy) |
| 54 | +inline __device__ void calc_g_2D(int xid, int yid, int x_off, int y_off, int n_ghost, Real dx, Real dy, Real xbound, Real ybound, Real *gx, Real *gy) |
56 | 55 | { |
57 | 56 | Real x_pos, y_pos, r, phi; |
58 | 57 | // use the subgrid offset and global boundaries to calculate absolute positions on the grid |
@@ -108,7 +107,7 @@ __device__ void calc_g_2D(int xid, int yid, int x_off, int y_off, int n_ghost, R |
108 | 107 | } |
109 | 108 |
|
110 | 109 |
|
111 | | -__device__ void calc_g_3D(int xid, int yid, int zid, int x_off, int y_off, int z_off, int n_ghost, Real dx, Real dy, Real dz, Real xbound, Real ybound, Real zbound, Real *gx, Real *gy, Real *gz) |
| 110 | +inline __device__ void calc_g_3D(int xid, int yid, int zid, int x_off, int y_off, int z_off, int n_ghost, Real dx, Real dy, Real dz, Real xbound, Real ybound, Real zbound, Real *gx, Real *gy, Real *gz) |
112 | 111 | { |
113 | 112 | Real x_pos, y_pos, z_pos, r_disk, r_halo; |
114 | 113 | // use the subgrid offset and global boundaries to calculate absolute positions on the grid |
|
0 commit comments