xref: /libCEED/backends/hip-shared/ceed-hip-shared.h (revision 82138112808ac45c6722ef2bfe52ea5cd96df80f)
1 // Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors.
2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: BSD-2-Clause
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 #pragma once
8 
9 #include <ceed.h>
10 #include <ceed/backend.h>
11 #include <hip/hip_runtime.h>
12 
13 typedef struct {
14   hipModule_t   module;
15   hipFunction_t Interp;
16   hipFunction_t InterpTranspose;
17   hipFunction_t InterpTransposeAdd;
18   hipFunction_t Grad;
19   hipFunction_t GradTranspose;
20   hipFunction_t GradTransposeAdd;
21   hipFunction_t Weight;
22   hipModule_t   moduleAtPoints;
23   CeedInt       num_points;
24   hipFunction_t InterpAtPoints;
25   hipFunction_t InterpTransposeAtPoints;
26   hipFunction_t GradAtPoints;
27   hipFunction_t GradTransposeAtPoints;
28   CeedInt       block_sizes[3];  // interp, grad, weight thread block sizes
29   CeedScalar   *d_interp_1d;
30   CeedScalar   *d_grad_1d;
31   CeedScalar   *d_collo_grad_1d;
32   CeedScalar   *d_q_weight_1d;
33   CeedScalar   *d_chebyshev_interp_1d;
34   CeedInt       num_elem_at_points;
35   CeedInt      *h_points_per_elem;
36   CeedInt      *d_points_per_elem;
37 } CeedBasis_Hip_shared;
38 
39 CEED_INTERN int CeedBasisCreateTensorH1_Hip_shared(CeedInt dim, CeedInt P_1d, CeedInt Q_1d, const CeedScalar *interp_1d, const CeedScalar *grad_1d,
40                                                    const CeedScalar *q_ref_1d, const CeedScalar *q_weight_1d, CeedBasis basis);
41 
42 CEED_INTERN int CeedBasisCreateH1_Hip_shared(CeedElemTopology topo, CeedInt dim, CeedInt num_nodes, CeedInt num_qpts, const CeedScalar *interp,
43                                              const CeedScalar *grad, const CeedScalar *q_ref, const CeedScalar *q_weight, CeedBasis basis);
44