13d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors. 23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3fc7cf9a0Sjeremylt // 43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause 5fc7cf9a0Sjeremylt // 63d8e8822SJeremy L Thompson // This file is part of CEED: http://github.com/ceed 7fc7cf9a0Sjeremylt 83d576824SJeremy L Thompson #ifndef _ceed_memcheck_h 93d576824SJeremy L Thompson #define _ceed_memcheck_h 103d576824SJeremy L Thompson 11ec3da8bcSJed Brown #include <ceed/backend.h> 122b730f8bSJeremy L Thompson #include <ceed/ceed.h> 13fc7cf9a0Sjeremylt 14fc7cf9a0Sjeremylt typedef struct { 15*9798701eSJeremy L Thompson int mem_block_id; 16*9798701eSJeremy L Thompson CeedScalar *array; 17*9798701eSJeremy L Thompson CeedScalar *array_allocated; 18*9798701eSJeremy L Thompson CeedScalar *array_owned; 19*9798701eSJeremy L Thompson CeedScalar *array_borrowed; 20*9798701eSJeremy L Thompson CeedScalar *array_read_only_copy; 21*9798701eSJeremy L Thompson } CeedVector_Memcheck; 22*9798701eSJeremy L Thompson 23*9798701eSJeremy L Thompson typedef struct { 24fc7cf9a0Sjeremylt const CeedScalar **inputs; 25fc7cf9a0Sjeremylt CeedScalar **outputs; 26d1d35e2fSjeremylt bool setup_done; 27fc7cf9a0Sjeremylt } CeedQFunction_Memcheck; 28fc7cf9a0Sjeremylt 290f58c348SJeremy L Thompson typedef struct { 300f58c348SJeremy L Thompson int mem_block_id; 310f58c348SJeremy L Thompson void *data; 320f58c348SJeremy L Thompson void *data_allocated; 330f58c348SJeremy L Thompson void *data_owned; 348e457467SJeremy L Thompson void *data_borrowed; 358e457467SJeremy L Thompson void *data_read_only_copy; 360f58c348SJeremy L Thompson } CeedQFunctionContext_Memcheck; 370f58c348SJeremy L Thompson 38*9798701eSJeremy L Thompson CEED_INTERN int CeedVectorCreate_Memcheck(CeedSize n, CeedVector vec); 39*9798701eSJeremy L Thompson 40fc7cf9a0Sjeremylt CEED_INTERN int CeedQFunctionCreate_Memcheck(CeedQFunction qf); 413d576824SJeremy L Thompson 420f58c348SJeremy L Thompson CEED_INTERN int CeedQFunctionContextCreate_Memcheck(CeedQFunctionContext ctx); 430f58c348SJeremy L Thompson 443d576824SJeremy L Thompson #endif // _ceed_memcheck_h 45