xref: /libCEED/backends/cuda-shared/ceed-cuda-shared.h (revision af0e6e89dc9eb1085789d576366358a2a9a69ecc)
15aed82e4SJeremy L Thompson // Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors.
23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3c532df63SYohann //
43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
5c532df63SYohann //
63d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
7509d4af6SJeremy L Thompson #pragma once
83d576824SJeremy L Thompson 
949aac155SJeremy L Thompson #include <ceed.h>
10ec3da8bcSJed Brown #include <ceed/backend.h>
11c532df63SYohann #include <cuda.h>
122b730f8bSJeremy L Thompson 
13c532df63SYohann typedef struct {
14c532df63SYohann   CUmodule    module;
15437930d1SJeremy L Thompson   CUfunction  Interp;
169e201c85SYohann   CUfunction  InterpTranspose;
17db2becc9SJeremy L Thompson   CUfunction  InterpTransposeAdd;
18437930d1SJeremy L Thompson   CUfunction  Grad;
199e201c85SYohann   CUfunction  GradTranspose;
20db2becc9SJeremy L Thompson   CUfunction  GradTransposeAdd;
21437930d1SJeremy L Thompson   CUfunction  Weight;
221dda9c1aSJeremy L Thompson   CUmodule    moduleAtPoints;
231dda9c1aSJeremy L Thompson   CeedInt     num_points;
241dda9c1aSJeremy L Thompson   CUfunction  InterpAtPoints;
2581ae6159SJeremy L Thompson   CUfunction  InterpTransposeAtPoints;
26*af0e6e89SJeremy L Thompson   CUfunction  InterpTransposeAddAtPoints;
271dda9c1aSJeremy L Thompson   CUfunction  GradAtPoints;
2881ae6159SJeremy L Thompson   CUfunction  GradTransposeAtPoints;
29*af0e6e89SJeremy L Thompson   CUfunction  GradTransposeAddAtPoints;
30437930d1SJeremy L Thompson   CeedScalar *d_interp_1d;
31437930d1SJeremy L Thompson   CeedScalar *d_grad_1d;
32437930d1SJeremy L Thompson   CeedScalar *d_collo_grad_1d;
33437930d1SJeremy L Thompson   CeedScalar *d_q_weight_1d;
341dda9c1aSJeremy L Thompson   CeedScalar *d_chebyshev_interp_1d;
35c532df63SYohann   CeedScalar *c_B;
36c532df63SYohann   CeedScalar *c_G;
37111870feSJeremy L Thompson   CeedInt     num_elem_at_points;
38111870feSJeremy L Thompson   CeedInt    *h_points_per_elem;
39111870feSJeremy L Thompson   CeedInt    *d_points_per_elem;
40c532df63SYohann } CeedBasis_Cuda_shared;
41c532df63SYohann 
422b730f8bSJeremy L Thompson CEED_INTERN int CeedBasisCreateTensorH1_Cuda_shared(CeedInt dim, CeedInt P_1d, CeedInt Q_1d, const CeedScalar *interp_1d, const CeedScalar *grad_1d,
43437930d1SJeremy L Thompson                                                     const CeedScalar *q_ref_1d, const CeedScalar *q_weight_1d, CeedBasis basis);
449ff05d55SJeremy L Thompson 
459ff05d55SJeremy L Thompson CEED_INTERN int CeedBasisCreateH1_Cuda_shared(CeedElemTopology topo, CeedInt dim, CeedInt num_nodes, CeedInt num_qpts, const CeedScalar *interp,
469ff05d55SJeremy L Thompson                                               const CeedScalar *grad, const CeedScalar *q_ref, const CeedScalar *q_weight, CeedBasis basis);
47