10c784865Scamierjs // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. 20c784865Scamierjs // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. 30c784865Scamierjs // All Rights reserved. See files LICENSE and NOTICE for details. 4ae3cba82Scamierjs // 5ae3cba82Scamierjs // This file is part of CEED, a collection of benchmarks, miniapps, software 6ae3cba82Scamierjs // libraries and APIs for efficient high-order finite element and spectral 7ae3cba82Scamierjs // element discretizations for exascale applications. For more information and 8ae3cba82Scamierjs // source code availability see http://github.com/ceed. 9ae3cba82Scamierjs // 10ae3cba82Scamierjs // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 11ae3cba82Scamierjs // a collaborative effort of two U.S. Department of Energy organizations (Office 12ae3cba82Scamierjs // of Science and the National Nuclear Security Administration) responsible for 13ae3cba82Scamierjs // the planning and preparation of a capable exascale ecosystem, including 14ae3cba82Scamierjs // software, applications, hardware, advanced system engineering and early 15ae3cba82Scamierjs // testbed platforms, in support of the nation's exascale computing imperative. 16ae3cba82Scamierjs 17ae3cba82Scamierjs #include <string.h> 1821617c04Sjeremylt #include "ceed-ref.h" 19ae3cba82Scamierjs 20ae3cba82Scamierjs static int CeedInit_Ref(const char *resource, Ceed ceed) { 21fe2413ffSjeremylt int ierr; 22ae3cba82Scamierjs if (strcmp(resource, "/cpu/self") 23ae3cba82Scamierjs && strcmp(resource, "/cpu/self/ref")) 24ae3cba82Scamierjs return CeedError(ceed, 1, "Ref backend cannot use resource: %s", resource); 25fe2413ffSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "VecCreate", 26fe2413ffSjeremylt CeedVectorCreate_Ref); CeedChk(ierr); 27fe2413ffSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "BasisCreateTensorH1", 28fe2413ffSjeremylt CeedBasisCreateTensorH1_Ref); CeedChk(ierr); 29fe2413ffSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "BasisCreateH1", 30fe2413ffSjeremylt CeedBasisCreateH1_Ref); CeedChk(ierr); 31fe2413ffSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "ElemRestrictionCreate", 32fe2413ffSjeremylt CeedElemRestrictionCreate_Ref); CeedChk(ierr); 33*1dfeef1dSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, 34*1dfeef1dSjeremylt "ElemRestrictionCreateBlocked", 35fe2413ffSjeremylt CeedElemRestrictionCreate_Ref); CeedChk(ierr); 36fe2413ffSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "QFunctionCreate", 37fe2413ffSjeremylt CeedQFunctionCreate_Ref); CeedChk(ierr); 38fe2413ffSjeremylt ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "OperatorCreate", 39fe2413ffSjeremylt CeedOperatorCreate_Ref); CeedChk(ierr); 40ae3cba82Scamierjs return 0; 41ae3cba82Scamierjs } 42ae3cba82Scamierjs 43ae3cba82Scamierjs __attribute__((constructor)) 44ae3cba82Scamierjs static void Register(void) { 459ddbf157Sjeremylt //! [Register] 4644951fc6Sjeremylt CeedRegister("/cpu/self/ref", CeedInit_Ref, 20); 479ddbf157Sjeremylt //! [Register] 48ae3cba82Scamierjs } 49