xref: /libCEED/backends/cuda-shared/ceed-cuda-shared.h (revision e9c76bddc0f2a44f522e0176ed6b7e0c0aa1df73)
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 <cuda.h>
12 
13 typedef struct {
14   CUmodule    module;
15   CUfunction  Interp;
16   CUfunction  InterpTranspose;
17   CUfunction  InterpTransposeAdd;
18   CUfunction  Grad;
19   CUfunction  GradTranspose;
20   CUfunction  GradTransposeAdd;
21   CUfunction  Weight;
22   CUmodule    moduleAtPoints;
23   CeedInt     num_points;
24   CUfunction  InterpAtPoints;
25   CUfunction  InterpTransposeAtPoints;
26   CUfunction  InterpTransposeAddAtPoints;
27   CUfunction  GradAtPoints;
28   CUfunction  GradTransposeAtPoints;
29   CUfunction  GradTransposeAddAtPoints;
30   CeedScalar *d_interp_1d;
31   CeedScalar *d_grad_1d;
32   CeedScalar *d_collo_grad_1d;
33   CeedScalar *d_q_weight_1d;
34   CeedScalar *d_chebyshev_interp_1d;
35   CeedScalar *c_B;
36   CeedScalar *c_G;
37   CeedInt     num_elem_at_points;
38   CeedInt    *h_points_per_elem;
39   CeedInt    *d_points_per_elem;
40 } CeedBasis_Cuda_shared;
41 
42 CEED_INTERN int CeedBasisCreateTensorH1_Cuda_shared(CeedInt dim, CeedInt P_1d, CeedInt Q_1d, const CeedScalar *interp_1d, const CeedScalar *grad_1d,
43                                                     const CeedScalar *q_ref_1d, const CeedScalar *q_weight_1d, CeedBasis basis);
44 
45 CEED_INTERN int CeedBasisCreateH1_Cuda_shared(CeedElemTopology topo, CeedInt dim, CeedInt num_nodes, CeedInt num_qpts, const CeedScalar *interp,
46                                               const CeedScalar *grad, const CeedScalar *q_ref, const CeedScalar *q_weight, CeedBasis basis);
47