18d713cf6Sjeremylt // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. 28d713cf6Sjeremylt // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. 38d713cf6Sjeremylt // All Rights reserved. See files LICENSE and NOTICE for details. 48d713cf6Sjeremylt // 58d713cf6Sjeremylt // This file is part of CEED, a collection of benchmarks, miniapps, software 68d713cf6Sjeremylt // libraries and APIs for efficient high-order finite element and spectral 78d713cf6Sjeremylt // element discretizations for exascale applications. For more information and 88d713cf6Sjeremylt // source code availability see http://github.com/ceed. 98d713cf6Sjeremylt // 108d713cf6Sjeremylt // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 118d713cf6Sjeremylt // a collaborative effort of two U.S. Department of Energy organizations (Office 128d713cf6Sjeremylt // of Science and the National Nuclear Security Administration) responsible for 138d713cf6Sjeremylt // the planning and preparation of a capable exascale ecosystem, including 148d713cf6Sjeremylt // software, applications, hardware, advanced system engineering and early 158d713cf6Sjeremylt // testbed platforms, in support of the nation's exascale computing imperative. 168d713cf6Sjeremylt 178d713cf6Sjeremylt #include "ceed-xsmm.h" 188d713cf6Sjeremylt 198d713cf6Sjeremylt static int CeedInit_Xsmm_Serial(const char *resource, Ceed ceed) { 208d713cf6Sjeremylt int ierr; 218d713cf6Sjeremylt if (strcmp(resource, "/cpu/self/xsmm/serial")) 228d713cf6Sjeremylt return CeedError(ceed, 1, "serial libXSMM backend cannot use resource: %s", 238d713cf6Sjeremylt resource); 248d713cf6Sjeremylt 258d713cf6Sjeremylt Ceed ceedref; 268d713cf6Sjeremylt 278d713cf6Sjeremylt // Create refrence CEED that implementation will be dispatched 288d713cf6Sjeremylt // through unless overridden 29*89c6efa4Sjeremylt CeedInit("/cpu/self/opt/serial", &ceedref); 308d713cf6Sjeremylt ierr = CeedSetDelegate(ceed, &ceedref); CeedChk(ierr); 318d713cf6Sjeremylt 322f86a920SJeremy L Thompson ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "TensorContractCreate", 332f86a920SJeremy L Thompson CeedTensorContractCreate_Xsmm); CeedChk(ierr); 348d713cf6Sjeremylt 358d713cf6Sjeremylt return 0; 368d713cf6Sjeremylt } 378d713cf6Sjeremylt 388d713cf6Sjeremylt __attribute__((constructor)) 398d713cf6Sjeremylt static void Register(void) { 40*89c6efa4Sjeremylt CeedRegister("/cpu/self/xsmm/serial", CeedInit_Xsmm_Serial, 25); 418d713cf6Sjeremylt } 42