![]() |
(git:b77b4be)
|
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "offload_library.h"
#include "offload_runtime.h"
Go to the source code of this file.
Functions | |
void | offload_init (void) |
Initialize runtime. | |
int | offload_get_device_count (void) |
Returns the number of available devices. | |
void | offload_set_chosen_device (int device_id) |
Selects the chosen device to be used. | |
int | offload_get_chosen_device (void) |
Returns the chosen device. | |
void | offload_activate_chosen_device (void) |
Activates the device selected via offload_set_chosen_device() | |
void | offload_timeset (const char *message) |
Starts a timing range. | |
void | offload_timestop (void) |
Ends a timing range. | |
void | offload_mem_info (size_t *free, size_t *total) |
Gets free and total device memory. | |
int | offload_host_malloc (void **ptr__, const size_t size__) |
Allocate pinned memory (or simple malloc when there is no gpu) | |
int | offload_host_free (void *ptr__) |
free pinned memory (or simple free when there is no gpu) | |
Variables | |
static int | chosen_device_id = -1 |
const uint32_t | colormap [] |
void offload_init | ( | void | ) |
int offload_get_device_count | ( | void | ) |
Returns the number of available devices.
Definition at line 71 of file offload_library.c.
void offload_set_chosen_device | ( | int | device_id | ) |
Selects the chosen device to be used.
Definition at line 87 of file offload_library.c.
int offload_get_chosen_device | ( | void | ) |
Returns the chosen device.
Definition at line 93 of file offload_library.c.
void offload_activate_chosen_device | ( | void | ) |
Activates the device selected via offload_set_chosen_device()
Definition at line 99 of file offload_library.c.
void offload_timeset | ( | const char * | message | ) |
Starts a timing range.
Definition at line 113 of file offload_library.c.
void offload_timestop | ( | void | ) |
Ends a timing range.
Definition at line 143 of file offload_library.c.
void offload_mem_info | ( | size_t * | free, |
size_t * | total | ||
) |
Gets free and total device memory.
Definition at line 157 of file offload_library.c.
int offload_host_malloc | ( | void ** | ptr__, |
const size_t | size__ | ||
) |
Allocate pinned memory (or simple malloc when there is no gpu)
Definition at line 169 of file offload_library.c.
int offload_host_free | ( | void * | ptr__ | ) |
free pinned memory (or simple free when there is no gpu)
Definition at line 179 of file offload_library.c.
|
static |
Definition at line 31 of file offload_library.c.
const uint32_t colormap[] |
Definition at line 33 of file offload_library.c.