Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ FetchContent_MakeAvailable(Catch2 GSL mimicpp)

include(Modules/private/CreateClangTidyTargets.cmake)
include(Modules/private/CreateCoverageTargets.cmake)
include(Modules/private/PhlexSymbolVisibility.cmake)

option(ENABLE_TSAN "Enable Thread Sanitizer" OFF)
option(ENABLE_ASAN "Enable Address Sanitizer" OFF)
Expand Down
26 changes: 26 additions & 0 deletions Modules/private/PhlexSymbolVisibility.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
include(GenerateExportHeader)

function(phlex_apply_symbol_visibility target)
set(EXPORT_HEADER "${PROJECT_BINARY_DIR}/include/${target}_export.hpp")
set(EXPORT_MACRO_NAME "${target}_EXPORT")

generate_export_header(
${target}
BASE_NAME ${target}
EXPORT_FILE_NAME ${EXPORT_HEADER}
EXPORT_MACRO_NAME ${EXPORT_MACRO_NAME}
STATIC_DEFINE "${target}_STATIC_DEFINE"
)

set_target_properties(
${target}
PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON
)

target_include_directories(
${target}
PUBLIC $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include> $<INSTALL_INTERFACE:include>
)

install(FILES "${EXPORT_HEADER}" DESTINATION include)
endfunction()
1 change: 1 addition & 0 deletions phlex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ cet_make_library(
Boost::json
phlex::core
)
phlex_apply_symbol_visibility(phlex_configuration_internal)

