#include <string.h>
#include "core/core.h"
#include "core/ppm_xfuncs.h"
#include "xt_gpu.h"
Go to the source code of this file.
|
static void * | default_malloc (size_t alloc_size, enum xt_memtype memtype) |
|
static void | default_free (void *ptr, enum xt_memtype memtype) |
|
static void | default_memcpy (void *dst, void const *src, size_t buffer_size, enum xt_memtype dst_memtype, enum xt_memtype src_memtype) |
|
static enum xt_memtype | default_get_memtype (const void *ptr) |
|
static int | default_instr_push (char const *) |
|
static int | default_instr_pop (void) |
|
void | xt_gpu_init (void) |
|
static int | default_instr_push (char const *XT_UNUSED(name)) |
|
void * | xt_gpu_malloc (size_t alloc_size, enum xt_memtype memtype) |
|
void | xt_gpu_free (void *ptr, enum xt_memtype memtype) |
|
void | xt_gpu_memcpy (void *dst, void const *src, size_t buffer_size, enum xt_memtype dst_memtype, enum xt_memtype src_memtype) |
|
enum xt_memtype | xt_gpu_get_memtype (const void *ptr) |
|
int | xt_gpu_instr_push (char const *name) |
|
int | xt_gpu_instr_pop (void) |
|
◆ CHECK_FOR_HOST_MEM
#define CHECK_FOR_HOST_MEM |
( |
|
type | ) |
|
Value: do { \
Xt_abort( \
Xt_default_comm, \
"ERROR(" STR(__func__)
"): unsupported memory type", \
} \
} while (0)
static const char filename[]
Definition at line 140 of file xt_gpu.c.
◆ STR
◆ default_free()
static void default_free |
( |
void * |
ptr, |
|
|
enum xt_memtype |
memtype |
|
) |
| |
|
static |
◆ default_get_memtype()
static enum xt_memtype default_get_memtype |
( |
const void * |
ptr | ) |
|
|
static |
◆ default_instr_pop()
static int default_instr_pop |
( |
void |
| ) |
|
|
static |
◆ default_instr_push() [1/2]
static int default_instr_push |
( |
char const * |
| ) |
|
|
static |
◆ default_instr_push() [2/2]
static int default_instr_push |
( |
char const * |
XT_UNUSEDname | ) |
|
|
static |
◆ default_malloc()
static void * default_malloc |
( |
size_t |
alloc_size, |
|
|
enum xt_memtype |
memtype |
|
) |
| |
|
static |
◆ default_memcpy()
static void default_memcpy |
( |
void * |
dst, |
|
|
void const * |
src, |
|
|
size_t |
buffer_size, |
|
|
enum xt_memtype |
dst_memtype, |
|
|
enum xt_memtype |
src_memtype |
|
) |
| |
|
static |
◆ xt_gpu_free()
void xt_gpu_free |
( |
void * |
ptr, |
|
|
enum xt_memtype |
memtype |
|
) |
| |
frees memory that was previously allocated using xt_gpu_malloc
- Parameters
-
[in] | ptr | pointer to be freed |
[in] | memtype | type memory associated to ptr |
Definition at line 187 of file xt_gpu.c.
◆ xt_gpu_get_memtype()
enum xt_memtype xt_gpu_get_memtype |
( |
const void * |
ptr | ) |
|
determines the type of memory associated with the provided pointer
- Parameters
-
[in] | ptr | pointer to be checked |
- Returns
- type of memory associated to ptr
Definition at line 197 of file xt_gpu.c.
◆ xt_gpu_init()
void xt_gpu_init |
( |
void |
| ) |
|
◆ xt_gpu_instr_pop()
int xt_gpu_instr_pop |
( |
void |
| ) |
|
◆ xt_gpu_instr_push()
int xt_gpu_instr_push |
( |
char const * |
name | ) |
|
◆ xt_gpu_malloc()
void * xt_gpu_malloc |
( |
size_t |
alloc_size, |
|
|
enum xt_memtype |
memtype |
|
) |
| |
allocates memory of the specified type
- Parameters
-
[in] | alloc_size | number of bytes to be allocated |
[in] | memtype | type of memory to be allocated |
- Returns
- allocated memory of specified size and memory type
NULL, if allocation failed
Definition at line 183 of file xt_gpu.c.
◆ xt_gpu_memcpy()
void xt_gpu_memcpy |
( |
void * |
dst, |
|
|
void const * |
src, |
|
|
size_t |
buffer_size, |
|
|
enum xt_memtype |
dst_memtype, |
|
|
enum xt_memtype |
src_memtype |
|
) |
| |
copies memory from src to dst
- Parameters
-
[in] | dst | pointer to destination memory |
[in] | src | pointer to source memory |
[in] | buffer_size | number of bytes to be copied |
[in] | dst_memtype | type of destination memory |
[in] | src_memtype | type of source memory |
Definition at line 191 of file xt_gpu.c.
◆ filename
const char filename[] = "xt_gpu.c" |
|
static |
◆ vtable
Initial value:= {
}
static enum xt_memtype default_get_memtype(const void *ptr)
static void * default_malloc(size_t alloc_size, enum xt_memtype memtype)
static void default_memcpy(void *dst, void const *src, size_t buffer_size, enum xt_memtype dst_memtype, enum xt_memtype src_memtype)
static int default_instr_push(char const *)
static void default_free(void *ptr, enum xt_memtype memtype)
static int default_instr_pop(void)
Definition at line 75 of file xt_gpu.c.