1 // Copyright (c) 2017-2026, Lawrence Livermore National Security, LLC and other CEED contributors. 2 // All Rights Reserved. See the top-level LICENSE and NOTICE files for details. 3 // 4 // SPDX-License-Identifier: BSD-2-Clause 5 // 6 // This file is part of CEED: http://github.com/ceed 7 8 #include <ceed-impl.h> 9 10 const char *CeedGitVersion = CEED_GIT_VERSION; 11 const char *CeedBuildConfiguration = CEED_BUILD_CONFIGURATION; 12 13 /// @addtogroup CeedUser 14 /// @{ 15 16 /** 17 @brief Get output of `git describe --dirty` from build time. 18 19 While @ref CeedGetVersion() uniquely identifies the source code for release 20 builds, it does not identify builds from other commits. 21 22 @param[out] git_version A static string containing the Git commit description. 23 24 If `git describe --always --dirty` fails, the string `"unknown"` will be provided. 25 This could occur if Git is not installed or if libCEED is not being built from a repository, for example.` 26 27 @ref Developer 28 29 @sa CeedGetVersion() CeedGetBuildConfiguration() 30 31 @return An error code: 0 - success, otherwise - failure 32 */ 33 int CeedGetGitVersion(const char **git_version) { 34 *git_version = CeedGitVersion; 35 return CEED_ERROR_SUCCESS; 36 } 37 38 /** 39 @brief Set whether or not to use clang when compiling for GPU (instead of nvrtc) 40 41 @param[in] is_clang Whether or not to use clang on GPU 42 43 @ref Developer 44 45 @sa CeedGetIsClang() 46 47 @return An error code: 0 - success, otherwise - failure 48 */ 49 int CeedSetIsClang(Ceed ceed, bool is_clang) { 50 ceed->cuda_compile_with_clang = is_clang; 51 return CEED_ERROR_SUCCESS; 52 } 53 54 /** 55 @brief Determine if the current ceed is set to compile with clang when on GPU 56 57 @param[out] is_clang The location to write the current GPU clang status to 58 59 @ref Developer 60 61 @sa CeedSetIsClang() 62 63 @return An error code: 0 - success, otherwise - failure 64 */ 65 int CeedGetIsClang(Ceed ceed, bool *is_clang) { 66 *is_clang = ceed->cuda_compile_with_clang; 67 return CEED_ERROR_SUCCESS; 68 } 69 70 /** 71 @brief Get build variables as a multi-line string. 72 73 Each line of the string has the format `VARNAME = value`. 74 75 @param[out] build_config A static string containing build variables 76 77 @ref Developer 78 79 @sa CeedGetVersion() CeedGetGitVersion() 80 81 @return An error code: 0 - success, otherwise - failure 82 */ 83 int CeedGetBuildConfiguration(const char **build_config) { 84 *build_config = CeedBuildConfiguration; 85 return CEED_ERROR_SUCCESS; 86 } 87 88 /// @} 89