-
Notifications
You must be signed in to change notification settings - Fork 11
Temporary memory
System offers an cached allocator (a pool allocator) as defined in [1]. Allocations using this allocator will be cached so that if the same number of bytes is requested/freed several times only the first request will result in an actual cudaMalloc and only the last free will result in an actual cudaFree.
System provides two aliases for convenience:
template<class T>
using System::allocator<T> = polymorphic_allocator<T, pool_memory_resource_adaptor<device_memory_resource>>;
template<class T>
using System::allocator_thrust<T> = polymorphic_allocator<T, pool_memory_resource_adaptor<device_memory_resource>, thrust::cuda::pointer<T>>;
If UAMMD_DEBUG is defined then System will use managed_memory_resource, which makes memory allocated with System::allocator be seamlessly accessible from the CPU and GPU.
Both do the same thing as described, but the second one provides thrust::pointers instead of regular pointers, so that it can be used with thrust::device_vector like this:
template<class T>
using cached_vector<T> = thrust::device_vector<T, System::allocator_thrust<T>>;
int main(){
cached_vector<int> vec(100); //Results in a cudaMalloc of 100*sizeof(int) bytes
vec.clear(); //Does not result in a cudaFree
cached_vector<int> vec1(100); //Requests 100*sizeof(int) bytes and gets handed the pointer vec just freed
return 0;
} //The memory is freed at some unspecified point
This construction is useful when a certain algorithm needs some GPU memory buffer
-
-
1. PairForces
2. NbodyForces
3. ExternalForces
4. BondedForces
5. AngularBondedForces
6. TorsionalBondedForces
7. Poisson (Electrostatics) -
-
MD (Molecular Dynamics)
1. VerletNVT
2. VerletNVE - BD Brownian Dynamics
-
BDHI Brownian Dynamics with Hydrodynamic Interactions
1. EulerMaruyama
1.1 BDHI_Cholesky Brownian displacements through Cholesky factorization.
1.2 BDHI_Lanczos Brownian displacements through Lanczos algorithm.
1.3 BDHI_PSE Positively Split Edwald.
1.4 BDHI_FCM Force Coupling Method. - DPD Dissipative Particle Dynamics
- SPH Smoothed Particle Hydrodynamics
-
Hydrodynamics
1. ICM Inertial Coupling Method.
2. FIB Fluctuating Immerse Boundary.
3. Quasi2D Quasi2D hydrodynamics
-
MD (Molecular Dynamics)
-
- 1. Neighbour Lists
-
1. Programming Tools
2. Utils
-
1. Transverser
2. Functor
3. Potential
-
1. Particle Data
2. Particle Group
3. System
4. Parameter updatable
-
1. Tabulated Function
2. Postprocessing tools
3. InputFile
4. Tests
5. Allocator
6. Temporary memory
7. Immersed Boundary (IBM)
-
1. NBody
2. Neighbour Lists
3. Python wrappers
- 1. Superpunto