NEURON
memory.h File Reference
#include <cstdint>
#include <cstring>
#include <cstdlib>
#include <memory>
#include "oc/nrnassrt.h"

Go to the source code of this file.

Classes

struct  neuron::unified_allocator< T >
 C++ allocator that uses [de]allocate_unified. More...
 
struct  neuron::alloc_deleter< Alloc >
 Allocator-aware deleter for use with std::unique_ptr. More...
 
class  MemoryManaged
 for gpu builds with unified memory support More...
 

Namespaces

 neuron
 In mechanism libraries, cannot use auto const token = nrn_ensure_model_data_are_sorted(); because the return type is incomplete (from include/neuron/model_data.hpp).
 

Macros

#define NRN_SOA_BYTE_ALIGN   (8 * sizeof(double))
 

Functions

bool neuron::gpu_enabled ()
 Check if GPU support is enabled. More...
 
void * neuron::allocate_unified (std::size_t num_bytes)
 Allocate unified memory in GPU builds iff GPU enabled, otherwise new. More...
 
void neuron::deallocate_unified (void *ptr, std::size_t num_bytes)
 Deallocate memory allocated by allocate_unified. More...
 
template<typename T , typename U >
bool neuron::operator== (unified_allocator< T > const &, unified_allocator< U > const &) noexcept
 
template<typename T , typename U >
bool neuron::operator!= (unified_allocator< T > const &x, unified_allocator< U > const &y) noexcept
 
template<typename T , typename Alloc , typename... Args>
auto neuron::allocate_unique (const Alloc &alloc, Args &&... args)
 
void alloc_memory (void *&pointer, size_t num_bytes, size_t alignment)
 
void calloc_memory (void *&pointer, size_t num_bytes, size_t alignment)
 
void free_memory (void *pointer)
 

Macro Definition Documentation

◆ NRN_SOA_BYTE_ALIGN

#define NRN_SOA_BYTE_ALIGN   (8 * sizeof(double))

Definition at line 26 of file memory.h.

Function Documentation

◆ alloc_memory()

void alloc_memory ( void *&  pointer,
size_t  num_bytes,
size_t  alignment 
)
inline

Definition at line 187 of file memory.h.

◆ calloc_memory()

void calloc_memory ( void *&  pointer,
size_t  num_bytes,
size_t  alignment 
)
inline

Definition at line 208 of file memory.h.

◆ free_memory()

void free_memory ( void *  pointer)
inline

Definition at line 213 of file memory.h.