184a01de5SJeremy L Thompson // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. 284a01de5SJeremy L Thompson // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. 384a01de5SJeremy L Thompson // All Rights reserved. See files LICENSE and NOTICE for details. 484a01de5SJeremy L Thompson // 584a01de5SJeremy L Thompson // This file is part of CEED, a collection of benchmarks, miniapps, software 684a01de5SJeremy L Thompson // libraries and APIs for efficient high-order finite element and spectral 784a01de5SJeremy L Thompson // element discretizations for exascale applications. For more information and 884a01de5SJeremy L Thompson // source code availability see http://github.com/ceed. 984a01de5SJeremy L Thompson // 1084a01de5SJeremy L Thompson // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 1184a01de5SJeremy L Thompson // a collaborative effort of two U.S. Department of Energy organizations (Office 1284a01de5SJeremy L Thompson // of Science and the National Nuclear Security Administration) responsible for 1384a01de5SJeremy L Thompson // the planning and preparation of a capable exascale ecosystem, including 1484a01de5SJeremy L Thompson // software, applications, hardware, advanced system engineering and early 1584a01de5SJeremy L Thompson // testbed platforms, in support of the nation's exascale computing imperative. 1684a01de5SJeremy L Thompson 1784a01de5SJeremy L Thompson #include "ceed-avx.h" 1884a01de5SJeremy L Thompson 19*f10650afSjeremylt //------------------------------------------------------------------------------ 20*f10650afSjeremylt // Backend Init 21*f10650afSjeremylt //------------------------------------------------------------------------------ 2284a01de5SJeremy L Thompson static int CeedInit_Avx(const char *resource, Ceed ceed) { 2384a01de5SJeremy L Thompson int ierr; 246f7d248dSjeremylt if (strcmp(resource, "/cpu/self") && strcmp(resource, "/cpu/self/avx") 2584a01de5SJeremy L Thompson && strcmp(resource, "/cpu/self/avx/blocked")) 26c042f62fSJeremy L Thompson // LCOV_EXCL_START 2784a01de5SJeremy L Thompson return CeedError(ceed, 1, "AVX backend cannot use resource: %s", resource); 28c042f62fSJeremy L Thompson // LCOV_EXCL_STOP 2984a01de5SJeremy L Thompson 3084a01de5SJeremy L Thompson // Create refrence CEED that implementation will be dispatched 3184a01de5SJeremy L Thompson // through unless overridden 326f7d248dSjeremylt Ceed ceedref; 3389c6efa4Sjeremylt CeedInit("/cpu/self/opt/blocked", &ceedref); 34a4999eddSjeremylt ierr = CeedSetDelegate(ceed, ceedref); CeedChk(ierr); 3584a01de5SJeremy L Thompson 362f86a920SJeremy L Thompson ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "TensorContractCreate", 372f86a920SJeremy L Thompson CeedTensorContractCreate_Avx); CeedChk(ierr); 3884a01de5SJeremy L Thompson return 0; 3984a01de5SJeremy L Thompson } 4084a01de5SJeremy L Thompson 41*f10650afSjeremylt //------------------------------------------------------------------------------ 42*f10650afSjeremylt // Backend Register 43*f10650afSjeremylt //------------------------------------------------------------------------------ 4484a01de5SJeremy L Thompson __attribute__((constructor)) 4584a01de5SJeremy L Thompson static void Register(void) { 4689c6efa4Sjeremylt CeedRegister("/cpu/self/avx/blocked", CeedInit_Avx, 30); 4784a01de5SJeremy L Thompson } 48*f10650afSjeremylt //------------------------------------------------------------------------------ 49