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