ceed-memcheck-qfunction.c (7f565272b8651519e1f8332c5b9e73ffa0fc04e9) ceed-memcheck-qfunction.c (bf4cb66493dbcc06b8d25c9c91cf89fe1cab7c9b)
1// Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
2// Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
3// All Rights reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

--- 80 unchanged lines hidden (view full) ---

89//------------------------------------------------------------------------------
90int CeedQFunctionCreate_Memcheck(CeedQFunction qf) {
91 int ierr;
92 Ceed ceed;
93 ierr = CeedQFunctionGetCeed(qf, &ceed); CeedChkBackend(ierr);
94
95 CeedQFunction_Memcheck *impl;
96 ierr = CeedCalloc(1, &impl); CeedChkBackend(ierr);
1// Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC.
2// Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707.
3// All Rights reserved. See files LICENSE and NOTICE for details.
4//
5// This file is part of CEED, a collection of benchmarks, miniapps, software
6// libraries and APIs for efficient high-order finite element and spectral
7// element discretizations for exascale applications. For more information and
8// source code availability see http://github.com/ceed.

--- 80 unchanged lines hidden (view full) ---

89//------------------------------------------------------------------------------
90int CeedQFunctionCreate_Memcheck(CeedQFunction qf) {
91 int ierr;
92 Ceed ceed;
93 ierr = CeedQFunctionGetCeed(qf, &ceed); CeedChkBackend(ierr);
94
95 CeedQFunction_Memcheck *impl;
96 ierr = CeedCalloc(1, &impl); CeedChkBackend(ierr);
97 ierr = CeedCalloc(16, &impl->inputs); CeedChkBackend(ierr);
98 ierr = CeedCalloc(16, &impl->outputs); CeedChkBackend(ierr);
97 ierr = CeedCalloc(CEED_FIELD_MAX, &impl->inputs); CeedChkBackend(ierr);
98 ierr = CeedCalloc(CEED_FIELD_MAX, &impl->outputs); CeedChkBackend(ierr);
99 ierr = CeedQFunctionSetData(qf, impl); CeedChkBackend(ierr);
100
101 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Apply",
102 CeedQFunctionApply_Memcheck); CeedChkBackend(ierr);
103 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Destroy",
104 CeedQFunctionDestroy_Memcheck); CeedChkBackend(ierr);
105
106 return CEED_ERROR_SUCCESS;
107}
108//------------------------------------------------------------------------------
99 ierr = CeedQFunctionSetData(qf, impl); CeedChkBackend(ierr);
100
101 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Apply",
102 CeedQFunctionApply_Memcheck); CeedChkBackend(ierr);
103 ierr = CeedSetBackendFunction(ceed, "QFunction", qf, "Destroy",
104 CeedQFunctionDestroy_Memcheck); CeedChkBackend(ierr);
105
106 return CEED_ERROR_SUCCESS;
107}
108//------------------------------------------------------------------------------