Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_plot.c
Go to the documentation of this file.
1#include "arax_plot.h"
2#include "arax_pipe.h"
3#include "arax_ptr.h"
4#include "../alloc/alloc.h"
5#include <string.h>
6
7uint64_t* arax_plot_register_metric(const char *name, uint64_t *metric)
8{
10
11 if (metric)
13 else
14 metric = arch_alloc_allocate(&(vpipe->allocator), sizeof(*metric));
15
16 char *vname = arch_alloc_allocate(&(vpipe->allocator), strlen(name) + 1);
17
18 strcpy(vname, name);
19
20 utils_kv_set(&(vpipe->metrics_kv), vname, metric);
21
22 return metric;
23}
struct arax_pipe arax_pipe_s
void * arch_alloc_allocate(arch_alloc_s *alloc, size_t size)
#define arax_assert(EXPR)
Definition arax_assert.h:7
arax_pipe_s * vpipe
Definition impl.c:17
int arax_ptr_valid(const void *ptr)
Definition arax_ptr.c:4
uint64_t * arax_plot_register_metric(const char *name, uint64_t *metric)
Definition arax_plot.c:7
void utils_kv_set(utils_kv_s *kv, void *key, void *value)
Definition Kv.c:11
arax_pipe_s * arax_init()
Definition impl.c:132