![]() |
GHOST
1.1.2
General, Hybrid, and Optimized Sparse Toolkit
|
#include "ghost/util.h"
#include "ghost/log.h"
#include "ghost/constants.h"
#include <stdarg.h>
#include <stdlib.h>
#include <errno.h>
Macros | |
#define | _GNU_SOURCE |
#define | PRINTWIDTH 80 |
#define | LABELWIDTH 40 |
#define | HEADERHEIGHT 3 |
#define | FOOTERHEIGHT 1 |
#define | PRINTSEP ":" |
#define | VALUEWIDTH (PRINTWIDTH-LABELWIDTH-(int)strlen(PRINTSEP)) |
#define | MAXVALUELEN 1024 |
Functions | |
ghost_error | ghost_header_string (char **str, const char *fmt,...) |
ghost_error | ghost_footer_string (char **str) |
ghost_error | ghost_line_string (char **str, const char *label, const char *unit, const char *fmt,...) |
ghost_error | ghost_malloc (void **mem, const size_t size) |
Allocate memory. More... | |
ghost_error | ghost_malloc_pinned (void **mem, const size_t size) |
Allocate pinned memory to enable fast CPU-GPU transfers. More... | |
ghost_error | ghost_malloc_align (void **mem, const size_t size, const size_t align) |
Allocate aligned memory. More... | |
#define _GNU_SOURCE |
#define FOOTERHEIGHT 1 |
#define HEADERHEIGHT 3 |
#define LABELWIDTH 40 |
#define MAXVALUELEN 1024 |
#define PRINTSEP ":" |
#define PRINTWIDTH 80 |
#define VALUEWIDTH (PRINTWIDTH-LABELWIDTH-(int)strlen(PRINTSEP)) |
ghost_error ghost_footer_string | ( | char ** | str | ) |
ghost_error ghost_header_string | ( | char ** | str, |
const char * | fmt, | ||
... | |||
) |
ghost_error ghost_line_string | ( | char ** | str, |
const char * | label, | ||
const char * | unit, | ||
const char * | fmt, | ||
... | |||
) |
ghost_error ghost_malloc | ( | void ** | mem, |
const size_t | size | ||
) |
Allocate memory.
mem | Where to store the allocated memory. |
size | The size (in bytes) to allocate. |
ghost_error ghost_malloc_align | ( | void ** | mem, |
const size_t | size, | ||
const size_t | align | ||
) |
Allocate aligned memory.
mem | Where to store the allocated memory. |
size | The size (in bytes) to allocate. |
align | The alignment size. |
ghost_error ghost_malloc_pinned | ( | void ** | mem, |
const size_t | size | ||
) |
Allocate pinned memory to enable fast CPU-GPU transfers.
mem | Where to store the allocated memory. |
size | The size (in bytes) to allocate. |
If CUDA is not enabled, a normal malloc is done.