xref: /libCEED/include/ceed/jit-source/sycl/sycl-ref-qfunction.h (revision d4cc18453651bd0f94c1a2e078b2646a92dafdcc)
1*9ba83ac0SJeremy L Thompson // Copyright (c) 2017-2026, 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 
849ed4312SSebastian Grimberg /// @file
949ed4312SSebastian Grimberg /// Internal header for SYCL backend QFunction read/write kernels
10c0b5abf0SJeremy L Thompson #include <ceed/types.h>
11bd882c8aSJames Wright 
12bd882c8aSJames Wright //------------------------------------------------------------------------------
13bd882c8aSJames Wright // Read from quadrature points
14bd882c8aSJames Wright //------------------------------------------------------------------------------
readQuads(CeedInt N,CeedInt stride,CeedInt offset,const CeedScalar * src,CeedScalar * dest)15bd882c8aSJames Wright inline void readQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) {
16bd882c8aSJames Wright   for (CeedInt i = 0; i < N; ++i) dest[i] = src[stride * i + offset];
17bd882c8aSJames Wright }
18bd882c8aSJames Wright 
19bd882c8aSJames Wright //------------------------------------------------------------------------------
20bd882c8aSJames Wright // Write at quadrature points
21bd882c8aSJames Wright //------------------------------------------------------------------------------
writeQuads(CeedInt N,CeedInt stride,CeedInt offset,const CeedScalar * src,CeedScalar * dest)22bd882c8aSJames Wright inline void writeQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) {
23bd882c8aSJames Wright   for (CeedInt i = 0; i < N; ++i) dest[stride * i + offset] = src[i];
24bd882c8aSJames Wright }
25