xref: /libCEED/include/ceed/jit-source/sycl/sycl-ref-qfunction.h (revision bd882c8a454763a096666645dc9a6229d5263694)
1*bd882c8aSJames Wright // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2*bd882c8aSJames Wright // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3*bd882c8aSJames Wright //
4*bd882c8aSJames Wright // SPDX-License-Identifier: BSD-2-Clause
5*bd882c8aSJames Wright //
6*bd882c8aSJames Wright // This file is part of CEED:  http://github.com/ceed
7*bd882c8aSJames Wright 
8*bd882c8aSJames Wright #include <ceed.h>
9*bd882c8aSJames Wright 
10*bd882c8aSJames Wright //------------------------------------------------------------------------------
11*bd882c8aSJames Wright // Read from quadrature points
12*bd882c8aSJames Wright //------------------------------------------------------------------------------
13*bd882c8aSJames Wright inline void readQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) {
14*bd882c8aSJames Wright   for (CeedInt i = 0; i < N; ++i) dest[i] = src[stride * i + offset];
15*bd882c8aSJames Wright }
16*bd882c8aSJames Wright 
17*bd882c8aSJames Wright //------------------------------------------------------------------------------
18*bd882c8aSJames Wright // Write at quadrature points
19*bd882c8aSJames Wright //------------------------------------------------------------------------------
20*bd882c8aSJames Wright inline void writeQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) {
21*bd882c8aSJames Wright   for (CeedInt i = 0; i < N; ++i) dest[stride * i + offset] = src[i];
22*bd882c8aSJames Wright }
23*bd882c8aSJames Wright //------------------------------------------------------------------------------
24