(git:374b731)
Loading...
Searching...
No Matches
offload_buffer.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------*/
2/* CP2K: A general program to perform molecular dynamics simulations */
3/* Copyright 2000-2024 CP2K developers group <https://cp2k.org> */
4/* */
5/* SPDX-License-Identifier: BSD-3-Clause */
6/*----------------------------------------------------------------------------*/
7#ifndef OFFLOAD_BUFFER_H
8#define OFFLOAD_BUFFER_H
9
10#include <stddef.h>
11
12/*******************************************************************************
13 * \brief Internal representation of a buffer.
14 * \author Ole Schuett
15 ******************************************************************************/
16typedef struct {
17 size_t size;
18 double *host_buffer;
21
22/*******************************************************************************
23 * \brief Allocates a buffer of given length, ie., number of elements.
24 * \author Ole Schuett
25 ******************************************************************************/
26void offload_create_buffer(const int length, offload_buffer **buffer);
27
28/*******************************************************************************
29 * \brief Deallocate given buffer.
30 * \author Ole Schuett
31 ******************************************************************************/
32void offload_free_buffer(offload_buffer *buffer);
33
34/*******************************************************************************
35 * \brief Returns a pointer to the host buffer.
36 * \author Ole Schuett
37 ******************************************************************************/
39
40#endif
41
42// EOF
double * offload_get_buffer_host_pointer(offload_buffer *buffer)
Returns a pointer to the host buffer.
Internal representation of a buffer.
double * device_buffer
double * host_buffer