adapt new execution_context API

This commit is contained in:
Oliver Kowalke
2015-11-10 20:02:33 +01:00
parent fb8254cadb
commit a73e4b1ace
22 changed files with 501 additions and 544 deletions

View File

@@ -18,7 +18,6 @@
#include "clock.hpp"
#include "cycle.hpp"
bool preserve = false;
boost::uint64_t jobs = 1000;
struct X
@@ -45,7 +44,7 @@ void fn_x( boost::coroutines2::coroutine< X >::push_type & c)
duration_type measure_time_void( duration_type overhead)
{
boost::coroutines2::coroutine< void >::pull_type c( fn_void, preserve);
boost::coroutines2::coroutine< void >::pull_type c( fn_void);
time_point_type start( clock_type::now() );
for ( std::size_t i = 0; i < jobs; ++i) {
@@ -61,7 +60,7 @@ duration_type measure_time_void( duration_type overhead)
duration_type measure_time_int( duration_type overhead)
{
boost::coroutines2::coroutine< int >::pull_type c( fn_int, preserve);
boost::coroutines2::coroutine< int >::pull_type c( fn_int);
time_point_type start( clock_type::now() );
for ( std::size_t i = 0; i < jobs; ++i) {
@@ -77,7 +76,7 @@ duration_type measure_time_int( duration_type overhead)
duration_type measure_time_x( duration_type overhead)
{
boost::coroutines2::coroutine< X >::pull_type c( fn_x, preserve);
boost::coroutines2::coroutine< X >::pull_type c( fn_x);
time_point_type start( clock_type::now() );
for ( std::size_t i = 0; i < jobs; ++i) {
@@ -94,7 +93,7 @@ duration_type measure_time_x( duration_type overhead)
# ifdef BOOST_CONTEXT_CYCLE
cycle_type measure_cycles_void( cycle_type overhead)
{
boost::coroutines2::coroutine< void >::pull_type c( fn_void, preserve);
boost::coroutines2::coroutine< void >::pull_type c( fn_void);
cycle_type start( cycles() );
for ( std::size_t i = 0; i < jobs; ++i) {
@@ -110,7 +109,7 @@ cycle_type measure_cycles_void( cycle_type overhead)
cycle_type measure_cycles_int( cycle_type overhead)
{
boost::coroutines2::coroutine< int >::pull_type c( fn_int, preserve);
boost::coroutines2::coroutine< int >::pull_type c( fn_int);
cycle_type start( cycles() );
for ( std::size_t i = 0; i < jobs; ++i) {
@@ -126,7 +125,7 @@ cycle_type measure_cycles_int( cycle_type overhead)
cycle_type measure_cycles_x( cycle_type overhead)
{
boost::coroutines2::coroutine< X >::pull_type c( fn_x, preserve);
boost::coroutines2::coroutine< X >::pull_type c( fn_x);
cycle_type start( cycles() );
for ( std::size_t i = 0; i < jobs; ++i) {
@@ -150,7 +149,6 @@ int main( int argc, char * argv[])
desc.add_options()
("help", "help message")
("bind,b", boost::program_options::value< bool >( & bind), "bind thread to CPU")
("fpu,f", boost::program_options::value< bool >( & preserve), "preserve FPU registers")
("jobs,j", boost::program_options::value< boost::uint64_t >( & jobs), "jobs to run");
boost::program_options::variables_map vm;