1 // Copyright (c) 2017-2018, Lawrence Livermore National Security, LLC. 2 // Produced at the Lawrence Livermore National Laboratory. LLNL-CODE-734707. 3 // All Rights reserved. See files LICENSE and NOTICE for details. 4 // 5 // This file is part of CEED, a collection of benchmarks, miniapps, software 6 // libraries and APIs for efficient high-order finite element and spectral 7 // element discretizations for exascale applications. For more information and 8 // source code availability see http://github.com/ceed. 9 // 10 // The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 11 // a collaborative effort of two U.S. Department of Energy organizations (Office 12 // of Science and the National Nuclear Security Administration) responsible for 13 // the planning and preparation of a capable exascale ecosystem, including 14 // software, applications, hardware, advanced system engineering and early 15 // testbed platforms, in support of the nation's exascale computing imperative. 16 17 #ifndef _ceed_xsmm_h 18 #define _ceed_xsmm_h 19 20 #define LIBXSMM_VERSION_GE(major, minor, update, patch) \ 21 (LIBXSMM_VERSION_MAJOR > major || \ 22 (LIBXSMM_VERSION_MAJOR == major && \ 23 (LIBXSMM_VERSION_MINOR > minor || \ 24 (LIBXSMM_VERSION_MINOR == minor && \ 25 (LIBXSMM_VERSION_UPDATE > update || \ 26 (LIBXSMM_VERSION_UPDATE == update && LIBXSMM_VERSION_PATCH >= patch )))))) 27 28 #if LIBXSMM_VERSION_GE(1, 17, 0, 0) 29 # define LIBXSMM_MMFUNCTION_KERNEL(a, b, c) kernel(a, b, c) 30 #else 31 # define LIBXSMM_MMFUNCTION_KERNEL(a, b, c) kernel(a, b, c, NULL, NULL, NULL) 32 #endif 33 34 #include <ceed/ceed.h> 35 #include <ceed/backend.h> 36 #include <ceed/hash.h> 37 #include <libxsmm.h> 38 39 // Instantiate khash structs and methods 40 CeedHashIJKLMInit(f32, libxsmm_smmfunction) 41 CeedHashIJKLMInit(f64, libxsmm_dmmfunction) 42 43 typedef struct { 44 bool is_tensor; 45 CeedInt P, Q, dim; 46 khash_t(f32) *lookup_f32; 47 khash_t(f64) *lookup_f64; 48 } CeedTensorContract_Xsmm; 49 50 CEED_INTERN int CeedTensorContractCreate_f32_Xsmm(CeedBasis basis, 51 CeedTensorContract contract); 52 53 CEED_INTERN int CeedTensorContractCreate_f64_Xsmm(CeedBasis basis, 54 CeedTensorContract contract); 55 56 #endif // _ceed_xsmm_h 57