xref: /libCEED/rust/libceed-sys/c-src/backends/xsmm/ceed-xsmm-serial.c (revision 856142e1b942abfda690c8495da63ec0cf28a439)
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
30*856142e1Sjeremylt   CeedInit("/cpu/self/ref/serial", &ceedref);
318d713cf6Sjeremylt   ierr = CeedSetDelegate(ceed, &ceedref); CeedChk(ierr);
328d713cf6Sjeremylt 
338d713cf6Sjeremylt   ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "BasisCreateTensorH1",
348d713cf6Sjeremylt                                 CeedBasisCreateTensorH1_Xsmm); CeedChk(ierr);
358d713cf6Sjeremylt   ierr = CeedSetBackendFunction(ceed, "Ceed", ceed, "BasisCreateH1",
368d713cf6Sjeremylt                                 CeedBasisCreateH1_Xsmm); CeedChk(ierr);
378d713cf6Sjeremylt 
388d713cf6Sjeremylt   return 0;
398d713cf6Sjeremylt }
408d713cf6Sjeremylt 
418d713cf6Sjeremylt __attribute__((constructor))
428d713cf6Sjeremylt static void Register(void) {
438d713cf6Sjeremylt   CeedRegister("/cpu/self/xsmm/serial", CeedInit_Xsmm_Serial, 30);
448d713cf6Sjeremylt }
45