22#include "config/config-features.hpp"
23#include "config/config-features.impl.hpp"
24#include "config/version.hpp"
27#include <boost/algorithm/string/join.hpp>
32#include <unordered_set>
39 return std::vector<std::string>{ptr, ptr +
len};
43 return std::unordered_set<std::string>(ptr, ptr +
len);
47 if (
name ==
"features") {
50 if (
name ==
"all_features") {
54 if (
name ==
"build_type") {
57 if (
name ==
"scafacos_methods") {
58#ifdef ESPRESSO_SCAFACOS
64 if (
name ==
"has_fast_math") {
65#if defined(__FAST_MATH__)
71 if (
name ==
"toolchain") {
72#define ESPRESSO_REGISTER_METADATA(name) \
73 flat_map[#name] = serializer(ESPRESSO_##name);
75 auto const serializer = [](std::string
const value) {
77 if (
not value.empty()) {
107 return "Unknown feature '" +
feature +
"'";
114 return "Missing features " + boost::algorithm::join(
missing_features,
", ");
121 if (
not error_msg.empty()) {
122 throw std::runtime_error(error_msg);
#define ESPRESSO_REGISTER_METADATA(name)
Variant do_call_method(std::string const &name, VariantMap const ¶meters) override
Type to indicate no value in Variant.
std::string_view name() const
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
static auto get_feature_set(char const *const ptr[], std::size_t len)
void check_features(std::vector< std::string > const &features)
Throw an exception when a feature is missing or not recognized.
std::string check_features_msg(std::vector< std::string > const &features)
Generate a message when a feature is missing or not recognized.
static auto get_feature_vector(char const *const ptr[], std::size_t len)
std::vector< std::string > available_methods()
Fetch list of methods compiled in ScaFaCoS.
std::unordered_map< std::string, Variant > VariantMap
auto make_vector_of_variants(std::vector< T > const &v)
Recursive variant implementation.