(git:0a7030e)
Loading...
Searching...
No Matches
offload_library.c File Reference
#include "offload_library.h"
#include "offload_runtime.h"
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.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 []

Function Documentation

◆ offload_init()

void offload_init ( void )

Initialize runtime.

Initalize runtime.

Author
Rocco Meli

Definition at line 53 of file offload_library.c.

Here is the caller graph for this function:

◆ offload_get_device_count()

int offload_get_device_count ( void )

Returns the number of available devices.

Author
Ole Schuett

Definition at line 72 of file offload_library.c.

Here is the caller graph for this function:

◆ offload_set_chosen_device()

void offload_set_chosen_device ( int device_id)

Selects the chosen device to be used.

Author
Ole Schuett

Definition at line 88 of file offload_library.c.

Here is the caller graph for this function:

◆ offload_get_chosen_device()

int offload_get_chosen_device ( void )

Returns the chosen device.

Author
Ole Schuett

Definition at line 94 of file offload_library.c.

Here is the caller graph for this function:

◆ offload_activate_chosen_device()

void offload_activate_chosen_device ( void )

Activates the device selected via offload_set_chosen_device().

Author
Ole Schuett

Definition at line 100 of file offload_library.c.

Here is the caller graph for this function:

◆ offload_timeset()

void offload_timeset ( const char * message)

Starts a timing range.

Author
Ole Schuett

Definition at line 116 of file offload_library.c.

Here is the call graph for this function:

◆ offload_timestop()

void offload_timestop ( void )

Ends a timing range.

Author
Ole Schuett

Definition at line 146 of file offload_library.c.

◆ offload_mem_info()

void offload_mem_info ( size_t * free,
size_t * total )

Gets free and total device memory.

Author
Ole Schuett

Definition at line 160 of file offload_library.c.

◆ offload_host_malloc()

int offload_host_malloc ( void ** ptr__,
const size_t size__ )

Allocate pinned memory (or simple malloc when there is no gpu).

Definition at line 175 of file offload_library.c.

◆ offload_host_free()

int offload_host_free ( void * ptr__)

free pinned memory (or simple free when there is no gpu)

Definition at line 188 of file offload_library.c.

Variable Documentation

◆ chosen_device_id

int chosen_device_id = -1
static

Definition at line 32 of file offload_library.c.

◆ colormap

const uint32_t colormap[]
Initial value:
= {0xFFFFFF00,
0xFFFF00FF,
0xFFFF0000,
0xFFC0C0C0,
0xFF808080,
0xFF808000,
0xFF800080,
0xFF800000,
0xFF00FFFF,
0xFF00FF00,
0xFF008080,
0xFF008000,
0xFF0000FF,
0xFF000080}

Definition at line 34 of file offload_library.c.