WaveRadar Simulation Computational Workload
Source-level computational workload of the GPU ocean simulation.
Overview
1. FFT Workload
Number of FFT stages
For an FFT of size \(N\), the number of stages in one dimension is:
A two-dimensional FFT performs the transform once in each dimension:
The simulation performs three separate IFFTs:
- Height
- X displacement
- Z displacement
FFT Butterfly Operations
Each active FFT thread performs one butterfly operation. A butterfly combines two complex values.
The number of butterfly operations in one complete two-dimensional IFFT is:
Since the simulation performs three IFFTs:
2. FFT Mathematics
Complex multiplication
The shader implements complex multiplication as:
This requires:
- 4 multiplications
- 2 additions/subtractions
Twiddle factor
Butterfly
Therefore one butterfly contains:
- 4 multiplications
- 6 additions/subtractions
- 1 division
-
1
sin() -
1
cos()
3. WaveRadar Spectrum Construction
The WaveRadar data contains:
frequency/direction bins.
Wave amplitude
Phase
Fourier coefficient
Wavenumber
Wave direction
4. Horizontal Displacement
The rotated Fourier coefficient is scaled by the wave direction and configured horizontal choppiness:
5. Surface Normals
The normal kernel calculates spatial derivatives using central differences.
The surface tangents are:
The surface normal is:
6. Foam Mathematics
Jacobian
Jacobian determinant
Compression
Generated foam
Foam decay
Persistent foam
7. Computational Operation Summary
sin(), cos(),
sqrt(), exp() and
normalize() may compile into multiple
hardware instructions.
FFT
| Operation | Per butterfly | Per frame | Per second |
|---|---|---|---|
| Multiplications | 4 | ||
| Additions / subtractions | 6 | ||
| Divisions | 1 | ||
sin()
|
1 | ||
cos()
|
1 |
Spectrum Construction
| Operation | Per frame | Per second |
|---|---|---|
| WaveRadar bins | ||
sqrt()
|
||
sin()
|
||
cos()
|
||
| Atomic additions |
Kernel Workload
| Kernel | Threads / frame | Threads / second |
|---|---|---|
| Clear spectrum accumulation | ||
| Build spectrum | ||
| Height conversion | ||
| Displacement conversion | ||
| Bit reversal | ||
| Normals | ||
| Foam |
8. Final Computational Estimate
Explicit Arithmetic Operations
This is the source-level arithmetic count from the explicitly counted FFT and spectrum operations.
Estimated Arithmetic Operations Per Second
Calculated as:
This is a source-level estimate and should not be interpreted as an exact GPU instruction count or FLOP measurement.
Complete Operation Category Summary
| Category | Per frame | Per second |
|---|---|---|
| FFT multiplications | ||
| FFT additions / subtractions | ||
| FFT divisions | ||
FFT sin()
|
||
FFT cos()
|
||
Spectrum sqrt()
|
||
Spectrum sin()
|
||
Spectrum cos()
|
||
| Atomic additions | ||
| Normal kernel threads | ||
| Foam kernel threads |