(git:ccc2433)
grid_hip_task_list.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 GRID_HIP_TASK_LIST_H
8 #define GRID_HIP_TASK_LIST_H
9 
10 #if defined(__OFFLOAD_HIP) && !defined(__NO_OFFLOAD_GRID)
11 
12 #include <stdbool.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include "../../offload/offload_buffer.h"
19 #include "../common/grid_basis_set.h"
20 #include "../common/grid_constants.h"
21 
22 typedef void grid_hip_task_list;
23 /*******************************************************************************
24  * \brief Allocates a task list for the GPU backend.
25  * See grid_task_list.h for details.
26  ******************************************************************************/
27 void grid_hip_create_task_list(
28  const bool ortho, const int ntasks, const int nlevels, const int natoms,
29  const int nkinds, const int nblocks, const int *block_offsets,
30  const double *atom_positions, const int *atom_kinds,
31  const grid_basis_set **basis_sets, const int *level_list,
32  const int *iatom_list, const int *jatom_list, const int *iset_list,
33  const int *jset_list, const int *ipgf_list, const int *jpgf_list,
34  const int *border_mask_list, const int *block_num_list,
35  const double *radius_list, const double *rab_list, const int *npts_global,
36  const int *npts_local, const int *shift_local, const int *border_width,
37  const double *dh, const double *dh_inv, void *ptr);
38 /*******************************************************************************
39  * \brief Deallocates given task list, basis_sets have to be freed separately.
40  ******************************************************************************/
41 void grid_hip_free_task_list(void *ptr);
42 
43 /*******************************************************************************
44  * \brief Collocate all tasks of in given list onto given grids.
45  * See grid_task_list.h for details.
46  ******************************************************************************/
47 void grid_hip_collocate_task_list(const void *ptr, const enum grid_func func,
48  const int nlevels,
49  const offload_buffer *pab_blocks,
50  offload_buffer **grids);
51 
52 /*******************************************************************************
53  * \brief Integrate all tasks of in given list onto given grids.
54  * See grid_task_list.h for details.
55  ******************************************************************************/
56 void grid_hip_integrate_task_list(const void *ptr, const bool compute_tau,
57  const int nlevels,
58  const offload_buffer *pab_blocks,
59  const offload_buffer **grids,
60  offload_buffer *hab_blocks, double *forces,
61  double *virial);
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif // defined(__OFFLOAD_HIP) && !defined(__NO_OFFLOAD_GRID)
67 #endif
grid_func
static void const int const int const int const int const int const double const int const int const int npts_local[3]
Internal representation of a basis set.
Internal representation of a buffer.