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 17*3d576824SJeremy L Thompson #include <ceed.h> 18*3d576824SJeremy L Thompson #include <ceed-backend.h> 19*3d576824SJeremy L Thompson #include <stdbool.h> 20*3d576824SJeremy L Thompson #include <string.h> 218d713cf6Sjeremylt #include "ceed-xsmm.h" 228d713cf6Sjeremylt 23f10650afSjeremylt //------------------------------------------------------------------------------ 24f10650afSjeremylt // Backend Init 25f10650afSjeremylt //------------------------------------------------------------------------------ 268d713cf6Sjeremylt static int CeedInit_Xsmm_Blocked(const char *resource, Ceed ceed) { 278d713cf6Sjeremylt int ierr; 286f7d248dSjeremylt if (strcmp(resource, "/cpu/self") && strcmp(resource, "/cpu/self/xsmm") 29e0fc0447Sjeremylt && strcmp(resource, "/cpu/self/xsmm/blocked")) 30c042f62fSJeremy L Thompson // LCOV_EXCL_START 318d713cf6Sjeremylt return CeedError(ceed, 1, "blocked libXSMM backend cannot use resource: %s", 328d713cf6Sjeremylt resource); 33c042f62fSJeremy L Thompson // LCOV_EXCL_STOP 349525855cSJeremy L Thompson ierr = CeedSetDeterministic(ceed, true); CeedChk(ierr); 358d713cf6Sjeremylt 365f67fadeSJeremy L Thompson // Create reference CEED that implementation will be dispatched 378d713cf6Sjeremylt // through unless overridden 386f7d248dSjeremylt Ceed ceedref; 3989c6efa4Sjeremylt CeedInit("/cpu/self/opt/blocked", &ceedref); 40a4999eddSjeremylt ierr = CeedSetDelegate(ceed, ceedref); CeedChk(ierr); 418d713cf6Sjeremylt 422f86a920SJeremy L Thompson ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "TensorContractCreate", 432f86a920SJeremy L Thompson CeedTensorContractCreate_Xsmm); CeedChk(ierr); 448d713cf6Sjeremylt 458d713cf6Sjeremylt return 0; 468d713cf6Sjeremylt } 478d713cf6Sjeremylt 48f10650afSjeremylt //------------------------------------------------------------------------------ 49f10650afSjeremylt // Backend Register 50f10650afSjeremylt //------------------------------------------------------------------------------ 511d013790SJed Brown CEED_INTERN int CeedRegister_Xsmm_Blocked(void) { 521d013790SJed Brown return CeedRegister("/cpu/self/xsmm/blocked", CeedInit_Xsmm_Blocked, 20); 538d713cf6Sjeremylt } 54f10650afSjeremylt //------------------------------------------------------------------------------ 55