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 #include "../cuda/ceed-cuda.h" 21 22 typedef struct { const CeedScalar *in[16]; CeedScalar *out[16]; } CudaFields; 23 typedef struct { CeedInt *in[16]; CeedInt *out[16]; } CudaFieldsInt; 24 25 typedef struct { 26 CeedInt dim; 27 CeedInt Q1d; 28 CUmodule module; 29 CUfunction op; 30 CudaFieldsInt indices; 31 CudaFields fields; 32 CudaFields B; 33 CudaFields G; 34 CeedScalar *W; 35 } CeedOperator_Cuda_gen; 36 37 typedef struct { 38 char *qFunctionName; 39 char *qFunctionSource; 40 void *d_c; 41 } CeedQFunction_Cuda_gen; 42 43 typedef struct { 44 Ceed_Cuda base; 45 } Ceed_Cuda_gen; 46 47 CEED_INTERN int CeedQFunctionCreate_Cuda_gen(CeedQFunction qf); 48 49 CEED_INTERN int CeedOperatorCreate_Cuda_gen(CeedOperator op); 50 51 CEED_INTERN int CeedCompositeOperatorCreate_Cuda_gen(CeedOperator op); 52