xref: /libCEED/backends/hip-shared/ceed-hip-shared.h (revision b7453713e95c1c6eb59ce174cbcb87227e92884e)
1 // Copyright (c) 2017-2022, 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 
8 #ifndef CEED_HIP_SHARED_H
9 #define CEED_HIP_SHARED_H
10 
11 #include <ceed.h>
12 #include <ceed/backend.h>
13 #include <hip/hip_runtime.h>
14 
15 typedef struct {
16   hipModule_t   module;
17   hipFunction_t Interp;
18   hipFunction_t InterpTranspose;
19   hipFunction_t Grad;
20   hipFunction_t GradTranspose;
21   hipFunction_t Weight;
22   CeedInt       block_sizes[3];  // interp, grad, weight thread block sizes
23   CeedScalar   *d_interp_1d;
24   CeedScalar   *d_grad_1d;
25   CeedScalar   *d_collo_grad_1d;
26   CeedScalar   *d_q_weight_1d;
27 } CeedBasis_Hip_shared;
28 
29 CEED_INTERN int CeedBasisCreateTensorH1_Hip_shared(CeedInt dim, CeedInt P_1d, CeedInt Q_1d, const CeedScalar *interp_1d, const CeedScalar *grad_1d,
30                                                    const CeedScalar *q_ref_1d, const CeedScalar *q_weight_1d, CeedBasis basis);
31 
32 #endif  // CEED_HIP_SHARED_H
33