Flow123d  release_2.2.0-37-g336ee74
Classes | Macros | Typedefs | Functions
memory.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <vector>
#include <chrono>
#include <iostream>
#include <fstream>
#include <stdarg.h>
#include "libs/json.hpp"

Go to the source code of this file.

Classes

class  Timer
 

Macros

#define KB   1024
 
#define MB   1048576
 
#define REP   (MB * 3)
 
#define OFFSET   256
 
#define ARR_SIZE   (MB * 100)
 
#define GIGA   1.0e+9
 
#define MEGA   1.0e+6
 
#define KILO   1.0e+3
 
#define MILI   1.0e-3
 
#define MICRO   1.0e-6
 
#define NANO   1.0e-9
 
#define CHAR_SIZE   sizeof(char)
 
#define INT_SIZE   sizeof(int)
 
#define SHOW_DURATION   true
 
#define SHOW_DETAILS   true
 

Typedefs

using json = nlohmann::json
 

Functions

void printf_debug (const char *fmt,...)
 
void cpu_test (json &results, int repetition=REP)
 
template<int N, int M>
void cpu_test_r (json &results, int(&arr)[M], int(&sizes)[N], int repetition=REP)
 
template<int N, int M>
void cpu_test_w (json &results, int(&arr)[M], int(&sizes)[N], int repetition=REP)
 
template<int N, int M>
void cpu_test_rw (json &results, int(&arr)[M], int(&sizes)[N], int repetition=REP)
 
template<int N>
void io_test_rw (json &results, int(&sizes)[N], int file_size, const int buffer_size=1 *MB)
 
void io_test_many (json &results, int no_files=KILO)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

#define ARR_SIZE   (MB * 100)

Definition at line 15 of file memory.cc.

#define CHAR_SIZE   sizeof(char)

Definition at line 24 of file memory.cc.

#define GIGA   1.0e+9

Definition at line 17 of file memory.cc.

#define INT_SIZE   sizeof(int)

Definition at line 25 of file memory.cc.

#define KB   1024

Definition at line 11 of file memory.cc.

#define KILO   1.0e+3

Definition at line 19 of file memory.cc.

#define MB   1048576

Definition at line 12 of file memory.cc.

#define MEGA   1.0e+6

Definition at line 18 of file memory.cc.

#define MICRO   1.0e-6

Definition at line 21 of file memory.cc.

#define MILI   1.0e-3

Definition at line 20 of file memory.cc.

#define NANO   1.0e-9

Definition at line 22 of file memory.cc.

#define OFFSET   256

Definition at line 14 of file memory.cc.

#define REP   (MB * 3)

Definition at line 13 of file memory.cc.

#define SHOW_DETAILS   true

Definition at line 28 of file memory.cc.

#define SHOW_DURATION   true

Definition at line 27 of file memory.cc.

Typedef Documentation

Definition at line 31 of file memory.cc.

Function Documentation

void cpu_test ( json results,
int  repetition = REP 
)

Definition at line 58 of file memory.cc.

Here is the caller graph for this function:

template<int N, int M>
void cpu_test_r ( json results,
int(&)  arr[M],
int(&)  sizes[N],
int  repetition = REP 
)

Definition at line 85 of file memory.cc.

Here is the caller graph for this function:

template<int N, int M>
void cpu_test_rw ( json results,
int(&)  arr[M],
int(&)  sizes[N],
int  repetition = REP 
)

Definition at line 154 of file memory.cc.

Here is the caller graph for this function:

template<int N, int M>
void cpu_test_w ( json results,
int(&)  arr[M],
int(&)  sizes[N],
int  repetition = REP 
)

Definition at line 120 of file memory.cc.

Here is the caller graph for this function:

void io_test_many ( json results,
int  no_files = KILO 
)

Definition at line 262 of file memory.cc.

Here is the caller graph for this function:

template<int N>
void io_test_rw ( json results,
int(&)  sizes[N],
int  file_size,
const int  buffer_size = 1 * MB 
)

Definition at line 188 of file memory.cc.

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Start benchmark, usage: optional <output> file: will create json file output with results optional <scale> float: scales repetition count for benchmark default is 1, for example value 2 will run tests twice as many times, value 0.5 will experiments half as many times

Definition at line 335 of file memory.cc.

void printf_debug ( const char *  fmt,
  ... 
)

Definition at line 48 of file memory.cc.

Here is the caller graph for this function: