xref: /libCEED/include/ceed/jit-source/cuda/cuda-ref-qfunction.h (revision 9bd0a4de615e3a1434ac7c89598f4ee8661d99f4) !
1a0154adeSJed Brown // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2a0154adeSJed Brown // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3a0154adeSJed Brown //
4a0154adeSJed Brown // SPDX-License-Identifier: BSD-2-Clause
5a0154adeSJed Brown //
6a0154adeSJed Brown // This file is part of CEED:  http://github.com/ceed
7a0154adeSJed Brown 
8c9c2c079SJeremy L Thompson #include <ceed.h>
9a0154adeSJed Brown 
10a0154adeSJed Brown //------------------------------------------------------------------------------
11a0154adeSJed Brown // Read from quadrature points
12a0154adeSJed Brown //------------------------------------------------------------------------------
13*9bd0a4deSJeremy L Thompson template <int SIZE>
142b730f8bSJeremy L Thompson inline __device__ void readQuads(const CeedInt quad, const CeedInt num_qpts, const CeedScalar* d_u, CeedScalar* r_u) {
15a0154adeSJed Brown   for (CeedInt comp = 0; comp < SIZE; comp++) {
16a0154adeSJed Brown     r_u[comp] = d_u[quad + num_qpts * comp];
17a0154adeSJed Brown   }
18a0154adeSJed Brown }
19a0154adeSJed Brown 
20a0154adeSJed Brown //------------------------------------------------------------------------------
21a0154adeSJed Brown // Write at quadrature points
22a0154adeSJed Brown //------------------------------------------------------------------------------
23a0154adeSJed Brown template <int SIZE>
242b730f8bSJeremy L Thompson inline __device__ void writeQuads(const CeedInt quad, const CeedInt num_qpts, const CeedScalar* r_v, CeedScalar* d_v) {
25a0154adeSJed Brown   for (CeedInt comp = 0; comp < SIZE; comp++) {
26a0154adeSJed Brown     d_v[quad + num_qpts * comp] = r_v[comp];
27a0154adeSJed Brown   }
28a0154adeSJed Brown }
29a0154adeSJed Brown 
30a0154adeSJed Brown //------------------------------------------------------------------------------
31