From eb401cb15398c9c32ce583a151cdd446146cc1e9 Mon Sep 17 00:00:00 2001 From: blonded04 Date: Sat, 16 Mar 2024 23:02:43 +0300 Subject: [PATCH 1/6] using default partitioner instead of auto where default should be used --- include/oneapi/tbb/parallel_for.h | 8 ++++---- include/oneapi/tbb/parallel_scan.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/oneapi/tbb/parallel_for.h b/include/oneapi/tbb/parallel_for.h index 91c7c44c87..6ecfcb95be 100644 --- a/include/oneapi/tbb/parallel_for.h +++ b/include/oneapi/tbb/parallel_for.h @@ -319,7 +319,7 @@ void parallel_for_impl(Index first, Index last, Index step, const Function& f, P template __TBB_requires(parallel_for_index && parallel_for_function) void parallel_for(Index first, Index last, Index step, const Function& f) { - parallel_for_impl(first, last, step, f, auto_partitioner()); + parallel_for_impl(first, last, step, f, __TBB_DEFAULT_PARTITIONER()); } //! Parallel iteration over a range of integers with a step provided and simple partitioner template @@ -350,7 +350,7 @@ void parallel_for(Index first, Index last, Index step, const Function& f, affini template __TBB_requires(parallel_for_index && parallel_for_function) void parallel_for(Index first, Index last, const Function& f) { - parallel_for_impl(first, last, static_cast(1), f, auto_partitioner()); + parallel_for_impl(first, last, static_cast(1), f, __TBB_DEFAULT_PARTITIONER()); } //! Parallel iteration over a range of integers with a default step value and simple partitioner template @@ -395,7 +395,7 @@ void parallel_for_impl(Index first, Index last, Index step, const Function& f, P template __TBB_requires(parallel_for_index && parallel_for_function) void parallel_for(Index first, Index last, Index step, const Function& f, task_group_context &context) { - parallel_for_impl(first, last, step, f, auto_partitioner(), context); + parallel_for_impl(first, last, step, f, __TBB_DEFAULT_PARTITIONER(), context); } //! Parallel iteration over a range of integers with explicit step, task group context, and simple partitioner template @@ -426,7 +426,7 @@ void parallel_for(Index first, Index last, Index step, const Function& f, affini template __TBB_requires(parallel_for_index && parallel_for_function) void parallel_for(Index first, Index last, const Function& f, task_group_context &context) { - parallel_for_impl(first, last, static_cast(1), f, auto_partitioner(), context); + parallel_for_impl(first, last, static_cast(1), f, __TBB_DEFAULT_PARTITIONER(), context); } //! Parallel iteration over a range of integers with a default step value, explicit task group context, and simple partitioner template diff --git a/include/oneapi/tbb/parallel_scan.h b/include/oneapi/tbb/parallel_scan.h index 6d2a4d6401..133c11dacb 100644 --- a/include/oneapi/tbb/parallel_scan.h +++ b/include/oneapi/tbb/parallel_scan.h @@ -562,7 +562,7 @@ class lambda_scan_body { template __TBB_requires(tbb_range && parallel_scan_body) void parallel_scan( const Range& range, Body& body ) { - start_scan::run(range,body,__TBB_DEFAULT_PARTITIONER()); + start_scan::run(range,body,__TBB_DEFAULT_PARTITIONER()); } //! Parallel prefix with simple_partitioner From 5c77fff2fba36f2e8ee0015d2c5c580d9821cc0d Mon Sep 17 00:00:00 2001 From: blonded04 Date: Sun, 28 Apr 2024 15:19:27 +0300 Subject: [PATCH 2/6] modified copyright notices --- include/oneapi/tbb/parallel_for.h | 2 +- include/oneapi/tbb/parallel_scan.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/oneapi/tbb/parallel_for.h b/include/oneapi/tbb/parallel_for.h index 6ecfcb95be..37a2613508 100644 --- a/include/oneapi/tbb/parallel_for.h +++ b/include/oneapi/tbb/parallel_for.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2023 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/include/oneapi/tbb/parallel_scan.h b/include/oneapi/tbb/parallel_scan.h index 133c11dacb..d624f7ebdb 100644 --- a/include/oneapi/tbb/parallel_scan.h +++ b/include/oneapi/tbb/parallel_scan.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2005-2023 Intel Corporation + Copyright (c) 2005-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From f784915ee54bb60883f851f396c9608d5a95fed6 Mon Sep 17 00:00:00 2001 From: Valery Matskevich Date: Sun, 28 Apr 2024 15:26:10 +0300 Subject: [PATCH 3/6] need to sign commit actually Signed-off-by: Valery Matskevich --- include/oneapi/tbb/parallel_for.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/oneapi/tbb/parallel_for.h b/include/oneapi/tbb/parallel_for.h index 37a2613508..2745db12be 100644 --- a/include/oneapi/tbb/parallel_for.h +++ b/include/oneapi/tbb/parallel_for.h @@ -414,7 +414,7 @@ template __TBB_requires(parallel_for_index && parallel_for_function) void parallel_for(Index first, Index last, Index step, const Function& f, const static_partitioner& partitioner, task_group_context &context) { parallel_for_impl(first, last, step, f, partitioner, context); -} +} //! Parallel iteration over a range of integers with explicit step, task group context, and affinity partitioner template __TBB_requires(parallel_for_index && parallel_for_function) From ac0438dec9875b101679651bf1ef2e78e36f0926 Mon Sep 17 00:00:00 2001 From: Valery Matskevich Date: Sun, 28 Apr 2024 15:26:45 +0300 Subject: [PATCH 4/6] fix finished Signed-off-by: Valery Matskevich --- include/oneapi/tbb/parallel_for.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/oneapi/tbb/parallel_for.h b/include/oneapi/tbb/parallel_for.h index 2745db12be..37a2613508 100644 --- a/include/oneapi/tbb/parallel_for.h +++ b/include/oneapi/tbb/parallel_for.h @@ -414,7 +414,7 @@ template __TBB_requires(parallel_for_index && parallel_for_function) void parallel_for(Index first, Index last, Index step, const Function& f, const static_partitioner& partitioner, task_group_context &context) { parallel_for_impl(first, last, step, f, partitioner, context); -} +} //! Parallel iteration over a range of integers with explicit step, task group context, and affinity partitioner template __TBB_requires(parallel_for_index && parallel_for_function) From 83a4781171c0da6c33e6c701cb0c412f39a016b8 Mon Sep 17 00:00:00 2001 From: Valery Matskevich Date: Mon, 20 May 2024 17:33:40 +0300 Subject: [PATCH 5/6] modify task alignment for arm Signed-off-by: Valery Matskevich --- include/oneapi/tbb/detail/_task.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/oneapi/tbb/detail/_task.h b/include/oneapi/tbb/detail/_task.h index 636aea97b4..d0104e2c94 100644 --- a/include/oneapi/tbb/detail/_task.h +++ b/include/oneapi/tbb/detail/_task.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2020-2023 Intel Corporation + Copyright (c) 2020-2024 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -207,7 +207,11 @@ class task_traits { }; //! Alignment for a task object -static constexpr std::size_t task_alignment = 64; +#if __ARM_ARCH_7A__ || __aarch64__ +constexpr std::size_t task_alignment = 128; +#else /* Generic */ +constexpr std::size_t task_alignment = 64; +#endif //! Base class for user-defined tasks. /** @ingroup task_scheduling */ @@ -220,7 +224,7 @@ class alignas(task_alignment) task : public task_traits { virtual task* cancel(execution_data&) = 0; private: - std::uint64_t m_reserved[6]{}; + std::uint64_t m_reserved[(task_alignment - sizeof(void*) - sizeof(task_traits)) / sizeof(std::uint64_t)]{}; friend struct r1::task_accessor; }; static_assert(sizeof(task) == task_alignment, "task size is broken"); From 32044a0865c8c738384f449799b86fa13e339046 Mon Sep 17 00:00:00 2001 From: Valery Matskevich Date: Thu, 23 May 2024 19:48:47 +0300 Subject: [PATCH 6/6] fix m_reserved array size for 32 bit architectures Signed-off-by: Valery Matskevich --- include/oneapi/tbb/detail/_task.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/oneapi/tbb/detail/_task.h b/include/oneapi/tbb/detail/_task.h index d0104e2c94..e2b9a2b517 100644 --- a/include/oneapi/tbb/detail/_task.h +++ b/include/oneapi/tbb/detail/_task.h @@ -224,7 +224,11 @@ class alignas(task_alignment) task : public task_traits { virtual task* cancel(execution_data&) = 0; private: - std::uint64_t m_reserved[(task_alignment - sizeof(void*) - sizeof(task_traits)) / sizeof(std::uint64_t)]{}; +#if __ARM_ARCH_7A__ || __aarch64__ + std::uint64_t m_reserved[14]{}; +#else /* Generic */ + std::uint64_t m_reserved[6]{}; +#endif friend struct r1::task_accessor; }; static_assert(sizeof(task) == task_alignment, "task size is broken");