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.
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
A challenge is that the classes derived from HaloSenders currently have a
LocalDomain *
member, which means they would have to be templated around bothSender
andLocalDomain
. They can still derive fromHaloSender
, though, so theDistributedDomain
should be okay.