xref: /libCEED/rust/libceed-sys/c-src/backends/cuda-gen/ceed-cuda-gen.h (revision 241a4b83dc9c714eb4bcc90729a46be02322143a)
1*241a4b83SYohann // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
2*241a4b83SYohann // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
3*241a4b83SYohann // All Rights reserved. See files LICENSE and NOTICE for details.
4*241a4b83SYohann //
5*241a4b83SYohann // This file is part of CEED, a collection of benchmarks, miniapps, software
6*241a4b83SYohann // libraries and APIs for efficient high-order finite element and spectral
7*241a4b83SYohann // element discretizations for exascale applications. For more information and
8*241a4b83SYohann // source code availability see http://github.com/ceed.
9*241a4b83SYohann //
10*241a4b83SYohann // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11*241a4b83SYohann // a collaborative effort of two U.S. Department of Energy organizations (Office
12*241a4b83SYohann // of Science and the National Nuclear Security Administration) responsible for
13*241a4b83SYohann // the planning and preparation of a capable exascale ecosystem, including
14*241a4b83SYohann // software, applications, hardware, advanced system engineering and early
15*241a4b83SYohann // testbed platforms, in support of the nation's exascale computing imperative.
16*241a4b83SYohann #include <ceed-backend.h>
17*241a4b83SYohann #include <ceed.h>
18*241a4b83SYohann #include <cuda.h>
19*241a4b83SYohann #include <cuda_runtime.h>
20*241a4b83SYohann 
21*241a4b83SYohann typedef struct { const CeedScalar *in[16]; CeedScalar *out[16]; } CudaFields;
22*241a4b83SYohann typedef struct { CeedInt *in[16]; CeedInt *out[16]; } CudaFieldsInt;
23*241a4b83SYohann 
24*241a4b83SYohann typedef struct {
25*241a4b83SYohann   CeedInt dim;
26*241a4b83SYohann   CeedInt Q1d;
27*241a4b83SYohann   CUmodule module;
28*241a4b83SYohann   CUfunction op;
29*241a4b83SYohann   CudaFieldsInt indices;
30*241a4b83SYohann   CudaFields fields;
31*241a4b83SYohann   CudaFields B;
32*241a4b83SYohann   CudaFields G;
33*241a4b83SYohann   CeedScalar *W;
34*241a4b83SYohann } CeedOperator_Cuda_gen;
35*241a4b83SYohann 
36*241a4b83SYohann typedef struct {
37*241a4b83SYohann   CUmodule module;
38*241a4b83SYohann   CUfunction interp;
39*241a4b83SYohann   CUfunction grad;
40*241a4b83SYohann   CUfunction weight;
41*241a4b83SYohann   CeedScalar *d_interp1d;
42*241a4b83SYohann   CeedScalar *d_grad1d;
43*241a4b83SYohann   CeedScalar *d_qweight1d;
44*241a4b83SYohann   CeedScalar *c_B;
45*241a4b83SYohann   CeedScalar *c_G;
46*241a4b83SYohann } CeedBasis_Cuda_gen;
47*241a4b83SYohann 
48*241a4b83SYohann typedef struct {
49*241a4b83SYohann   char *qFunctionName;
50*241a4b83SYohann   char *qFunctionSource;
51*241a4b83SYohann   void *d_c;
52*241a4b83SYohann } CeedQFunction_Cuda_gen;
53*241a4b83SYohann 
54*241a4b83SYohann typedef struct {
55*241a4b83SYohann } Ceed_Cuda_gen;
56*241a4b83SYohann 
57*241a4b83SYohann CEED_INTERN int CeedQFunctionCreate_Cuda_gen(CeedQFunction qf);
58*241a4b83SYohann 
59*241a4b83SYohann CEED_INTERN int CeedOperatorCreate_Cuda_gen(CeedOperator op);
60*241a4b83SYohann 
61*241a4b83SYohann CEED_INTERN int CeedCompositeOperatorCreate_Cuda_gen(CeedOperator op);
62