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 8*49ed4312SSebastian Grimberg /// @file 9*49ed4312SSebastian Grimberg /// Internal header for SYCL backend QFunction read/write kernels 10*49ed4312SSebastian Grimberg #ifndef _ceed_sycl_ref_qfunction_h 11*49ed4312SSebastian Grimberg #define _ceed_sycl_ref_qfunction_h 12*49ed4312SSebastian Grimberg 13bd882c8aSJames Wright #include <ceed.h> 14bd882c8aSJames Wright 15bd882c8aSJames Wright //------------------------------------------------------------------------------ 16bd882c8aSJames Wright // Read from quadrature points 17bd882c8aSJames Wright //------------------------------------------------------------------------------ 18bd882c8aSJames Wright inline void readQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) { 19bd882c8aSJames Wright for (CeedInt i = 0; i < N; ++i) dest[i] = src[stride * i + offset]; 20bd882c8aSJames Wright } 21bd882c8aSJames Wright 22bd882c8aSJames Wright //------------------------------------------------------------------------------ 23bd882c8aSJames Wright // Write at quadrature points 24bd882c8aSJames Wright //------------------------------------------------------------------------------ 25bd882c8aSJames Wright inline void writeQuads(CeedInt N, CeedInt stride, CeedInt offset, const CeedScalar *src, CeedScalar *dest) { 26bd882c8aSJames Wright for (CeedInt i = 0; i < N; ++i) dest[stride * i + offset] = src[i]; 27bd882c8aSJames Wright } 28ff1e7120SSebastian Grimberg 29bd882c8aSJames Wright //------------------------------------------------------------------------------ 30*49ed4312SSebastian Grimberg 31*49ed4312SSebastian Grimberg #endif 32