xref: /libCEED/include/ceed/jit-source/sycl/sycl-ref-qfunction.h (revision 5aed82e4fa97acf4ba24a7f10a35f5303a6798e0)
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 #ifndef CEED_SYCL_REF_QFUNCTION_H
11 #define CEED_SYCL_REF_QFUNCTION_H
12 
13 #include <ceed.h>
14 
15 //------------------------------------------------------------------------------
16 // Read from quadrature points
17 //------------------------------------------------------------------------------
18 inline void readQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) {
19   for (CeedInt i = 0; i < N; ++i) dest[i] = src[stride * i + offset];
20 }
21 
22 //------------------------------------------------------------------------------
23 // Write at quadrature points
24 //------------------------------------------------------------------------------
25 inline void writeQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) {
26   for (CeedInt i = 0; i < N; ++i) dest[stride * i + offset] = src[i];
27 }
28 
29 //------------------------------------------------------------------------------
30 
31 #endif  // CEED_SYCL_REF_QFUNCTION_H
32