Skip to content

Commit

Permalink
files: module settings
Browse files Browse the repository at this point in the history
  • Loading branch information
skim0119 committed Jul 13, 2024
1 parent 575997c commit e182636
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 0 deletions.
35 changes: 35 additions & 0 deletions backend/src/ModuleSettings/Parallel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#pragma once

//******************************************************************************
// Includes
//******************************************************************************

namespace elastica {

//============================================================================
//
// PARALLEL CONFIGURATION
//
//============================================================================

#include "Configuration/Parallel.hpp"

//******************************************************************************
/*!\brief Compilation switch for TBB parallelization.
* \ingroup parallel
*
* This compilation switch enables/disables TBB parallelization. In case TBB is
* enabled during compilation, \elastica attempts to parallelize computations,
* if requested by the configuration. In case no parallelization is enabled,
* all computations are performed on a single compute core, even if the
* configuration requests it
*/
#if defined(ELASTICA_USE_SHARED_MEMORY_PARALLELIZATION) && \
defined(ELASTICA_USE_TBB)
#define ELASTICA_TBB_PARALLEL_MODE 1
#else
#define ELASTICA_TBB_PARALLEL_MODE 0
#endif
//****************************************************************************

} // namespace elastica
30 changes: 30 additions & 0 deletions backend/src/ModuleSettings/Systems.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#pragma once

//******************************************************************************
// Includes
//******************************************************************************
#include <cstdlib>

namespace elastica {

//============================================================================
//
// SYSTEMS CONFIGURATION
//
//============================================================================

#include "Configuration/Systems.hpp"

namespace detail {

inline bool systems_warnings_enabled() /* noexcept*/ {
// if set to 0 also return true
if (const char* env_v = std::getenv(ENV_ELASTICA_NO_SYSTEM_WARN))
return not bool(env_v[0]);
else
return true;
}

} // namespace detail

} // namespace elastica
22 changes: 22 additions & 0 deletions backend/src/ModuleSettings/Vectorization.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

//******************************************************************************
// Includes
//******************************************************************************

// Ideally the check here would include system vectorization macro checks, such
// as in blaze.
// But directly including blaze's vectorization also includes intrinsics headers
// which we want to avoid.

//******************************************************************************
/*!\brief Vectorization flag for some Elastica++ kernels
* \ingroup config
*
* This macro enables use of vectorized kernels when available.
*/
#if defined(__APPLE__) && defined(__arm64__)
#define ELASTICA_USE_VECTORIZATION 0
#else
#define ELASTICA_USE_VECTORIZATION BLAZE_USE_VECTORIZATION
#endif
37 changes: 37 additions & 0 deletions backend/src/ModuleSettings/Version.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#pragma once

//******************************************************************************
/*!\brief Major version of \elastica.
* \ingroup config
*
* \details
* This value corresponds to the major version of \elastica. For
* instance, in \elastica version 3.9.0, the ELASTICA_MAJOR_VERSION corresponds
* to 3.
*/
#define ELASTICA_MAJOR_VERSION 0
//******************************************************************************

//******************************************************************************
/*!\brief Minor version of \elastica.
* \ingroup config
*
* \details
* This value corresponds to the minor version of \elastica. For
* instance, in \elastica version 3.9.0, the ELASTICA_MINOR_VERSION corresponds
* to 9.
*/
#define ELASTICA_MINOR_VERSION 0
//******************************************************************************

//******************************************************************************
/*!\brief Patch version of \elastica.
* \ingroup config
*
* \details
* This value corresponds to the patch version of \elastica. For
* instance, in \elastica version 3.9.0, the ELASTICA_PATCH_VERSION corresponds
* to 0.
*/
#define ELASTICA_PATCH_VERSION 2
//******************************************************************************

0 comments on commit e182636

Please sign in to comment.