diff --git a/algorithms_cpp/CMakeLists.txt b/algorithms_cpp/CMakeLists.txt index bf9f799..5378bd3 100644 --- a/algorithms_cpp/CMakeLists.txt +++ b/algorithms_cpp/CMakeLists.txt @@ -17,18 +17,18 @@ include_directories(${EMBB_ALGORITHMS_CPP_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../base_cpp/include ${CMAKE_CURRENT_BINARY_DIR}/../base_cpp/include ${CMAKE_CURRENT_SOURCE_DIR}/../mtapi_c/include - ${CMAKE_CURRENT_SOURCE_DIR}/../mtapi_cpp/include - ${CMAKE_CURRENT_BINARY_DIR}/../mtapi_cpp/include) + ${CMAKE_CURRENT_SOURCE_DIR}/../tasks_cpp/include + ${CMAKE_CURRENT_BINARY_DIR}/../tasks_cpp/include) add_library(embb_algorithms_cpp ${EMBB_ALGORITHMS_CPP_SOURCES} ${EMBB_ALGORITHMS_CPP_HEADERS}) -target_link_libraries(embb_algorithms_cpp embb_mtapi_cpp) +target_link_libraries(embb_algorithms_cpp embb_tasks_cpp) if (BUILD_TESTS STREQUAL ON) include_directories(${CMAKE_CURRENT_BINARY_DIR}/../partest/include) add_executable (embb_algorithms_cpp_test ${EMBB_ALGORITHMS_CPP_TEST_SOURCES}) target_link_libraries(embb_algorithms_cpp_test embb_algorithms_cpp - embb_mtapi_cpp embb_mtapi_c partest embb_base_cpp + embb_tasks_cpp embb_mtapi_c partest embb_base_cpp embb_base_c ${compiler_libs}) CopyBin(BIN embb_algorithms_cpp_test DEST ${local_install_dir}) endif() diff --git a/algorithms_cpp/include/embb/algorithms/count.h b/algorithms_cpp/include/embb/algorithms/count.h index 90dae22..73f5b31 100644 --- a/algorithms_cpp/include/embb/algorithms/count.h +++ b/algorithms_cpp/include/embb/algorithms/count.h @@ -27,7 +27,7 @@ #ifndef EMBB_ALGORITHMS_COUNT_H_ #define EMBB_ALGORITHMS_COUNT_H_ -#include +#include #include namespace embb { @@ -132,7 +132,7 @@ typename std::iterator_traits::difference_type Count( RAI first, RAI last, const ValueType& value, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ); @@ -145,7 +145,7 @@ typename std::iterator_traits::difference_type Count( RAI last, const ValueType& value ) { - return Count(first, last, value, embb::mtapi::ExecutionPolicy(), 0); + return Count(first, last, value, embb::tasks::ExecutionPolicy(), 0); } /** @@ -156,7 +156,7 @@ typename std::iterator_traits::difference_type Count( RAI first, RAI last, const ValueType& value, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { return Count(first, last, value, policy, 0); } @@ -169,7 +169,7 @@ typename std::iterator_traits::difference_type CountIf( RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ); @@ -182,7 +182,7 @@ typename std::iterator_traits::difference_type CountIf( RAI last, ComparisonFunction comparison ) { - return CountIf(first, last, comparison, embb::mtapi::ExecutionPolicy(), 0); + return CountIf(first, last, comparison, embb::tasks::ExecutionPolicy(), 0); } /** @@ -193,7 +193,7 @@ typename std::iterator_traits::difference_type CountIf( RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { return CountIf(first, last, comparison, policy, 0); } diff --git a/algorithms_cpp/include/embb/algorithms/for_each.h b/algorithms_cpp/include/embb/algorithms/for_each.h index 7812949..23af854 100644 --- a/algorithms_cpp/include/embb/algorithms/for_each.h +++ b/algorithms_cpp/include/embb/algorithms/for_each.h @@ -27,7 +27,7 @@ #ifndef EMBB_ALGORITHMS_FOR_EACH_H_ #define EMBB_ALGORITHMS_FOR_EACH_H_ -#include +#include namespace embb { namespace algorithms { @@ -88,7 +88,7 @@ void ForEach( RAI first, RAI last, Function unary, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ); @@ -101,7 +101,7 @@ void ForEach( RAI last, Function unary ) { - ForEach(first, last, unary, embb::mtapi::ExecutionPolicy(), 0); + ForEach(first, last, unary, embb::tasks::ExecutionPolicy(), 0); } /** @@ -112,7 +112,7 @@ void ForEach( RAI first, RAI last, Function unary, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { ForEach(first, last, unary, policy, 0); } diff --git a/algorithms_cpp/include/embb/algorithms/internal/count-inl.h b/algorithms_cpp/include/embb/algorithms/internal/count-inl.h index 51aa34a..140fe51 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/count-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/count-inl.h @@ -83,7 +83,7 @@ class FunctionComparisonFunction{ template typename std::iterator_traits::difference_type Count(RAI first, RAI last, const ValueType& value, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size) { + const embb::tasks::ExecutionPolicy& policy, size_t block_size) { typedef typename std::iterator_traits::difference_type Difference; return Reduce(first, last, Difference(0), std::plus(), internal::ValueComparisonFunction(value), policy, @@ -93,7 +93,7 @@ typename std::iterator_traits::difference_type template typename std::iterator_traits::difference_type CountIf(RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size) { + const embb::tasks::ExecutionPolicy& policy, size_t block_size) { typedef typename std::iterator_traits::difference_type Difference; return Reduce(first, last, Difference(0), std::plus(), internal::FunctionComparisonFunction diff --git a/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h b/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h index 8d9e034..fb5dcd3 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/for_each-inl.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -46,13 +46,13 @@ class ForEachFunctor { * Constructs a for-each functor with arguments. */ ForEachFunctor(size_t chunk_first, size_t chunk_last, Function unary, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, const BlockSizePartitioner& partitioner) : chunk_first_(chunk_first), chunk_last_(chunk_last), unary_(unary), policy_(policy), partitioner_(partitioner) { } - void Action(mtapi::TaskContext&) { + void Action(embb::tasks::TaskContext&) { if (chunk_first_ == chunk_last_) { // Leaf case, recursed to single chunk. Do work on chunk: ChunkDescriptor chunk = partitioner_[chunk_first_]; @@ -71,12 +71,12 @@ class ForEachFunctor { self_t functor_r(chunk_split_index + 1, chunk_last_, unary_, policy_, partitioner_); - mtapi::Task task_l = mtapi::Node::GetInstance().Spawn( - mtapi::Action( + embb::tasks::Task task_l = embb::tasks::Node::GetInstance().Spawn( + embb::tasks::Action( base::MakeFunction(functor_l, &self_t::Action), policy_)); - mtapi::Task task_r = mtapi::Node::GetInstance().Spawn( - mtapi::Action( + embb::tasks::Task task_r = embb::tasks::Node::GetInstance().Spawn( + embb::tasks::Action( base::MakeFunction(functor_r, &self_t::Action), policy_)); task_l.Wait(MTAPI_INFINITE); @@ -91,7 +91,7 @@ class ForEachFunctor { size_t chunk_first_; size_t chunk_last_; Function unary_; - const embb::mtapi::ExecutionPolicy& policy_; + const embb::tasks::ExecutionPolicy& policy_; const BlockSizePartitioner& partitioner_; /** @@ -102,7 +102,7 @@ class ForEachFunctor { template void ForEachRecursive(RAI first, RAI last, Function unary, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size) { + const embb::tasks::ExecutionPolicy& policy, size_t block_size) { typedef typename std::iterator_traits::difference_type difference_type; difference_type distance = std::distance(first, last); if (distance == 0) { @@ -114,7 +114,7 @@ void ForEachRecursive(RAI first, RAI last, Function unary, if (num_cores == 0) { EMBB_THROW(embb::base::ErrorException, "No cores in execution policy"); } - mtapi::Node& node = mtapi::Node::GetInstance(); + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); // Determine actually used block size if (block_size == 0) { block_size = (static_cast(distance) / num_cores); @@ -132,7 +132,7 @@ void ForEachRecursive(RAI first, RAI last, Function unary, ForEachFunctor functor(0, partitioner.Size() - 1, unary, policy, partitioner); - mtapi::Task task = node.Spawn(mtapi::Action( + embb::tasks::Task task = node.Spawn(embb::tasks::Action( base::MakeFunction(functor, &ForEachFunctor::Action), policy)); @@ -141,7 +141,7 @@ void ForEachRecursive(RAI first, RAI last, Function unary, template void ForEachIteratorCheck(RAI first, RAI last, Function unary, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size, + const embb::tasks::ExecutionPolicy& policy, size_t block_size, std::random_access_iterator_tag) { return ForEachRecursive(first, last, unary, policy, block_size); } @@ -150,7 +150,7 @@ void ForEachIteratorCheck(RAI first, RAI last, Function unary, template void ForEach(RAI first, const RAI last, Function unary, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size) { + const embb::tasks::ExecutionPolicy& policy, size_t block_size) { typename std::iterator_traits::iterator_category category; internal::ForEachIteratorCheck(first, last, unary, policy, block_size, category); diff --git a/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h b/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h index a56d582..7cd2448 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/merge_sort-inl.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include namespace embb { @@ -50,7 +50,7 @@ class MergeSortFunctor { MergeSortFunctor(size_t chunk_first, size_t chunk_last, RAITemp temporary_first, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, const BlockSizePartitioner& partitioner, const RAI& global_first, int depth) : chunk_first_(chunk_first), chunk_last_(chunk_last), @@ -59,7 +59,7 @@ class MergeSortFunctor { global_first_(global_first), depth_(depth) { } - void Action(mtapi::TaskContext&) { + void Action(embb::tasks::TaskContext&) { size_t chunk_split_index = (chunk_first_ + chunk_last_) / 2; if (chunk_first_ == chunk_last_) { // Leaf case: recurse into a single chunk's elements: @@ -77,13 +77,13 @@ class MergeSortFunctor { temp_first_, comparison_, policy_, partitioner_, global_first_, depth_ + 1); - mtapi::Node& node = mtapi::Node::GetInstance(); - mtapi::Task task_l = node.Spawn( - mtapi::Action( + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); + embb::tasks::Task task_l = node.Spawn( + embb::tasks::Action( base::MakeFunction(functor_l, &self_t::Action), policy_)); - mtapi::Task task_r = node.Spawn( - mtapi::Action( + embb::tasks::Task task_r = node.Spawn( + embb::tasks::Action( base::MakeFunction(functor_r, &self_t::Action), policy_)); task_l.Wait(MTAPI_INFINITE); @@ -177,7 +177,7 @@ class MergeSortFunctor { size_t chunk_last_; RAITemp temp_first_; ComparisonFunction comparison_; - const embb::mtapi::ExecutionPolicy& policy_; + const embb::tasks::ExecutionPolicy& policy_; const BlockSizePartitioner& partitioner_; const RAI& global_first_; int depth_; @@ -219,7 +219,7 @@ void MergeSortIteratorCheck( RAI last, RAITemp temporary_first, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size, std::random_access_iterator_tag ) { @@ -257,8 +257,8 @@ void MergeSortIteratorCheck( partitioner, first, 0); - mtapi::Task task = embb::mtapi::Node::GetInstance().Spawn( - mtapi::Action( + embb::tasks::Task task = embb::tasks::Node::GetInstance().Spawn( + embb::tasks::Action( base::MakeFunction(functor, &functor_t::Action), policy)); @@ -269,7 +269,7 @@ void MergeSortIteratorCheck( template void MergeSort(RAI first, RAI last, RAITemp temporary_first, - ComparisonFunction comparison, const embb::mtapi::ExecutionPolicy& policy, + ComparisonFunction comparison, const embb::tasks::ExecutionPolicy& policy, size_t block_size) { typedef typename std::iterator_traits::iterator_category category; internal::MergeSortIteratorCheck(first, last, temporary_first, comparison, diff --git a/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h b/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h index 434af54..48cdb9f 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/partition-inl.h @@ -93,7 +93,7 @@ ChunkPartitioner::ChunkPartitioner(ForwardIterator first, size = amountChunks; } else { // if no concrete chunk size was given, use number of cores... - mtapi::Node& node = mtapi::Node::GetInstance(); + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); size = node.GetWorkerThreadCount(); } diff --git a/algorithms_cpp/include/embb/algorithms/internal/partition.h b/algorithms_cpp/include/embb/algorithms/internal/partition.h index 403cb65..7e7548e 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/partition.h +++ b/algorithms_cpp/include/embb/algorithms/internal/partition.h @@ -27,7 +27,7 @@ #ifndef EMBB_ALGORITHMS_INTERNAL_PARTITION_H_ #define EMBB_ALGORITHMS_INTERNAL_PARTITION_H_ -#include +#include namespace embb { namespace algorithms { diff --git a/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h b/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h index 1b4bb2f..79a1241 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/quick_sort-inl.h @@ -33,7 +33,7 @@ #include #include -#include +#include #include namespace embb { @@ -48,7 +48,7 @@ class QuickSortFunctor { * Constructs a functor. */ QuickSortFunctor(RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size) + const embb::tasks::ExecutionPolicy& policy, size_t block_size) : first_(first), last_(last), comparison_(comparison), policy_(policy), block_size_(block_size) { } @@ -56,7 +56,7 @@ class QuickSortFunctor { /** * MTAPI action function and starting point of the parallel quick sort. */ - void Action(mtapi::TaskContext&) { + void Action(embb::tasks::TaskContext&) { Difference distance = last_ - first_; if (distance <= 1) { return; @@ -68,15 +68,15 @@ class QuickSortFunctor { SerialQuickSort(first_, mid); SerialQuickSort(mid, last_); } else { - mtapi::Node& node = mtapi::Node::GetInstance(); + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); QuickSortFunctor functor_l(first_, mid, comparison_, policy_, block_size_); - mtapi::Task task_l = node.Spawn(mtapi::Action(base::MakeFunction( - functor_l, &QuickSortFunctor::Action))); + embb::tasks::Task task_l = node.Spawn(embb::tasks::Action( + base::MakeFunction(functor_l, &QuickSortFunctor::Action))); QuickSortFunctor functor_r(mid, last_, comparison_, policy_, block_size_); - mtapi::Task task_r = node.Spawn(mtapi::Action(base::MakeFunction( - functor_r, &QuickSortFunctor::Action))); + embb::tasks::Task task_r = node.Spawn(embb::tasks::Action( + base::MakeFunction(functor_r, &QuickSortFunctor::Action))); task_l.Wait(MTAPI_INFINITE); task_r.Wait(MTAPI_INFINITE); } @@ -87,7 +87,7 @@ class QuickSortFunctor { RAI first_; RAI last_; ComparisonFunction comparison_; - const embb::mtapi::ExecutionPolicy& policy_; + const embb::tasks::ExecutionPolicy& policy_; size_t block_size_; typedef typename std::iterator_traits::difference_type Difference; @@ -189,10 +189,10 @@ class QuickSortFunctor { template void QuickSortIteratorCheck(RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size, std::random_access_iterator_tag) { - embb::mtapi::Node& node = embb::mtapi::Node::GetInstance(); + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); typedef typename std::iterator_traits::difference_type difference_type; difference_type distance = std::distance(first, last); if (distance == 0) { @@ -215,7 +215,7 @@ void QuickSortIteratorCheck(RAI first, RAI last, } QuickSortFunctor functor( first, last, comparison, policy, block_size); - mtapi::Task task = node.Spawn(mtapi::Action(base::MakeFunction( + embb::tasks::Task task = node.Spawn(embb::tasks::Action(base::MakeFunction( functor, &QuickSortFunctor::Action))); task.Wait(MTAPI_INFINITE); } @@ -224,7 +224,7 @@ void QuickSortIteratorCheck(RAI first, RAI last, template void QuickSort(RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size) { + const embb::tasks::ExecutionPolicy& policy, size_t block_size) { typedef typename std::iterator_traits::iterator_category category; internal::QuickSortIteratorCheck(first, last, comparison, policy, block_size, category()); diff --git a/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h b/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h index 86892a2..bc15801 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/reduce-inl.h @@ -27,7 +27,7 @@ #ifndef EMBB_ALGORITHMS_INTERNAL_REDUCE_INL_H_ #define EMBB_ALGORITHMS_INTERNAL_REDUCE_INL_H_ -#include +#include #include #include @@ -46,7 +46,7 @@ class ReduceFunctor { ReturnType neutral, ReductionFunction reduction, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, const BlockSizePartitioner& partitioner, ReturnType& result) : chunk_first_(chunk_first), chunk_last_(chunk_last), neutral_(neutral), @@ -54,7 +54,7 @@ class ReduceFunctor { partitioner_(partitioner), result_(result) { } - void Action(mtapi::TaskContext&) { + void Action(embb::tasks::TaskContext&) { if (chunk_first_ == chunk_last_) { // Leaf case, recursed to single chunk. Do work on chunk: ChunkDescriptor chunk = partitioner_[chunk_first_]; @@ -81,13 +81,13 @@ class ReduceFunctor { neutral_, reduction_, transformation_, policy_, partitioner_, result_r); - mtapi::Task task_l = mtapi::Node::GetInstance().Spawn( - mtapi::Action( + embb::tasks::Task task_l = embb::tasks::Node::GetInstance().Spawn( + embb::tasks::Action( base::MakeFunction( functor_l, &self_t::Action), policy_)); - mtapi::Task task_r = mtapi::Node::GetInstance().Spawn( - mtapi::Action( + embb::tasks::Task task_r = embb::tasks::Node::GetInstance().Spawn( + embb::tasks::Action( base::MakeFunction( functor_r, &self_t::Action), policy_)); @@ -108,7 +108,7 @@ class ReduceFunctor { ReturnType neutral_; ReductionFunction reduction_; TransformationFunction transformation_; - const embb::mtapi::ExecutionPolicy& policy_; + const embb::tasks::ExecutionPolicy& policy_; const BlockSizePartitioner& partitioner_; ReturnType& result_; @@ -124,7 +124,7 @@ template::difference_type difference_type; difference_type distance = std::distance(first, last); @@ -137,7 +137,7 @@ ReturnType ReduceRecursive(RAI first, RAI last, ReturnType neutral, if (num_cores == 0) { EMBB_THROW(embb::base::ErrorException, "No cores in execution policy"); } - mtapi::Node& node = mtapi::Node::GetInstance(); + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); // Determine actually used block size if (block_size == 0) { block_size = (static_cast(distance) / num_cores); @@ -162,8 +162,8 @@ ReturnType ReduceRecursive(RAI first, RAI last, ReturnType neutral, policy, partitioner, result); - mtapi::Task task = node.Spawn( - mtapi::Action(base::MakeFunction( + embb::tasks::Task task = node.Spawn( + embb::tasks::Action(base::MakeFunction( functor, &Functor::Action), policy)); task.Wait(MTAPI_INFINITE); return result; @@ -174,7 +174,7 @@ template::iterator_category category; return internal::ReduceIteratorCheck(first, last, reduction, transformation, diff --git a/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h b/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h index a3b6c99..cbf748e 100644 --- a/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h +++ b/algorithms_cpp/include/embb/algorithms/internal/scan-inl.h @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include #include namespace embb { @@ -44,7 +44,7 @@ class ScanFunctor { ScanFunctor(size_t chunk_first, size_t chunk_last, RAIOut output_iterator, ReturnType neutral, ScanFunction scan, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, const BlockSizePartitioner& partitioner, ReturnType* tree_values, size_t node_id, bool going_down) @@ -55,7 +55,7 @@ class ScanFunctor { node_id_(node_id), parent_value_(neutral), is_first_pass_(going_down) { } - void Action(mtapi::TaskContext&) { + void Action(embb::tasks::TaskContext&) { if (chunk_first_ == chunk_last_) { ChunkDescriptor chunk = partitioner_[chunk_first_]; RAIIn iter_in = chunk.GetFirst(); @@ -104,13 +104,13 @@ class ScanFunctor { functor_r.parent_value_ = functor_l.GetTreeValue() + parent_value_; } // Spawn tasks to recurse: - mtapi::Node& node = mtapi::Node::GetInstance(); - mtapi::Task task_l = node.Spawn( - mtapi::Action( + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); + embb::tasks::Task task_l = node.Spawn( + embb::tasks::Action( base::MakeFunction(functor_l, &ScanFunctor::Action), policy_)); - mtapi::Task task_r = node.Spawn( - mtapi::Action( + embb::tasks::Task task_r = node.Spawn( + embb::tasks::Action( base::MakeFunction(functor_r, &ScanFunctor::Action), policy_)); // Wait for tasks to complete: @@ -131,7 +131,7 @@ class ScanFunctor { private: static const int LEFT = 1; static const int RIGHT = 2; - const embb::mtapi::ExecutionPolicy& policy_; + const embb::tasks::ExecutionPolicy& policy_; size_t chunk_first_; size_t chunk_last_; RAIOut output_iterator_; @@ -168,7 +168,7 @@ typename ScanFunction, typename TransformationFunction> void ScanIteratorCheck(RAIIn first, RAIIn last, RAIOut output_iterator, ReturnType neutral, ScanFunction scan, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size, std::random_access_iterator_tag) { typedef typename std::iterator_traits::difference_type difference_type; @@ -199,15 +199,14 @@ void ScanIteratorCheck(RAIIn first, RAIIn last, RAIOut output_iterator, // it creates the tree. typedef ScanFunctor Functor; - mtapi::Node& node = mtapi::Node::GetInstance(); + embb::tasks::Node& node = embb::tasks::Node::GetInstance(); BlockSizePartitioner partitioner_down(first, last, block_size); Functor functor_down(0, partitioner_down.Size() - 1, output_iterator, neutral, scan, transformation, policy, partitioner_down, values, 0, true); - mtapi::Task task_down = node.Spawn(mtapi::Action(base::MakeFunction( - functor_down, &Functor::Action), - policy)); + embb::tasks::Task task_down = node.Spawn(embb::tasks::Action( + base::MakeFunction(functor_down, &Functor::Action), policy)); task_down.Wait(MTAPI_INFINITE); // Second pass. Gives to each leaf the part of the prefix missing @@ -215,9 +214,8 @@ void ScanIteratorCheck(RAIIn first, RAIIn last, RAIOut output_iterator, Functor functor_up(0, partitioner_up.Size() - 1, output_iterator, neutral, scan, transformation, policy, partitioner_up, values, 0, false); - mtapi::Task task_up = node.Spawn(mtapi::Action(base::MakeFunction( - functor_up, &Functor::Action), - policy)); + embb::tasks::Task task_up = node.Spawn(embb::tasks::Action( + base::MakeFunction(functor_up, &Functor::Action), policy)); task_up.Wait(MTAPI_INFINITE); } @@ -227,7 +225,7 @@ template void Scan(RAIIn first, RAIIn last, RAIOut output_iterator, ReturnType neutral, ScanFunction scan, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy, size_t block_size) { + const embb::tasks::ExecutionPolicy& policy, size_t block_size) { typedef typename std::iterator_traits::iterator_category category; internal::ScanIteratorCheck(first, last, output_iterator, neutral, scan, transformation, policy, block_size, category()); diff --git a/algorithms_cpp/include/embb/algorithms/invoke.h b/algorithms_cpp/include/embb/algorithms/invoke.h index 1484d5a..d6dfd46 100644 --- a/algorithms_cpp/include/embb/algorithms/invoke.h +++ b/algorithms_cpp/include/embb/algorithms/invoke.h @@ -28,7 +28,7 @@ #define EMBB_ALGORITHMS_INVOKE_H_ #include -#include +#include namespace embb { namespace algorithms { @@ -89,15 +89,16 @@ template class TaskWrapper { public: /** - * Wraps the function into an mtapi::Action and spawns an mtapi::Task. + * Wraps the function into an embb::tasks::Action and spawns an + * embb::tasks::Task. */ explicit TaskWrapper( Function function, - const embb::mtapi::ExecutionPolicy& policy) + const embb::tasks::ExecutionPolicy& policy) : function_(function), task_() { - mtapi::Action action(embb::base::MakeFunction(*this, &TaskWrapper::Run), + embb::tasks::Action action(embb::base::MakeFunction(*this, &TaskWrapper::Run), policy); - task_ = mtapi::Node::GetInstance().Spawn(action); + task_ = embb::tasks::Node::GetInstance().Spawn(action); } /** @@ -109,9 +110,9 @@ class TaskWrapper { private: Function function_; - mtapi::Task task_; + embb::tasks::Task task_; - void Run(embb::mtapi::TaskContext&) { + void Run(embb::tasks::TaskContext&) { function_(); } }; @@ -120,7 +121,7 @@ class TaskWrapper { template void Invoke( Function1 func1, - const embb::mtapi::ExecutionPolicy& policy) { + const embb::tasks::ExecutionPolicy& policy) { internal::TaskWrapper wrap1(func1, policy); } @@ -128,7 +129,7 @@ template void Invoke( Function1 func1, Function2 func2, - const embb::mtapi::ExecutionPolicy& policy) { + const embb::tasks::ExecutionPolicy& policy) { internal::TaskWrapper wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); } @@ -138,7 +139,7 @@ void Invoke( Function1 func1, Function2 func2, Function3 func3, - const embb::mtapi::ExecutionPolicy& policy) { + const embb::tasks::ExecutionPolicy& policy) { internal::TaskWrapper wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -151,7 +152,7 @@ template wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -166,7 +167,7 @@ template wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -183,7 +184,7 @@ template wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -203,7 +204,7 @@ template wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -225,7 +226,7 @@ template wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -249,7 +250,7 @@ template wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -276,7 +277,7 @@ template wrap1(func1, policy); internal::TaskWrapper wrap2(func2, policy); internal::TaskWrapper wrap3(func3, policy); @@ -292,21 +293,21 @@ template void Invoke( Function1 func1) { - Invoke(func1, embb::mtapi::ExecutionPolicy()); + Invoke(func1, embb::tasks::ExecutionPolicy()); } template void Invoke( Function1 func1, Function2 func2) { - Invoke(func1, func2, embb::mtapi::ExecutionPolicy()); + Invoke(func1, func2, embb::tasks::ExecutionPolicy()); } template void Invoke( Function1 func1, Function2 func2, Function3 func3) { - Invoke(func1, func2, func3, embb::mtapi::ExecutionPolicy()); + Invoke(func1, func2, func3, embb::tasks::ExecutionPolicy()); } template -#include +#include #include namespace embb { @@ -149,7 +149,7 @@ void MergeSort( RAI last, RAITemp temporary_first, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ); @@ -161,7 +161,7 @@ void MergeSortAllocate( RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ) { typedef base::Allocation Alloc; @@ -200,7 +200,7 @@ void MergeSortAllocate( ) { MergeSortAllocate(first, last, std::less::value_type>(), - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -212,7 +212,7 @@ void MergeSortAllocate( RAI last, ComparisonFunction comparison ) { - MergeSortAllocate(first, last, comparison, embb::mtapi::ExecutionPolicy(), 0); + MergeSortAllocate(first, last, comparison, embb::tasks::ExecutionPolicy(), 0); } /** @@ -223,7 +223,7 @@ void MergeSortAllocate( RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { MergeSortAllocate(first, last, comparison, policy, 0); } @@ -239,7 +239,7 @@ void MergeSort( ) { MergeSort(first, last, temporary_first, std::less::value_type>(), - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -253,7 +253,7 @@ void MergeSort( ComparisonFunction comparison ) { MergeSort(first, last, temporary_first, comparison, - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -265,7 +265,7 @@ void MergeSort( RAI last, RAITemp temporary_first, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { MergeSort(first, last, temporary_first, comparison, policy, 0); } diff --git a/algorithms_cpp/include/embb/algorithms/quick_sort.h b/algorithms_cpp/include/embb/algorithms/quick_sort.h index cf25020..80181d5 100644 --- a/algorithms_cpp/include/embb/algorithms/quick_sort.h +++ b/algorithms_cpp/include/embb/algorithms/quick_sort.h @@ -28,7 +28,7 @@ #define EMBB_ALGORITHMS_QUICK_SORT_H_ #include -#include +#include namespace embb { namespace algorithms { @@ -72,7 +72,7 @@ void QuickSort( \c a appears before an element \c b in the sorted range if comparison(a, b) == true. The default value uses the less-than relation. */ - const embb::mtapi::ExecutionPolicy& policy = embb::mtapi::ExecutionPolicy(), + const embb::tasks::ExecutionPolicy& policy = embb::tasks::ExecutionPolicy(), /**< [IN] embb::mtapi::ExecutionPolicy for the quick sort algorithm */ size_t block_size = 0 /**< [IN] Lower bound for partitioning the range of elements into blocks that @@ -95,7 +95,7 @@ void QuickSort( RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ); @@ -109,7 +109,7 @@ void QuickSort( ) { QuickSort(first, last, std::less::value_type>(), - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -121,7 +121,7 @@ void QuickSort( RAI last, ComparisonFunction comparison ) { - QuickSort(first, last, comparison, embb::mtapi::ExecutionPolicy(), 0); + QuickSort(first, last, comparison, embb::tasks::ExecutionPolicy(), 0); } /** @@ -132,7 +132,7 @@ void QuickSort( RAI first, RAI last, ComparisonFunction comparison, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { QuickSort(first, last, comparison, policy, 0); } diff --git a/algorithms_cpp/include/embb/algorithms/reduce.h b/algorithms_cpp/include/embb/algorithms/reduce.h index 9058ee9..463e1b8 100644 --- a/algorithms_cpp/include/embb/algorithms/reduce.h +++ b/algorithms_cpp/include/embb/algorithms/reduce.h @@ -27,7 +27,7 @@ #ifndef EMBB_ALGORITHMS_REDUCE_H_ #define EMBB_ALGORITHMS_REDUCE_H_ -#include +#include #include namespace embb { @@ -113,7 +113,7 @@ ReturnType Reduce( ReturnType neutral, ReductionFunction reduction, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ); @@ -128,7 +128,7 @@ ReturnType Reduce( ReductionFunction reduction ) { return Reduce(first, last, neutral, reduction, Identity(), - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -144,7 +144,7 @@ ReturnType Reduce( TransformationFunction transformation ) { return Reduce(first, last, neutral, reduction, transformation, - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -158,7 +158,7 @@ ReturnType Reduce( ReturnType neutral, ReductionFunction reduction, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { return Reduce(first, last, neutral, reduction, transformation, policy, 0); } diff --git a/algorithms_cpp/include/embb/algorithms/scan.h b/algorithms_cpp/include/embb/algorithms/scan.h index 5d019cb..8a32e91 100644 --- a/algorithms_cpp/include/embb/algorithms/scan.h +++ b/algorithms_cpp/include/embb/algorithms/scan.h @@ -27,7 +27,7 @@ #ifndef EMBB_ALGORITHMS_SCAN_H_ #define EMBB_ALGORITHMS_SCAN_H_ -#include +#include #include namespace embb { @@ -121,7 +121,7 @@ void Scan( ReturnType neutral, ScanFunction scan, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy, + const embb::tasks::ExecutionPolicy& policy, size_t block_size ); @@ -138,7 +138,7 @@ void Scan( ScanFunction scan ) { Scan(first, last, output_iterator, neutral, scan, Identity(), - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -155,7 +155,7 @@ void Scan( TransformationFunction transformation ) { Scan(first, last, output_iterator, neutral, scan, transformation, - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); } /** @@ -170,7 +170,7 @@ void Scan( ReturnType neutral, ScanFunction scan, TransformationFunction transformation, - const embb::mtapi::ExecutionPolicy& policy + const embb::tasks::ExecutionPolicy& policy ) { Scan(first, last, output_iterator, neutral, scan, transformation, policy, 0); } diff --git a/algorithms_cpp/test/count_test.cc b/algorithms_cpp/test/count_test.cc index fdc5993..0ab2571 100644 --- a/algorithms_cpp/test/count_test.cc +++ b/algorithms_cpp/test/count_test.cc @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -122,7 +122,7 @@ void CountTest::TestBlockSizes() { void CountTest::TestPolicy() { using embb::algorithms::Count; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; int a[] = { 10, 20, 30, 30, 20, 10, 10, 20, 20, 20 }; std::vector vector(a, a + (sizeof a / sizeof a[0])); PT_EXPECT_EQ(Count(vector.begin(), vector.end(), 10, ExecutionPolicy()), 3); @@ -134,7 +134,7 @@ void CountTest::TestPolicy() { void CountTest::StressTest() { using embb::algorithms::Count; - size_t count = embb::mtapi::Node::GetInstance().GetCoreCount() *10; + size_t count = embb::tasks::Node::GetInstance().GetCoreCount() * 10; std::vector large_vector(count); for (size_t i = 0; i < count; i++) { large_vector[i] = static_cast(0); diff --git a/algorithms_cpp/test/for_each_test.cc b/algorithms_cpp/test/for_each_test.cc index 3ca3081..df46122 100644 --- a/algorithms_cpp/test/for_each_test.cc +++ b/algorithms_cpp/test/for_each_test.cc @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -166,7 +166,7 @@ void ForEachTest::TestRanges() { void ForEachTest::TestBlockSizes() { using embb::algorithms::ForEach; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; size_t count = 4; std::vector init(count); std::vector vector(count); @@ -186,7 +186,7 @@ void ForEachTest::TestBlockSizes() { void ForEachTest::TestPolicy() { using embb::algorithms::ForEach; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; size_t count = 4; std::vector init(count); std::vector vector(count); @@ -240,8 +240,8 @@ void ForEachTest::TestPolicy() { void ForEachTest::StressTest() { using embb::algorithms::ForEach; - using embb::mtapi::ExecutionPolicy; - size_t count = embb::mtapi::Node::GetInstance().GetCoreCount() *10; + using embb::tasks::ExecutionPolicy; + size_t count = embb::tasks::Node::GetInstance().GetCoreCount() * 10; std::vector large_vector(count); for (size_t i = 0; i < count; i++) { large_vector[i] = static_cast((i + 2) % 1000); diff --git a/algorithms_cpp/test/main.cc b/algorithms_cpp/test/main.cc index 4b5bf5e..1da1475 100644 --- a/algorithms_cpp/test/main.cc +++ b/algorithms_cpp/test/main.cc @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include @@ -66,7 +66,7 @@ int compute1_() { } PT_MAIN("Algorithms") { - embb::mtapi::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID); + embb::tasks::Node::Initialize(THIS_DOMAIN_ID, THIS_NODE_ID); PT_RUN(PartitionerTest); PT_RUN(ForEachTest); @@ -78,7 +78,7 @@ PT_MAIN("Algorithms") { PT_RUN(MergeSortTest); PT_RUN(InvokeTest); - embb::mtapi::Node::Finalize(); + embb::tasks::Node::Finalize(); PT_EXPECT(embb_get_bytes_allocated() == 0); diff --git a/algorithms_cpp/test/merge_sort_test.cc b/algorithms_cpp/test/merge_sort_test.cc index d7b1170..c3fd3ee 100644 --- a/algorithms_cpp/test/merge_sort_test.cc +++ b/algorithms_cpp/test/merge_sort_test.cc @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -50,7 +50,7 @@ MergeSortTest::MergeSortTest() { void MergeSortTest::TestDataStructures() { using embb::algorithms::MergeSortAllocate; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; int array[kCountSize]; std::vector vector(kCountSize); std::deque deque(kCountSize); @@ -75,7 +75,7 @@ void MergeSortTest::TestDataStructures() { void MergeSortTest::TestFunctionPointers() { using embb::algorithms::MergeSortAllocate; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; std::vector vector(kCountSize); for (size_t i = kCountSize - 1; i > 0; i--) { @@ -158,7 +158,7 @@ void MergeSortTest::TestRanges() { void MergeSortTest::TestBlockSizes() { using embb::algorithms::MergeSortAllocate; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; size_t count = 4; std::vector init(count); std::vector vector(count); @@ -181,7 +181,7 @@ void MergeSortTest::TestBlockSizes() { void MergeSortTest::TestPolicy() { using embb::algorithms::MergeSortAllocate; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; size_t count = 4; std::vector init(count); std::vector vector(count); @@ -242,7 +242,7 @@ void MergeSortTest::TestPolicy() { void MergeSortTest::StressTest() { using embb::algorithms::MergeSortAllocate; - size_t count = embb::mtapi::Node::GetInstance().GetCoreCount() * 10; + size_t count = embb::tasks::Node::GetInstance().GetCoreCount() * 10; std::vector large_vector(count); std::vector vector_copy(count); for (size_t i = count - 1; i > 0; i--) { diff --git a/algorithms_cpp/test/quick_sort_test.cc b/algorithms_cpp/test/quick_sort_test.cc index 863b278..151b658 100644 --- a/algorithms_cpp/test/quick_sort_test.cc +++ b/algorithms_cpp/test/quick_sort_test.cc @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ QuickSortTest::QuickSortTest() { void QuickSortTest::TestDataStructures() { using embb::algorithms::QuickSort; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; int array[kCountSize]; std::vector vector(kCountSize); @@ -163,7 +163,7 @@ void QuickSortTest::TestRanges() { void QuickSortTest::TestBlockSizes() { using embb::algorithms::QuickSort; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; size_t count = 4; std::vector init(count); @@ -187,7 +187,7 @@ void QuickSortTest::TestBlockSizes() { void QuickSortTest::TestPolicy() { using embb::algorithms::QuickSort; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; size_t count = 4; std::vector init(count); std::vector vector(count); @@ -248,7 +248,7 @@ void QuickSortTest::TestPolicy() { void QuickSortTest::StressTest() { using embb::algorithms::QuickSort; - size_t count = embb::mtapi::Node::GetInstance().GetCoreCount() *10; + size_t count = embb::tasks::Node::GetInstance().GetCoreCount() * 10; std::vector large_vector(count); std::vector vector_copy(count); for (size_t i = 0; i < count; i++) { diff --git a/algorithms_cpp/test/reduce_test.cc b/algorithms_cpp/test/reduce_test.cc index c8ab5ae..63d31be 100644 --- a/algorithms_cpp/test/reduce_test.cc +++ b/algorithms_cpp/test/reduce_test.cc @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -163,7 +163,7 @@ void ReduceTest::TestBlockSizes() { void ReduceTest::TestPolicy() { using embb::algorithms::Reduce; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; using embb::algorithms::Identity; size_t count = 4; int sum = 0; @@ -210,9 +210,9 @@ void ReduceTest::TestPolicy() { void ReduceTest::StressTest() { using embb::algorithms::Reduce; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; using embb::algorithms::Identity; - size_t count = embb::mtapi::Node::GetInstance().GetCoreCount() *10; + size_t count = embb::tasks::Node::GetInstance().GetCoreCount() * 10; std::vector large_vector(count); mtapi_int32_t expected = 0; for (size_t i = 0; i < count; i++) { diff --git a/algorithms_cpp/test/scan_test.cc b/algorithms_cpp/test/scan_test.cc index e902a81..61f85f5 100644 --- a/algorithms_cpp/test/scan_test.cc +++ b/algorithms_cpp/test/scan_test.cc @@ -228,7 +228,7 @@ void ScanTest::TestRanges() { void ScanTest::TestBlockSizes() { using embb::algorithms::Scan; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; using embb::algorithms::Identity; size_t count = 4; std::vector init(count); @@ -253,7 +253,7 @@ void ScanTest::TestBlockSizes() { void ScanTest::TestPolicy() { using embb::algorithms::Scan; - using embb::mtapi::ExecutionPolicy; + using embb::tasks::ExecutionPolicy; using embb::algorithms::Identity; size_t count = 4; std::vector init(count); @@ -324,8 +324,8 @@ void ScanTest::TestPolicy() { void ScanTest::StressTest() { using embb::algorithms::Scan; using embb::algorithms::Identity; - using embb::mtapi::ExecutionPolicy; - size_t count = embb::mtapi::Node::GetInstance().GetCoreCount() *10; + using embb::tasks::ExecutionPolicy; + size_t count = embb::tasks::Node::GetInstance().GetCoreCount() *10; std::vector large_vector(count); std::vector large_vector_output(count); for (size_t i = 0; i < count; i++) { diff --git a/algorithms_cpp/test/zip_iterator_test.cc b/algorithms_cpp/test/zip_iterator_test.cc index 52c1f59..d345206 100644 --- a/algorithms_cpp/test/zip_iterator_test.cc +++ b/algorithms_cpp/test/zip_iterator_test.cc @@ -136,7 +136,7 @@ void ZipIteratorTest::TestZipScan() { Scan(embb::algorithms::Zip(vectorA.begin(), vectorB.begin()), embb::algorithms::Zip(vectorA.end(), vectorB.end()), vectorOut.begin(), 0, std::plus(), DotProductFunctor(), - embb::mtapi::ExecutionPolicy(), 0); + embb::tasks::ExecutionPolicy(), 0); long sum = 0; for (size_t i = 0; i < kCountSize; i++) {