Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterative improvements #102

Merged
merged 11 commits into from
Feb 26, 2021
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

project(heyoka VERSION 0.5.0 LANGUAGES CXX C)
project(heyoka VERSION 0.6.0 LANGUAGES CXX C)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/yacma")

Expand Down Expand Up @@ -207,8 +207,8 @@ if(HEYOKA_BUILD_STATIC_LIBRARY)
else()
# Setup of the heyoka shared library.
add_library(heyoka SHARED "${HEYOKA_SRC_FILES}")
set_property(TARGET heyoka PROPERTY VERSION "5.0")
set_property(TARGET heyoka PROPERTY SOVERSION 5)
set_property(TARGET heyoka PROPERTY VERSION "6.0")
set_property(TARGET heyoka PROPERTY SOVERSION 6)
set_target_properties(heyoka PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(heyoka PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE)
endif()
Expand Down Expand Up @@ -311,12 +311,10 @@ find_package(fmt REQUIRED CONFIG)
target_link_libraries(heyoka PRIVATE fmt::fmt)

# Mandatory dependency on Boost.
find_package(Boost 1.60 REQUIRED COMPONENTS filesystem)
find_package(Boost 1.60 REQUIRED)

# Public dependency on the headers, private dependency
# on filesystem.
# Public dependency on the headers.
target_link_libraries(heyoka PUBLIC Boost::boost)
target_link_libraries(heyoka PRIVATE Boost::filesystem)
# NOTE: quench warnings from Boost when building the library.
target_compile_definitions(heyoka PRIVATE BOOST_ALLOW_DEPRECATED_HEADERS)

Expand Down
18 changes: 18 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
Changelog
=========

0.6.0 (unreleased)
------------------

New
~~~

- Speed-up the deep copy of just-in-time-compiled
objects such as ``llvm_state`` and ``taylor_adaptive``
(`#102 <https://github.com/bluescarni/heyoka/pull/102>`__).

Fix
~~~

- In the batch integrator class, the outcomes in the result vectors
are now initialised to ``taylor_outcome::success`` instead of
meaningless values
(`#102 <https://github.com/bluescarni/heyoka/pull/102>`__).

0.5.0 (2021-02-25)
------------------

Expand Down
21 changes: 7 additions & 14 deletions include/heyoka/llvm_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ namespace kw
IGOR_MAKE_NAMED_ARGUMENT(mname);
IGOR_MAKE_NAMED_ARGUMENT(opt_level);
IGOR_MAKE_NAMED_ARGUMENT(fast_math);
IGOR_MAKE_NAMED_ARGUMENT(save_object_code);
IGOR_MAKE_NAMED_ARGUMENT(inline_functions);

} // namespace kw
Expand All @@ -72,8 +71,6 @@ class HEYOKA_DLL_PUBLIC llvm_state
std::string m_ir_snapshot;
bool m_fast_math;
std::string m_module_name;
bool m_save_object_code;
std::string m_object_code;
bool m_inline_functions;

// Check functions.
Expand Down Expand Up @@ -118,15 +115,6 @@ class HEYOKA_DLL_PUBLIC llvm_state
}
}();

// Save object code (defaults to false).
auto socode = [&p]() -> bool {
if constexpr (p.has(kw::save_object_code)) {
return std::forward<decltype(p(kw::save_object_code))>(p(kw::save_object_code));
} else {
return false;
}
}();

// Inline functions (defaults to true).
auto i_func = [&p]() -> bool {
if constexpr (p.has(kw::inline_functions)) {
Expand All @@ -136,10 +124,14 @@ class HEYOKA_DLL_PUBLIC llvm_state
}
}();

return std::tuple{std::move(mod_name), opt_level, fmath, socode, i_func};
return std::tuple{std::move(mod_name), opt_level, fmath, i_func};
}
}
explicit llvm_state(std::tuple<std::string, unsigned, bool, bool, bool> &&);
explicit llvm_state(std::tuple<std::string, unsigned, bool, bool> &&);

// Small shared helper to setup the math flags in the builder at the
// end of a constructor.
HEYOKA_DLL_LOCAL void ctor_setup_math_flags();

public:
llvm_state();
Expand Down Expand Up @@ -169,6 +161,7 @@ class HEYOKA_DLL_PUBLIC llvm_state
bool &fast_math();
bool &inline_functions();

const std::string &module_name() const;
const llvm::Module &module() const;
const ir_builder &builder() const;
const llvm::LLVMContext &context() const;
Expand Down
Loading