cwpearson / stencil

A prototype MPI/CUDA stencil communication library
Boost Software License 1.0
10 stars 3 forks source link

Allow custom allocator for DistributedDomain and LocalDomain #2

Open cwpearson opened 4 years ago

cwpearson commented 4 years ago

To allow for easier testing and extension to future CPU-only stencils, we should define a DeviceAllocator and a ManagedAllocator along the lines of http://www.josuttis.com/cppcode/myalloc.hpp, then, modify XxxDomain to use the allocator.

The new declaration would be like

template<typename Alloc = DeviceAllocator<char>>
class LocalDomain {
...
};

A challenge is that the classes derived from HaloSenders currently have a LocalDomain * member, which means they would have to be templated around both Sender and LocalDomain. They can still derive from HaloSender, though, so the DistributedDomain should be okay.

cwpearson commented 4 years ago

Allocators were added in 0749943bd697a187f576a44395aab71e583e7d17