QUDA  1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Namespaces | Macros | Functions
malloc_quda.h File Reference
#include <cstdlib>
#include <cstdint>
#include <enum_quda.h>
Include dependency graph for malloc_quda.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 quda
 
 quda::pool
 

Macros

#define device_malloc(size)   quda::device_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)
 
#define device_pinned_malloc(size)   quda::device_pinned_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)
 
#define safe_malloc(size)   quda::safe_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)
 
#define pinned_malloc(size)   quda::pinned_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)
 
#define mapped_malloc(size)   quda::mapped_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)
 
#define device_free(ptr)   quda::device_free_(__func__, quda::file_name(__FILE__), __LINE__, ptr)
 
#define device_pinned_free(ptr)   quda::device_pinned_free_(__func__, quda::file_name(__FILE__), __LINE__, ptr)
 
#define host_free(ptr)   quda::host_free_(__func__, quda::file_name(__FILE__), __LINE__, ptr)
 
#define pool_device_malloc(size)   quda::pool::device_malloc_(__func__, __FILE__, __LINE__, size)
 
#define pool_device_free(ptr)   quda::pool::device_free_(__func__, __FILE__, __LINE__, ptr)
 
#define pool_pinned_malloc(size)   quda::pool::pinned_malloc_(__func__, __FILE__, __LINE__, size)
 
#define pool_pinned_free(ptr)   quda::pool::pinned_free_(__func__, __FILE__, __LINE__, ptr)
 

Functions

void quda::printPeakMemUsage ()
 
void quda::assertAllMemFree ()
 
long quda::device_allocated_peak ()
 
long quda::pinned_allocated_peak ()
 
long quda::mapped_allocated_peak ()
 
long quda::host_allocated_peak ()
 
void * quda::device_malloc_ (const char *func, const char *file, int line, size_t size)
 
void * quda::device_pinned_malloc_ (const char *func, const char *file, int line, size_t size)
 
void * quda::safe_malloc_ (const char *func, const char *file, int line, size_t size)
 
void * quda::pinned_malloc_ (const char *func, const char *file, int line, size_t size)
 
void * quda::mapped_malloc_ (const char *func, const char *file, int line, size_t size)
 
void quda::device_free_ (const char *func, const char *file, int line, void *ptr)
 
void quda::device_pinned_free_ (const char *func, const char *file, int line, void *ptr)
 
void quda::host_free_ (const char *func, const char *file, int line, void *ptr)
 
constexpr const char * quda::str_end (const char *str)
 
constexpr bool quda::str_slant (const char *str)
 
constexpr const char * quda::r_slant (const char *str)
 
constexpr const char * quda::file_name (const char *str)
 
QudaFieldLocation quda::get_pointer_location (const void *ptr)
 
bool quda::is_aligned (const void *ptr, size_t alignment)
 
void quda::pool::init ()
 Initialize the memory pool allocator. More...
 
void * quda::pool::device_malloc_ (const char *func, const char *file, int line, size_t size)
 Allocate device-memory. If free pre-existing allocation exists reuse this. More...
 
void quda::pool::device_free_ (const char *func, const char *file, int line, void *ptr)
 Virtual free of pinned-memory allocation. More...
 
void * quda::pool::pinned_malloc_ (const char *func, const char *file, int line, size_t size)
 Allocate pinned-memory. If a free pre-existing allocation exists reuse this. More...
 
void quda::pool::pinned_free_ (const char *func, const char *file, int line, void *ptr)
 Virtual free of pinned-memory allocation. More...
 
void quda::pool::flush_device ()
 Free all outstanding device-memory allocations. More...
 
void quda::pool::flush_pinned ()
 Free all outstanding pinned-memory allocations. More...
 

Macro Definition Documentation

◆ device_free

#define device_free (   ptr)    quda::device_free_(__func__, quda::file_name(__FILE__), __LINE__, ptr)

◆ device_malloc

#define device_malloc (   size)    quda::device_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)

◆ device_pinned_free

#define device_pinned_free (   ptr)    quda::device_pinned_free_(__func__, quda::file_name(__FILE__), __LINE__, ptr)

◆ device_pinned_malloc

#define device_pinned_malloc (   size)    quda::device_pinned_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)

Definition at line 65 of file malloc_quda.h.

Referenced by quda::LatticeField::allocateGhostBuffer().

◆ host_free

#define host_free (   ptr)    quda::host_free_(__func__, quda::file_name(__FILE__), __LINE__, ptr)

Definition at line 71 of file malloc_quda.h.

