Gromacs
2024.3
|
#include <gromacs/gpu_utils/clfftinitializer.h>
Handle clFFT library init and tear down in RAII style also with mutual exclusion.
Only one thread per process needs to attempt to set up and tear down the clFFT library, but this wrapper object ensures that it is safe to do so more than once, or from any thread. It is the responsibility of the caller to ensure that no use of the clFFT library is made before making an object of this type, or after the first such object is destroyed. If no more objects remain to be destroyed, then it is safe to create another and resume clFFT work.
Public Member Functions | |
ClfftInitializer () | |
Constructor. More... | |
~ClfftInitializer () | |
Destructor. | |
GMX_DISALLOW_COPY_AND_ASSIGN (ClfftInitializer) | |
gmx::ClfftInitializer::ClfftInitializer | ( | ) |
Constructor.
This initializers the clFFT library if there is a possibility of an FFT task on the device, and preserves it until destruction. Any time required for this initialization or tear down should not be accrued to per-MD-step counters.