![]() |
(git:08825b9)
|
#include "offload_buffer.h"#include "offload_library.h"#include "offload_mempool.h"#include "offload_runtime.h"#include <assert.h>#include <stdio.h>#include <stdlib.h>Go to the source code of this file.
Macros | |
| #define | OFFLOAD_BUFFER_MEMPOOL |
Functions | |
| static void | offload_free_buffer_internal (offload_buffer *buffer) |
| Internal routine to deallocate given buffer. | |
| void | offload_create_buffer (const int length, offload_buffer **buffer) |
| Allocates a buffer (NULL or valid) with the given number of elements. | |
| void | offload_free_buffer (offload_buffer *buffer) |
| Deallocate given buffer. | |
| double * | offload_get_buffer_host_pointer (offload_buffer *buffer) |
| Returns a pointer to the host buffer (Fortran API). | |
| double * | offload_get_buffer_device_pointer (offload_buffer *buffer) |
| Returns a pointer to the device buffer (Fortran API). | |
| void | offload_buffer_h2d (offload_buffer *buffer, const int length) |
| Copy data from host to device (Fortran API). | |
| void | offload_buffer_d2h (offload_buffer *buffer, const int length) |
| Copy data from device to host (Fortran API). | |
| #define OFFLOAD_BUFFER_MEMPOOL |
Definition at line 17 of file offload_buffer.c.
|
static |
Internal routine to deallocate given buffer.
Definition at line 24 of file offload_buffer.c.
| void offload_create_buffer | ( | const int | length, |
| offload_buffer ** | buffer ) |
Allocates a buffer (NULL or valid) with the given number of elements.
Allocate a buffer (NULL or valid) with the given number of elements.
Definition at line 52 of file offload_buffer.c.
| void offload_free_buffer | ( | offload_buffer * | buffer | ) |
Deallocate given buffer.
Definition at line 102 of file offload_buffer.c.
| double * offload_get_buffer_host_pointer | ( | offload_buffer * | buffer | ) |
Returns a pointer to the host buffer (Fortran API).
Return a pointer to the host buffer (Fortran API).
Definition at line 113 of file offload_buffer.c.
| double * offload_get_buffer_device_pointer | ( | offload_buffer * | buffer | ) |
Returns a pointer to the device buffer (Fortran API).
Return a pointer to the device buffer (Fortran API).
Definition at line 122 of file offload_buffer.c.
| void offload_buffer_h2d | ( | offload_buffer * | buffer, |
| const int | length ) |
Copy data from host to device (Fortran API).
Definition at line 131 of file offload_buffer.c.
| void offload_buffer_d2h | ( | offload_buffer * | buffer, |
| const int | length ) |
Copy data from device to host (Fortran API).
Definition at line 148 of file offload_buffer.c.