Referenced by quda::LatticeField::allocateGhostBuffer(), quda::RNG::backup(), quda::EigenSolver::blockOrthogonalize(), comm_allreduce(), comm_declare_send_relative_(), comm_declare_strided_send_relative_(), comm_destroy_topology(), comm_free(), comm_init_common(), comm_peer2peer_init(), compute_gauge_force_quda_(), computeHISQLinksCPU(), computeHISQLinksGPU(), quda::TRLM::computeKeptRitz(), quda::EigenSolver::deflate(), quda::EigenSolver::deflateSVD(), quda::cudaColorSpinorField::destroy(), quda::cpuColorSpinorField::destroy(), quda::destroyDslashEvents(), endQuda(), quda::blas::endReduce(), exchange_cpu_sitelink(), exchange_cpu_sitelink_ex(), exchange_cpu_staple(), exchange_llfat_cleanup(), exchange_sitelink_diag(), quda::cpuGaugeField::exchangeExtendedGhost(), quda::cpuGaugeField::exchangeGhost(), quda::cpuColorSpinorField::exchangeGhost(), quda::pool::flush_pinned(), quda::LatticeField::freeGhostBuffer(), quda::cpuColorSpinorField::freeGhostBuffer(), gauge_force_test(), hisq_test(), quda::cpuGaugeField::injectGhost(), llfat_test(), quda::clover::FloatNOrder< Float, length, N, add_rho, huge_alloc >::load(), quda::colorspinor::FloatNOrder< Float, Ns, Nc, N, spin_project, huge_alloc >::load(), quda::gauge::FloatNOrder< Float, length, N, reconLenParam, stag_phase, huge_alloc, ghostExchange_, use_inphase >::load(), quda::EigenSolver::loadVectors(), main(), quda::Object::operator delete(), quda::Object::operator delete[](), quda::pool::pinned_malloc_(), popOutputPrefix(), quda::RNG::restore(), quda::Deflation::saveVectors(), quda::EigenSolver::saveVectors(), unitarize_link_test(), quda::cpuCloverField::~cpuCloverField(), quda::cpuGaugeField::~cpuGaugeField(), quda::cudaGaugeField::~cudaGaugeField(), quda::EigenSolver::~EigenSolver(), quda::Transfer::~Transfer(), and quda::TRLM::~TRLM().

◆ mapped_malloc

#define mapped_malloc (   size)    quda::mapped_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)

◆ pinned_malloc

#define pinned_malloc (   size)    quda::pinned_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)

◆ pool_device_free

#define pool_device_free (   ptr)    quda::pool::device_free_(__func__, __FILE__, __LINE__, ptr)

◆ pool_device_malloc

#define pool_device_malloc (   size)    quda::pool::device_malloc_(__func__, __FILE__, __LINE__, size)

◆ pool_pinned_free

#define pool_pinned_free (   ptr)    quda::pool::pinned_free_(__func__, __FILE__, __LINE__, ptr)

◆ pool_pinned_malloc

#define pool_pinned_malloc (   size)    quda::pool::pinned_malloc_(__func__, __FILE__, __LINE__, size)

◆ safe_malloc

#define safe_malloc (   size)    quda::safe_malloc_(__func__, quda::file_name(__FILE__), __LINE__, size)

Definition at line 66 of file malloc_quda.h.

Referenced by quda::cpuColorSpinorField::allocateGhostBuffer(), quda::RNG::backup(), quda::EigenSolver::blockOrthogonalize(), comm_allreduce(), comm_create_topology(), comm_declare_receive_displaced(), comm_declare_send_displaced(), comm_declare_send_relative_(), comm_declare_strided_receive_displaced(), comm_declare_strided_send_displaced(), comm_declare_strided_send_relative_(), comm_init_common(), comm_peer2peer_init(), compute_gauge_force_quda_(), computeHISQLinksCPU(), quda::TRLM::computeKeptRitz(), quda::cpuCloverField::cpuCloverField(), quda::cpuGaugeField::cpuGaugeField(), quda::cpuColorSpinorField::create(), quda::EigenSolver::deflate(), quda::EigenSolver::deflateSVD(), quda::EigenSolver::EigenSolver(), exchange_cpu_sitelink(), exchange_cpu_sitelink_ex(), exchange_cpu_staple(), exchange_sitelink_diag(), quda::cpuGaugeField::exchangeExtendedGhost(), quda::cpuGaugeField::exchangeGhost(), quda::cpuColorSpinorField::exchangeGhost(), gauge_force_test(), hisq_test(), quda::cpuGaugeField::injectGhost(), llfat_test(), quda::EigenSolver::loadVectors(), main(), quda::Object::operator new(), quda::Object::operator new[](), pushOutputPrefix(), quda::clover::FloatNOrder< Float, length, N, add_rho, huge_alloc >::save(), quda::colorspinor::FloatNOrder< Float, Ns, Nc, N, spin_project, huge_alloc >::save(), quda::gauge::FloatNOrder< Float, length, N, reconLenParam, stag_phase, huge_alloc, ghostExchange_, use_inphase >::save(), quda::Deflation::saveVectors(), quda::EigenSolver::saveVectors(), quda::Transfer::Transfer(), and quda::TRLM::TRLM().