xref: /libCEED/rust/libceed-sys/c-src/backends/cuda-gen/ceed-cuda-gen.h (revision abfaacbbbdcce316a2b399b903fc00b311ddf605)
1241a4b83SYohann // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
2241a4b83SYohann // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
3241a4b83SYohann // All Rights reserved. See files LICENSE and NOTICE for details.
4241a4b83SYohann //
5241a4b83SYohann // This file is part of CEED, a collection of benchmarks, miniapps, software
6241a4b83SYohann // libraries and APIs for efficient high-order finite element and spectral
7241a4b83SYohann // element discretizations for exascale applications. For more information and
8241a4b83SYohann // source code availability see http://github.com/ceed.
9241a4b83SYohann //
10241a4b83SYohann // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11241a4b83SYohann // a collaborative effort of two U.S. Department of Energy organizations (Office
12241a4b83SYohann // of Science and the National Nuclear Security Administration) responsible for
13241a4b83SYohann // the planning and preparation of a capable exascale ecosystem, including
14241a4b83SYohann // software, applications, hardware, advanced system engineering and early
15241a4b83SYohann // testbed platforms, in support of the nation's exascale computing imperative.
16241a4b83SYohann #include <ceed-backend.h>
17241a4b83SYohann #include <ceed.h>
18241a4b83SYohann #include <cuda.h>
19241a4b83SYohann #include <cuda_runtime.h>
20*abfaacbbSSander Arens #include "../cuda/ceed-cuda.h"
21241a4b83SYohann 
22241a4b83SYohann typedef struct { const CeedScalar *in[16]; CeedScalar *out[16]; } CudaFields;
23241a4b83SYohann typedef struct { CeedInt *in[16]; CeedInt *out[16]; } CudaFieldsInt;
24241a4b83SYohann 
25241a4b83SYohann typedef struct {
26241a4b83SYohann   CeedInt dim;
27241a4b83SYohann   CeedInt Q1d;
28241a4b83SYohann   CUmodule module;
29241a4b83SYohann   CUfunction op;
30241a4b83SYohann   CudaFieldsInt indices;
31241a4b83SYohann   CudaFields fields;
32241a4b83SYohann   CudaFields B;
33241a4b83SYohann   CudaFields G;
34241a4b83SYohann   CeedScalar *W;
35241a4b83SYohann } CeedOperator_Cuda_gen;
36241a4b83SYohann 
37241a4b83SYohann typedef struct {
38241a4b83SYohann   char *qFunctionName;
39241a4b83SYohann   char *qFunctionSource;
40241a4b83SYohann   void *d_c;
41241a4b83SYohann } CeedQFunction_Cuda_gen;
42241a4b83SYohann 
43241a4b83SYohann typedef struct {
44*abfaacbbSSander Arens   Ceed_Cuda base;
45241a4b83SYohann } Ceed_Cuda_gen;
46241a4b83SYohann 
47241a4b83SYohann CEED_INTERN int CeedQFunctionCreate_Cuda_gen(CeedQFunction qf);
48241a4b83SYohann 
49241a4b83SYohann CEED_INTERN int CeedOperatorCreate_Cuda_gen(CeedOperator op);
50241a4b83SYohann 
51241a4b83SYohann CEED_INTERN int CeedCompositeOperatorCreate_Cuda_gen(CeedOperator op);
52