cet_make_library(
LIBRARY_NAME
Expand Down
1 change: 1 addition & 0 deletions phlex/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cet_make_library(
Boost::json
Boost::boost
)
phlex_apply_symbol_visibility(run_phlex)

install(FILES load_module.hpp run.hpp version.hpp DESTINATION include/phlex/app)

Expand Down
15 changes: 11 additions & 4 deletions phlex/app/load_module.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef PHLEX_APP_LOAD_MODULE_HPP
#define PHLEX_APP_LOAD_MODULE_HPP

#include "run_phlex_export.hpp"

#include "phlex/core/fwd.hpp"
#include "phlex/driver.hpp"

Expand All @@ -12,12 +14,17 @@ namespace phlex::experimental {
namespace detail {
// Adjust_config adds the module_label as a parameter, and it checks if the 'py'
// parameter exists, inserting the 'cpp: "pymodule"' configuration if necessary.
boost::json::object adjust_config(std::string const& label, boost::json::object raw_config);
run_phlex_EXPORT boost::json::object adjust_config(std::string const& label,
boost::json::object raw_config);
}

void load_module(framework_graph& g, std::string const& label, boost::json::object config);
void load_source(framework_graph& g, std::string const& label, boost::json::object config);
detail::next_index_t load_driver(boost::json::object const& config);
run_phlex_EXPORT void load_module(framework_graph& g,
std::string const& label,
boost::json::object config);
run_phlex_EXPORT void load_source(framework_graph& g,
std::string const& label,
boost::json::object config);
run_phlex_EXPORT detail::next_index_t load_driver(boost::json::object const& config);
}

#endif // PHLEX_APP_LOAD_MODULE_HPP
4 changes: 3 additions & 1 deletion phlex/app/run.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#ifndef PHLEX_APP_RUN_HPP
#define PHLEX_APP_RUN_HPP

#include "run_phlex_export.hpp"

#include "boost/json.hpp"

#include <optional>

namespace phlex::experimental {
void run(boost::json::object const& configurations, int max_parallelism);
run_phlex_EXPORT void run(boost::json::object const& configurations, int max_parallelism);
}

#endif // PHLEX_APP_RUN_HPP
4 changes: 3 additions & 1 deletion phlex/app/version.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef PHLEX_APP_VERSION_HPP
#define PHLEX_APP_VERSION_HPP

#include "run_phlex_export.hpp"

namespace phlex::experimental {
char const* version();
run_phlex_EXPORT char const* version();
}
#endif // PHLEX_APP_VERSION_HPP
4 changes: 3 additions & 1 deletion phlex/concurrency.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#ifndef PHLEX_CONCURRENCY_HPP
#define PHLEX_CONCURRENCY_HPP

#include "phlex_core_export.hpp"

#include <cstddef>

namespace phlex {
struct concurrency {
struct phlex_core_EXPORT concurrency {
static concurrency const unlimited;
static concurrency const serial;

Expand Down
20 changes: 11 additions & 9 deletions phlex/configuration.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef PHLEX_CONFIGURATION_HPP
#define PHLEX_CONFIGURATION_HPP

#include "phlex_configuration_internal_export.hpp"

#include "boost/json.hpp"
#include "phlex/core/product_query.hpp"
#include "phlex/model/identifier.hpp"
Expand All @@ -22,8 +24,8 @@ namespace phlex {
}

// Used later for product_query
std::optional<phlex::experimental::identifier> value_if_exists(boost::json::object const& obj,
std::string_view parameter);
phlex_configuration_internal_EXPORT std::optional<phlex::experimental::identifier>
value_if_exists(boost::json::object const& obj, std::string_view parameter);

// helper for unpacking json array
template <typename T, std::size_t... I>
Expand All @@ -34,7 +36,7 @@ namespace phlex {
}
}

class configuration {
class phlex_configuration_internal_EXPORT configuration {
public:
configuration() = default;
explicit configuration(boost::json::object const& config) : config_{config} {}
Expand Down Expand Up @@ -89,15 +91,15 @@ namespace phlex {
// To enable direct conversions from Boost JSON types to our own types, we implement
// tag_invoke(...) function overloads, which are the customization points Boost JSON
// provides.
configuration tag_invoke(boost::json::value_to_tag<configuration> const&,
boost::json::value const& jv);
phlex_configuration_internal_EXPORT configuration
tag_invoke(boost::json::value_to_tag<configuration> const&, boost::json::value const& jv);

product_query tag_invoke(boost::json::value_to_tag<product_query> const&,
boost::json::value const& jv);
phlex_configuration_internal_EXPORT product_query
tag_invoke(boost::json::value_to_tag<product_query> const&, boost::json::value const& jv);

namespace experimental {
identifier tag_invoke(boost::json::value_to_tag<identifier> const&,
boost::json::value const& jv);
phlex_configuration_internal_EXPORT identifier
tag_invoke(boost::json::value_to_tag<identifier> const&, boost::json::value const& jv);
}

template <std::size_t N>
Expand Down
1 change: 1 addition & 0 deletions phlex/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ cet_make_library(
Boost::json
spdlog::spdlog
)
phlex_apply_symbol_visibility(phlex_core)
install(
FILES
concepts.hpp
Expand Down
3 changes: 2 additions & 1 deletion phlex/core/consumer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
#define PHLEX_CORE_CONSUMER_HPP

#include "phlex/model/algorithm_name.hpp"
#include "phlex_core_export.hpp"

#include <string>
#include <vector>

namespace phlex::experimental {
class consumer {
class phlex_core_EXPORT consumer {
public:
consumer(algorithm_name name, std::vector<std::string> predicates);

Expand Down
3 changes: 2 additions & 1 deletion phlex/core/declared_fold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "phlex/model/product_specification.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex/utilities/simple_ptr_map.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/concurrent_unordered_map.h"
#include "oneapi/tbb/flow_graph.h"
Expand All @@ -33,7 +34,7 @@
#include <utility>

namespace phlex::experimental {
class declared_fold : public products_consumer {
class phlex_core_EXPORT declared_fold : public products_consumer {
public:
declared_fold(algorithm_name name,
std::vector<std::string> predicates,
Expand Down
3 changes: 2 additions & 1 deletion phlex/core/declared_observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "phlex/model/product_specification.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex/utilities/simple_ptr_map.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/concurrent_hash_map.h"
#include "oneapi/tbb/flow_graph.h"
Expand All @@ -30,7 +31,7 @@

namespace phlex::experimental {

class declared_observer : public products_consumer {
class phlex_core_EXPORT declared_observer : public products_consumer {
public:
declared_observer(algorithm_name name,
std::vector<std::string> predicates,
Expand Down
3 changes: 2 additions & 1 deletion phlex/core/declared_output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "phlex/model/algorithm_name.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex/utilities/simple_ptr_map.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/flow_graph.h"

Expand All @@ -20,7 +21,7 @@ namespace phlex::experimental {
namespace detail {
using output_function_t = std::function<void(product_store const&)>;
}
class declared_output : public consumer {
class phlex_core_EXPORT declared_output : public consumer {
public:
declared_output(algorithm_name name,
std::size_t concurrency,
Expand Down
3 changes: 2 additions & 1 deletion phlex/core/declared_predicate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "phlex/model/handle.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex/utilities/simple_ptr_map.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/concurrent_hash_map.h"
#include "oneapi/tbb/flow_graph.h"
Expand All @@ -33,7 +34,7 @@

namespace phlex::experimental {

class declared_predicate : public products_consumer {
class phlex_core_EXPORT declared_predicate : public products_consumer {
public:
declared_predicate(algorithm_name name,
std::vector<std::string> predicates,
Expand Down
3 changes: 2 additions & 1 deletion phlex/core/declared_provider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "phlex/model/product_specification.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex/utilities/simple_ptr_map.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/concurrent_hash_map.h"
#include "oneapi/tbb/concurrent_unordered_map.h"
Expand All @@ -26,7 +27,7 @@

namespace phlex::experimental {

class declared_provider {
class phlex_core_EXPORT declared_provider {
public:
declared_provider(algorithm_name name, product_query output_product);
virtual ~declared_provider();
Expand Down
3 changes: 2 additions & 1 deletion phlex/core/declared_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "phlex/model/product_specification.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex/utilities/simple_ptr_map.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/concurrent_hash_map.h"
#include "oneapi/tbb/concurrent_unordered_map.h"
Expand All @@ -37,7 +38,7 @@

namespace phlex::experimental {

class declared_transform : public products_consumer {
class phlex_core_EXPORT declared_transform : public products_consumer {
public:
declared_transform(algorithm_name name,
std::vector<std::string> predicates,
Expand Down
5 changes: 3 additions & 2 deletions phlex/core/declared_unfold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "phlex/model/product_specification.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex/utilities/simple_ptr_map.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/concurrent_hash_map.h"
#include "oneapi/tbb/flow_graph.h"
Expand All @@ -32,7 +33,7 @@

namespace phlex::experimental {

class generator {
class phlex_core_EXPORT generator {
public:
explicit generator(product_store_const_ptr const& parent,
std::string node_name,
Expand All @@ -53,7 +54,7 @@ namespace phlex::experimental {
std::map<data_cell_index::hash_type, std::size_t> child_counts_;
};

class declared_unfold : public products_consumer {
class phlex_core_EXPORT declared_unfold : public products_consumer {
public:
declared_unfold(algorithm_name name,
std::vector<std::string> predicates,
Expand Down
5 changes: 3 additions & 2 deletions phlex/core/detail/filter_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "phlex/core/fwd.hpp"
#include "phlex/core/product_query.hpp"
#include "phlex/model/product_store.hpp"
#include "phlex_core_export.hpp"

#include "oneapi/tbb/concurrent_hash_map.h"

Expand All @@ -29,7 +30,7 @@ namespace phlex::experimental {
return value == true_value;
}

class decision_map {
class phlex_core_EXPORT decision_map {
using decisions_t = oneapi::tbb::concurrent_hash_map<std::size_t, unsigned int>;

public:
Expand All @@ -47,7 +48,7 @@ namespace phlex::experimental {
decisions_t results_;
};

class data_map {
class phlex_core_EXPORT data_map {
using stores_t =
oneapi::tbb::concurrent_hash_map<std::size_t, std::vector<product_store_const_ptr>>;

Expand Down
5 changes: 4 additions & 1 deletion phlex/core/detail/make_algorithm_name.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <string>

#include "phlex_core_export.hpp"

namespace phlex {
class configuration;
}
Expand All @@ -14,7 +16,8 @@ namespace phlex::experimental {
class algorithm_name;

namespace detail {
algorithm_name make_algorithm_name(configuration const* config, std::string name);
phlex_core_EXPORT algorithm_name make_algorithm_name(configuration const* config,
std::string name);
}
}

Expand Down
5 changes: 4 additions & 1 deletion phlex/core/detail/maybe_predicates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
#include <string>
#include <vector>

#include "phlex_core_export.hpp"

namespace phlex {
class configuration;
}

namespace phlex::experimental::detail {
std::optional<std::vector<std::string>> maybe_predicates(configuration const* config);
phlex_core_EXPORT std::optional<std::vector<std::string>> maybe_predicates(
configuration const* config);
}

#endif // PHLEX_CORE_DETAIL_MAYBE_PREDICATES_HPP
Loading
Loading