34 const std::string &
name,
36 const std::string &type,
37 const bool accumulate =
false);
47 const std::string &name_in,
49 const bool accumulate =
false
52#if defined(__CUDA) || defined(__ROCM)
64 static double record_gpu(
const std::string &
class_name,
65 const std::string &
name,
67 const std::string &type,
68 const bool accumulate =
false);
77 static void record_gpu(
78 const std::string &name_in,
80 const bool accumulate =
false
97 static void finish(std::ofstream &ofs);
104 static void print_all(std::ofstream &ofs);
106 static void print(
const std::string&
name,
double size_mb);
116 static double calculate_mem(
const long &n,
const std::string &type);
127#if defined(__CUDA) || defined(__ROCM)
128 static double total_gpu;
129 static std::string *name_gpu;
130 static std::string *class_name_gpu;
131 static double *consume_gpu;
132 static int n_now_gpu;
133 static bool init_flag_gpu;
static bool init_flag
Definition memory_recorder.h:125
static double & get_total(void)
Definition memory_recorder.h:85
static double total
Definition memory_recorder.h:119
static int n_now
Definition memory_recorder.h:124
static bool is_initialized(void)
Whether the record tables are currently allocated. record() allocates them on first use and finish() ...
Definition memory_recorder.h:92
static int bool_memory
Definition memory_recorder.h:139
static int float_memory
Definition memory_recorder.h:141
static int n_memory
Definition memory_recorder.h:123
static int short_memory
Definition memory_recorder.h:140
static void print(const std::string &name, double size_mb)
Definition memory_recorder.cpp:343
Memory()
Definition memory_recorder.cpp:44
~Memory()
Definition memory_recorder.cpp:48
static int complex_matrix_memory
Definition memory_recorder.h:136
static int double_memory
Definition memory_recorder.h:137
static std::string * name
Definition memory_recorder.h:120
static double calculate_mem(const long &n, const std::string &type)
Calculate memory requirements for various types of data.
Definition memory_recorder.cpp:52
static void print_all(std::ofstream &ofs)
Print memory consumed (> 1 MB) in a file.
Definition memory_recorder.cpp:373
static int int_memory
Definition memory_recorder.h:138
static void finish(std::ofstream &ofs)
Definition memory_recorder.cpp:351
static double record(const std::string &class_name, const std::string &name, const long &n, const std::string &type, const bool accumulate=false)
Record memory consumed during computation.
Definition memory_recorder.cpp:107
static std::string * class_name
Definition memory_recorder.h:121
static double * consume
Definition memory_recorder.h:122
Definition clebsch_gordan_coeff.cpp:8