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