|
PULSAR
2.0.0
Parallel Ultra-Light Systolic Array Runtime
|
Simple device memory allocator. More...
Go to the source code of this file.
Data Structures | |
| struct | segment |
| struct | gpu_malloc_s |
Typedefs | |
| typedef struct segment | segment_t |
| typedef struct gpu_malloc_s | gpu_malloc_t |
Functions | |
| gpu_malloc_t * | gpu_malloc_init (int max_segment, size_t unit_size) |
| Creates a new device allocator. More... | |
| int | gpu_malloc_fini (gpu_malloc_t *gdata) |
| Destroys a device allocator. More... | |
| void * | gpu_malloc (gpu_malloc_t *gdata, size_t size) |
| Allocates device memory. More... | |
| int | gpu_free (gpu_malloc_t *gdata, void *ptr) |
| Frees device memory. More... | |
Simple device memory allocator.
PULSAR Runtime http://icl.utk.edu/pulsar/ Copyright (C) 2012-2015 University of Tennessee.
Definition in file gpu_malloc.h.
| int gpu_free | ( | gpu_malloc_t * | gdata, |
| void * | add | ||
| ) |
Frees device memory.
| gdata | – The allocator to use. |
| add | – The pointer to the memory to free. |
| 0 | on success. |
| -1 | on error. |
Definition at line 143 of file gpu_malloc.c.
| void* gpu_malloc | ( | gpu_malloc_t * | gdata, |
| size_t | size | ||
| ) |
Allocates device memory.
| gdata | – The allocator to use. |
| size | – The size in bytes to allocate. |
Definition at line 106 of file gpu_malloc.c.
| int gpu_malloc_fini | ( | gpu_malloc_t * | gdata) |
Destroys a device allocator.
| gdata | – The allocator to destroy. |
| 0 | on success. |
| -1 | on error. |
Definition at line 73 of file gpu_malloc.c.
| gpu_malloc_t* gpu_malloc_init | ( | int | _max_segment, |
| size_t | _unit_size | ||
| ) |
Creates a new device allocator.
| _max_segment | – The maximum number of segments. |
| _unit_size | – The size of each segment. |
Definition at line 24 of file gpu_malloc.c.