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