xref: /libCEED/backends/memcheck/ceed-memcheck.h (revision dcd9f19c403551effd883234b856bcd9f61ce4a8)
1 // Copyright (c) 2017-2022, 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 #ifndef _ceed_memcheck_h
9 #define _ceed_memcheck_h
10 
11 #include <ceed/backend.h>
12 #include <ceed/ceed.h>
13 
14 typedef struct {
15   int         mem_block_id;
16   CeedScalar *array;
17   CeedScalar *array_allocated;
18   CeedScalar *array_owned;
19   CeedScalar *array_borrowed;
20   CeedScalar *array_read_only_copy;
21 } CeedVector_Memcheck;
22 
23 typedef struct {
24   const CeedScalar **inputs;
25   CeedScalar       **outputs;
26   bool               setup_done;
27 } CeedQFunction_Memcheck;
28 
29 typedef struct {
30   int   mem_block_id;
31   void *data;
32   void *data_allocated;
33   void *data_owned;
34   void *data_borrowed;
35   void *data_read_only_copy;
36 } CeedQFunctionContext_Memcheck;
37 
38 CEED_INTERN int CeedVectorCreate_Memcheck(CeedSize n, CeedVector vec);
39 
40 CEED_INTERN int CeedQFunctionCreate_Memcheck(CeedQFunction qf);
41 
42 CEED_INTERN int CeedQFunctionContextCreate_Memcheck(CeedQFunctionContext ctx);
43 
44 #endif  // _ceed_memcheck_h
45