|
openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
|
Allocator structure for dynamically allocating memory on multiple targets. More...
#include <target.h>
Public Types | |
| typedef T | value_type |
| type to allocate More... | |
Public Member Functions | |
| TargetAllocator (Target target, bool always_managed=false) | |
| Construct a TargetAllocator. More... | |
| Target | get_target () const |
| Get the target for this allocator. More... | |
| void | set_target (Target new_target) |
| Set a new target for this allocator. More... | |
| T * | allocate (std::size_t n, bool do_zero=true) |
| Allocate memory for type T. More... | |
| void | deallocate (T *ptr, std::size_t n=0) |
Deallocate memory pointed by ptr. More... | |
Allocator structure for dynamically allocating memory on multiple targets.
This tries to respect the standard C++ allocator trait as much as possible but is not yet used like one.
| typedef T limpet::TargetAllocator< T >::value_type |
|
inline |
Construct a TargetAllocator.
| target | target this allocator will allocate on |
| always_managed | if true, always use managed memory management for GPU targets |
|
inline |
Allocate memory for type T.
| n | number of objects of type T to allocate (size of the array) |
Definition at line 154 of file target.h.
|
inline |
Deallocate memory pointed by ptr.
| ptr | pointer to the memory to deallocate |
| n | size of the memory to deallocate. This is set to 0 by default because it isn't needed for the function to work, but is required to fit with the allocator trait interface. |
Definition at line 250 of file target.h.
|
inline |
|
inline |