11ef3f58fSjeremylt // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. 21ef3f58fSjeremylt // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. 31ef3f58fSjeremylt // All Rights reserved. See files LICENSE and NOTICE for details. 41ef3f58fSjeremylt // 51ef3f58fSjeremylt // This file is part of CEED, a collection of benchmarks, miniapps, software 61ef3f58fSjeremylt // libraries and APIs for efficient high-order finite element and spectral 71ef3f58fSjeremylt // element discretizations for exascale applications. For more information and 81ef3f58fSjeremylt // source code availability see http://github.com/ceed. 91ef3f58fSjeremylt // 101ef3f58fSjeremylt // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 111ef3f58fSjeremylt // a collaborative effort of two U.S. Department of Energy organizations (Office 121ef3f58fSjeremylt // of Science and the National Nuclear Security Administration) responsible for 131ef3f58fSjeremylt // the planning and preparation of a capable exascale ecosystem, including 141ef3f58fSjeremylt // software, applications, hardware, advanced system engineering and early 151ef3f58fSjeremylt // testbed platforms, in support of the nation's exascale computing imperative. 161ef3f58fSjeremylt 171ef3f58fSjeremylt #include "ceed-memcheck.h" 181ef3f58fSjeremylt 19f10650afSjeremylt //------------------------------------------------------------------------------ 20f10650afSjeremylt // Backend Init 21f10650afSjeremylt //------------------------------------------------------------------------------ 221ef3f58fSjeremylt static int CeedInit_Memcheck(const char *resource, Ceed ceed) { 231ef3f58fSjeremylt int ierr; 241ef3f58fSjeremylt if (strcmp(resource, "/cpu/self/memcheck/blocked")) 251ef3f58fSjeremylt // LCOV_EXCL_START 261ef3f58fSjeremylt return CeedError(ceed, 1, "Valgrind Memcheck backend cannot use resource: %s", 271ef3f58fSjeremylt resource); 281ef3f58fSjeremylt // LCOV_EXCL_STOP 291ef3f58fSjeremylt 30*5f67fadeSJeremy L Thompson // Create reference CEED that implementation will be dispatched 311ef3f58fSjeremylt // through unless overridden 321ef3f58fSjeremylt Ceed ceedref; 331ef3f58fSjeremylt CeedInit("/cpu/self/ref/blocked", &ceedref); 341ef3f58fSjeremylt ierr = CeedSetDelegate(ceed, ceedref); CeedChk(ierr); 351ef3f58fSjeremylt 361ef3f58fSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "QFunctionCreate", 371ef3f58fSjeremylt CeedQFunctionCreate_Memcheck); CeedChk(ierr); 381ef3f58fSjeremylt 391ef3f58fSjeremylt return 0; 401ef3f58fSjeremylt } 411ef3f58fSjeremylt 42f10650afSjeremylt //------------------------------------------------------------------------------ 43f10650afSjeremylt // Backend Register 44f10650afSjeremylt //------------------------------------------------------------------------------ 451ef3f58fSjeremylt __attribute__((constructor)) 461ef3f58fSjeremylt static void Register(void) { 471ef3f58fSjeremylt CeedRegister("/cpu/self/memcheck/blocked", CeedInit_Memcheck, 110); 481ef3f58fSjeremylt } 49f10650afSjeremylt //------------------------------------------------------------------------------ 50