From 9fb5d6ce19433db30ae3915de8b776e90a7bdb0a Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Tue, 24 Apr 2018 11:21:39 -0400 Subject: [PATCH] tab to space tbb_task_scheduler_init.cpp --- cpp/tbb/tbb_task_scheduler_init.cpp | 52 ++++++++++++++--------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/cpp/tbb/tbb_task_scheduler_init.cpp b/cpp/tbb/tbb_task_scheduler_init.cpp index b5c27bc..a8f9f9b 100644 --- a/cpp/tbb/tbb_task_scheduler_init.cpp +++ b/cpp/tbb/tbb_task_scheduler_init.cpp @@ -12,43 +12,43 @@ VIM: let b:ldlibpath=g:Bboost.g:Btbb #include /* - * Conclusion: - * The first task_sheduler_init is configuring number of threads in - * the thread pool. If the task scheduler initialised implicitly then - * the number of threads is the number of cores. To ensure uncomment - * the commented line below. + * Conclusion: + * The first task_sheduler_init is configuring number of threads in + * the thread pool. If the task scheduler initialised implicitly then + * the number of threads is the number of cores. To ensure uncomment + * the commented line below. */ int main ( void ) {try{ - std::vector v(1024*1024); - //tbb::enumerable_thread_specific count; - tbb::task_scheduler_init init3(5); - tbb::task_scheduler_init init(10); - tbb::task_scheduler_init init2(1); - tbb::enumerable_thread_specific count; - tbb::parallel_for_each( v.begin(), v.end(), [&count](int& v){ - ++count.local(); - }); + std::vector v(1024*1024); + //tbb::enumerable_thread_specific count; + tbb::task_scheduler_init init3(5); + tbb::task_scheduler_init init(10); + tbb::task_scheduler_init init2(1); + tbb::enumerable_thread_specific count; + tbb::parallel_for_each( v.begin(), v.end(), [&count](int& v){ + ++count.local(); + }); - int i = 0; - for ( int c : count ) - { - std::cout << "Thread: " << ++i << " counted " << c << std::endl; - } - return 0; + int i = 0; + for ( int c : count ) + { + std::cout << "Thread: " << ++i << " counted " << c << std::endl; + } + return 0; } catch ( const std::exception& e ) { - std::cerr << std::endl - << "std::exception(\"" << e.what() << "\")." << std::endl; - return 2; + std::cerr << std::endl + << "std::exception(\"" << e.what() << "\")." << std::endl; + return 2; } catch ( ... ) { - std::cerr << std::endl - << "unknown exception." << std::endl; - return 1; + std::cerr << std::endl + << "unknown exception." << std::endl; + return 1; }}