xref: /libCEED/rust/libceed-sys/c-src/backends/cuda/ceed-cuda-compile.h (revision 6d69246ad8d06846a22b2f7e3720a77f7a77e7f6)
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 
17 #ifndef _ceed_cuda_compile_h
18 #define _ceed_cuda_compile_h
19 
20 #include <ceed/ceed.h>
21 #include <cuda.h>
22 #include <nvrtc.h>
23 
24 CEED_INTERN int CeedCompileCuda(Ceed ceed, const char *source, CUmodule *module,
25                                 const CeedInt numopts, ...);
26 
27 CEED_INTERN int CeedGetKernelCuda(Ceed ceed, CUmodule module, const char *name,
28                                   CUfunction *kernel);
29 
30 CEED_INTERN int CeedRunKernelCuda(Ceed ceed, CUfunction kernel,
31                                   const int gridSize,
32                                   const int blockSize, void **args);
33 
34 CEED_INTERN int CeedRunKernelAutoblockCuda(Ceed ceed, CUfunction kernel,
35     size_t size, void **args);
36 
37 CEED_INTERN int CeedRunKernelDimCuda(Ceed ceed, CUfunction kernel,
38                                      const int gridSize,
39                                      const int blockSizeX, const int blockSizeY,
40                                      const int blockSizeZ, void **args);
41 
42 CEED_INTERN int CeedRunKernelDimSharedCuda(Ceed ceed, CUfunction kernel,
43     const int gridSize, const int blockSizeX, const int blockSizeY,
44     const int blockSizeZ, const int sharedMemSize, void **args);
45 
46 #endif // _ceed_cuda_compile_h
47