123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef BOOST_COMPUTE_DETAIL_DURATION_HPP
- #define BOOST_COMPUTE_DETAIL_DURATION_HPP
- #include <boost/config.hpp>
- #ifndef BOOST_COMPUTE_NO_HDR_CHRONO
- #include <chrono>
- #endif
- #ifndef BOOST_COMPUTE_NO_BOOST_CHRONO
- #include <boost/chrono/duration.hpp>
- #endif
- namespace boost {
- namespace compute {
- namespace detail {
- #ifndef BOOST_COMPUTE_NO_HDR_CHRONO
- template<class Rep, class Period>
- inline std::chrono::duration<Rep, Period>
- make_duration_from_nanoseconds(std::chrono::duration<Rep, Period>, size_t nanoseconds)
- {
- return std::chrono::duration_cast<std::chrono::duration<Rep, Period> >(
- std::chrono::nanoseconds(nanoseconds)
- );
- }
- #endif
- #ifndef BOOST_COMPUTE_NO_BOOST_CHRONO
- template<class Rep, class Period>
- inline boost::chrono::duration<Rep, Period>
- make_duration_from_nanoseconds(boost::chrono::duration<Rep, Period>, size_t nanoseconds)
- {
- return boost::chrono::duration_cast<boost::chrono::duration<Rep, Period> >(
- boost::chrono::nanoseconds(nanoseconds)
- );
- }
- #endif
- }
- }
- }
- #endif
|