Summary
The UNESCO equation of state (density from T/S/P) runs on GPU with 18x speedup and max relative error 2.38e-07. Each ocean grid point is independent — one thread per point.
Benchmark (RTX 3060)
| Points |
CPU |
GPU |
Speedup |
Max Rel Error |
| 1M |
2 ms |
0.109 ms |
18.3x |
2.38e-07 |
| 5M |
6 ms |
0.427 ms |
14.0x |
2.38e-07 |
| 10M |
12 ms |
1.02 ms |
11.8x |
2.38e-07 |
Zero NaN, zero failures. The polynomial evaluation is simple arithmetic per point.
Also Tested: triDiagTS Vertical Mixing
The implicit vertical mixing tridiagonal solver (triDiagTS) was also tested but only achieved 1.5x speedup due to the large per-column data structure (75 levels x 5 arrays). This would need an Array-of-Structs to Struct-of-Arrays transformation for better GPU performance.
Code
https://github.com/consigcody94/noaa-gpu-kernels/tree/main/ocean/mom6
Summary
The UNESCO equation of state (density from T/S/P) runs on GPU with 18x speedup and max relative error 2.38e-07. Each ocean grid point is independent — one thread per point.
Benchmark (RTX 3060)
Zero NaN, zero failures. The polynomial evaluation is simple arithmetic per point.
Also Tested: triDiagTS Vertical Mixing
The implicit vertical mixing tridiagonal solver (triDiagTS) was also tested but only achieved 1.5x speedup due to the large per-column data structure (75 levels x 5 arrays). This would need an Array-of-Structs to Struct-of-Arrays transformation for better GPU performance.
Code
https://github.com/consigcody94/noaa-gpu-kernels/tree/main/ocean/mom6