IPPL-framework / ippl

IPPL is a C++ library to develop performance portable code for fully Eulerian, Lagrangian or hybrid Eulerian-Lagrangian methods.
https://ippl-framework.github.io/ippl/
GNU General Public License v3.0
20 stars 20 forks source link

Refactor FFTs #179

Open matt-frey opened 1 year ago

matt-frey commented 1 year ago

In GitLab by @vinciguerra_a on Jun 27, 2023, 14:45

Prior profiling has shown that memory allocations in CUDA are slow. The memory overhead was significantly reduced in !97, but the FFTs continue to create temporary views for heFFTe. These should instead be converted to member variables such that the memory can be reused. Only the dimensions are relevant, so the same view could be reused even for different input fields, as long as the dimensions match. This would drastically reduce time lost to cudaFree calls (on the order of 10ms per FFT transform).

There is a lot of repeated code across the FFT specializations. They should inherit from a common base class (templated on the FFT backend) to drastically reduce code duplication. The sine and cosine transformations share even more code and can be unified further than the other transformations.

The transformation directions should be replaced with enum constants to statically enforce their validity and provide semantic clarity.

matt-frey commented 1 year ago

In GitLab by @vinciguerra_a on Jul 7, 2023, 11:14

marked the task Reuse temporary fields as completed

matt-frey commented 1 year ago

In GitLab by @vinciguerra_a on Jul 7, 2023, 11:14

marked the task Reduce code duplication as completed

matt-frey commented 1 year ago

In GitLab by @vinciguerra_a on Jul 7, 2023, 11:14

marked the task Common base functions for all FFTs as completed

matt-frey commented 1 year ago

In GitLab by @vinciguerra_a on Jul 14, 2023, 15:46

marked the task Replace ±1 literals for FFT transforms with enums as completed

matt-frey commented 1 year ago

In GitLab by @vinciguerra_a on Jul 24, 2023, 07:54

marked the task Reuse FFT object in solvers where possible as completed