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