xref: /libCEED/rust/libceed-sys/c-src/backends/cuda-gen/ceed-cuda-gen.h (revision bf4cb66493dbcc06b8d25c9c91cf89fe1cab7c9b)
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.
167df94212SJeremy L Thompson 
173d576824SJeremy L Thompson #ifndef _ceed_cuda_gen_h
183d576824SJeremy L Thompson #define _ceed_cuda_gen_h
193d576824SJeremy L Thompson 
20ec3da8bcSJed Brown #include <ceed/ceed.h>
21ec3da8bcSJed Brown #include <ceed/backend.h>
22241a4b83SYohann #include <cuda.h>
23abfaacbbSSander Arens #include "../cuda/ceed-cuda.h"
24241a4b83SYohann 
25*bf4cb664SJeremy L Thompson typedef struct { const CeedScalar *in[CEED_FIELD_MAX]; CeedScalar *out[CEED_FIELD_MAX]; } CudaFields;
26*bf4cb664SJeremy L Thompson typedef struct { CeedInt *in[CEED_FIELD_MAX]; CeedInt *out[CEED_FIELD_MAX]; } CudaFieldsInt;
27241a4b83SYohann 
28241a4b83SYohann typedef struct {
29241a4b83SYohann   CeedInt dim;
30241a4b83SYohann   CeedInt Q1d;
3118d499f1SYohann   CeedInt maxP1d;
32241a4b83SYohann   CUmodule module;
33241a4b83SYohann   CUfunction op;
34241a4b83SYohann   CudaFieldsInt indices;
35241a4b83SYohann   CudaFields fields;
36241a4b83SYohann   CudaFields B;
37241a4b83SYohann   CudaFields G;
38241a4b83SYohann   CeedScalar *W;
39241a4b83SYohann } CeedOperator_Cuda_gen;
40241a4b83SYohann 
41241a4b83SYohann typedef struct {
42241a4b83SYohann   char *qFunctionName;
43241a4b83SYohann   char *qFunctionSource;
44241a4b83SYohann   void *d_c;
45241a4b83SYohann } CeedQFunction_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);
523d576824SJeremy L Thompson 
533d576824SJeremy L Thompson #endif // _ceed_cuda_gen_h
54