Loading [MathJax]/jax/input/TeX/config.js
(git:33f85d8)
Toggle main menu visibility
Main Page
Modules
Modules List
Module Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions/Subroutines
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Data Types
Data Types List
Data Type Index
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions/Subroutines
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Functions/Subroutines
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Variables
b
c
g
i
j
k
l
m
n
o
p
r
s
u
Typedefs
Enumerations
Enumerator
c
g
l
t
Macros
_
a
b
c
d
f
g
i
l
m
n
p
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
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-2025 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
******************************************************************************/
16
typedef
struct
{
17
size_t
size
;
18
double
*
host_buffer
;
19
double
*
device_buffer
;
20
}
offload_buffer
;
16
typedef
struct
{
…
};
21
22
/*******************************************************************************
23
* \brief Allocates a buffer of given length, ie., number of elements.
24
* \author Ole Schuett
25
******************************************************************************/
26
void
offload_create_buffer(
const
int
length,
offload_buffer
**buffer);
27
28
/*******************************************************************************
29
* \brief Deallocate given buffer.
30
* \author Ole Schuett
31
******************************************************************************/
32
void
offload_free_buffer(
offload_buffer
*buffer);
33
34
/*******************************************************************************
35
* \brief Returns a pointer to the host buffer.
36
* \author Ole Schuett
37
******************************************************************************/
38
double
*
offload_get_buffer_host_pointer
(
offload_buffer
*buffer);
39
40
#endif
41
42
// EOF
offload_get_buffer_host_pointer
double * offload_get_buffer_host_pointer(offload_buffer *buffer)
Returns a pointer to the host buffer.
Definition
offload_buffer.c:68
offload_buffer
Internal representation of a buffer.
Definition
offload_buffer.h:16
offload_buffer::device_buffer
double * device_buffer
Definition
offload_buffer.h:19
offload_buffer::host_buffer
double * host_buffer
Definition
offload_buffer.h:18
offload_buffer::size
size_t size
Definition
offload_buffer.h:17
offload
offload_buffer.h
Generated by
1.9.8