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 <string.h> 188d713cf6Sjeremylt #include "ceed-xsmm.h" 198d713cf6Sjeremylt 208d713cf6Sjeremylt static int CeedInit_Xsmm_Serial(const char *resource, Ceed ceed) { 218d713cf6Sjeremylt int ierr; 228d713cf6Sjeremylt if (strcmp(resource, "/cpu/self/xsmm/serial")) 238d713cf6Sjeremylt return CeedError(ceed, 1, "serial libXSMM backend cannot use resource: %s", 248d713cf6Sjeremylt resource); 258d713cf6Sjeremylt 268d713cf6Sjeremylt Ceed ceedref; 278d713cf6Sjeremylt 288d713cf6Sjeremylt // Create refrence CEED that implementation will be dispatched 298d713cf6Sjeremylt // through unless overridden 30856142e1Sjeremylt CeedInit("/cpu/self/ref/serial", &ceedref); 318d713cf6Sjeremylt ierr = CeedSetDelegate(ceed, &ceedref); CeedChk(ierr); 328d713cf6Sjeremylt 33*2f86a920SJeremy L Thompson ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "TensorContractCreate", 34*2f86a920SJeremy L Thompson CeedTensorContractCreate_Xsmm); CeedChk(ierr); 358d713cf6Sjeremylt 368d713cf6Sjeremylt return 0; 378d713cf6Sjeremylt } 388d713cf6Sjeremylt 398d713cf6Sjeremylt __attribute__((constructor)) 408d713cf6Sjeremylt static void Register(void) { 418d713cf6Sjeremylt CeedRegister("/cpu/self/xsmm/serial", CeedInit_Xsmm_Serial, 30); 428d713cf6Sjeremylt } 43