SHA256
6
0
forked from pool/tbb

Accepting request 1093260 from home:polslinux:branches:devel:libraries:c_c++

- Update to 2021.9.0:
  * Hybrid CPU support is now a fully supported feature.
  * Fixed the issue reported by the Address Sanitizer.
  * Fixed the input_type alias exposed by flow_graph::join_node.
- Drop 917.patch
- Drop retry-pthread_create.patch

OBS-URL: https://build.opensuse.org/request/show/1093260
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/tbb?expand=0&rev=83
This commit is contained in:
Dirk Mueller 2023-06-15 20:38:31 +00:00 committed by Git OBS Bridge
parent 4979ce178a
commit 971a403f28
6 changed files with 15 additions and 148 deletions

View File

@ -1,78 +0,0 @@
From d9049c052c99162e26f86cf2a4982d026bf7dc57 Mon Sep 17 00:00:00 2001
From: Mo Zhou <cdluminate@gmail.com>
Date: Fri, 20 May 2022 09:02:53 -0400
Subject: [PATCH 1/2] Fix build failure for s390x and hppa architectures.
Signed-off-by: Mo Zhou <cdluminate@gmail.com>
---
src/tbb/tools_api/ittnotify_config.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/tbb/tools_api/ittnotify_config.h b/src/tbb/tools_api/ittnotify_config.h
index 5e7c0cdf5..411de0852 100644
--- a/src/tbb/tools_api/ittnotify_config.h
+++ b/src/tbb/tools_api/ittnotify_config.h
@@ -167,6 +167,14 @@
# define ITT_ARCH_LOONGARCH64 7
#endif /* ITT_ARCH_LOONGARCH64 */
+#ifndef ITT_ARCH_S390X
+# define ITT_ARCH_S390X 8
+#endif /* ITT_ARCH_S390X */
+
+#ifndef ITT_ARCH_HPPA
+# define ITT_ARCH_HPPA 9
+#endif /* ITT_ARCH_HPPA */
+
#ifndef ITT_ARCH
# if defined _M_IX86 || defined __i386__
# define ITT_ARCH ITT_ARCH_IA32
@@ -182,6 +190,10 @@
# define ITT_ARCH ITT_ARCH_PPC64
# elif defined __loongarch__
# define ITT_ARCH ITT_ARCH_LOONGARCH64
+# elif defined __s390__ || defined __s390x__
+# define ITT_ARCH ITT_ARCH_S390X
+# elif defined __hppa__
+# define ITT_ARCH ITT_ARCH_HPPA
# endif
#endif
From b0e9f8636e49c337836392d811fda403dc7102a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dirk=20M=C3=BCller?= <dirk@dmllr.de>
Date: Sat, 24 Sep 2022 14:27:24 +0200
Subject: [PATCH 2/2] Add riscv64 architecture detection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Dirk Müller <dirk@dmllr.de>
---
src/tbb/tools_api/ittnotify_config.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/tbb/tools_api/ittnotify_config.h b/src/tbb/tools_api/ittnotify_config.h
index 411de0852..11422fd57 100644
--- a/src/tbb/tools_api/ittnotify_config.h
+++ b/src/tbb/tools_api/ittnotify_config.h
@@ -175,6 +175,10 @@
# define ITT_ARCH_HPPA 9
#endif /* ITT_ARCH_HPPA */
+#ifndef ITT_ARCH_RISCV64
+# define ITT_ARCH_RISCV64 10
+#endif /* ITT_ARCH_RISCV64 */
+
#ifndef ITT_ARCH
# if defined _M_IX86 || defined __i386__
# define ITT_ARCH ITT_ARCH_IA32
@@ -194,6 +198,8 @@
# define ITT_ARCH ITT_ARCH_S390X
# elif defined __hppa__
# define ITT_ARCH ITT_ARCH_HPPA
+# elif defined __riscv && __riscv_xlen == 64
+# define ITT_ARCH ITT_ARCH_RISCV64
# endif
#endif

View File

@ -1,63 +0,0 @@
From f12c93efd04991bc982a27e2fa6142538c33ca82 Mon Sep 17 00:00:00 2001
From: Rui Ueyama <ruiu@cs.stanford.edu>
Date: Sat, 7 May 2022 19:55:24 +0800
Subject: [PATCH] Retry if pthread_create fails with EAGAIN
On many Unix-like systems, pthread_create can fail spuriously even if
the running machine has enough resources to spawn a new thread.
Therefore, if EAGAIN is returned from pthread_create, we actually have
to try again.
I observed this issue when running the mold linker
(https://github.com/rui314/mold) under a heavy load. mold uses OneTBB
for parallelization.
As another data point, Go has the same logic to retry on EAGAIN:
https://go-review.googlesource.com/c/go/+/33894/
nanosleep is defined in POSIX 2001, so I believe that all Unix-like
systems support it.
Signed-off-by: Rui Ueyama <ruiu@cs.stanford.edu>
---
src/tbb/rml_thread_monitor.h | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/tbb/rml_thread_monitor.h b/src/tbb/rml_thread_monitor.h
index 13b556380..5b844b232 100644
--- a/src/tbb/rml_thread_monitor.h
+++ b/src/tbb/rml_thread_monitor.h
@@ -31,6 +31,7 @@
#include <pthread.h>
#include <cstring>
#include <cstdlib>
+#include <time.h>
#else
#error Unsupported platform
#endif
@@ -191,8 +192,24 @@ inline thread_monitor::handle_type thread_monitor::launch( void* (*thread_routin
check(pthread_attr_init( &s ), "pthread_attr_init has failed");
if( stack_size>0 )
check(pthread_attr_setstacksize( &s, stack_size ), "pthread_attr_setstack_size has failed" );
+
pthread_t handle;
- check( pthread_create( &handle, &s, thread_routine, arg ), "pthread_create has failed" );
+ int tries = 0;
+ for (;;) {
+ int error_code = pthread_create(&handle, &s, thread_routine, arg);
+ if (!error_code)
+ break;
+ if (error_code != EAGAIN || tries++ > 20) {
+ handle_perror(error_code, "pthread_create has failed");
+ break;
+ }
+
+ // pthreaed_create can spuriously fail on many Unix-like systems.
+ // Retry after tries * 1 millisecond.
+ struct timespec ts = {0, tries * 1000 * 1000};
+ nanosleep(&ts, NULL);
+ }
+
check( pthread_attr_destroy( &s ), "pthread_attr_destroy has failed" );
return handle;
}

BIN
tbb-2021.8.0.tar.gz (Stored with Git LFS)

Binary file not shown.

3
tbb-2021.9.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1ce48f34dada7837f510735ff1172f6e2c261b09460e3bf773b49791d247d24e
size 2579150

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Jun 15 08:34:01 UTC 2023 - Paolo Stivanin <info@paolostivanin.com>
- Update to 2021.9.0:
* Hybrid CPU support is now a fully supported feature.
* Fixed the issue reported by the Address Sanitizer.
* Fixed the input_type alias exposed by flow_graph::join_node.
- Drop 917.patch
- Drop retry-pthread_create.patch
-------------------------------------------------------------------
Wed Jan 4 20:08:08 UTC 2023 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package tbb
#
# Copyright (c) 2022 SUSE LLC
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -40,7 +40,7 @@
%bcond_with python3
%endif
Name: tbb
Version: 2021.8.0
Version: 2021.9.0
Release: 0
Summary: Threading Building Blocks (TBB)
License: Apache-2.0
@ -48,10 +48,8 @@ Group: Development/Libraries/C and C++
URL: https://www.threadingbuildingblocks.org/
Source0: https://github.com/oneapi-src/oneTBB/archive/v%{version}.tar.gz#/tbb-%{version}.tar.gz
Source99: tbb-rpmlintrc
Patch1: https://github.com/oneapi-src/oneTBB/pull/917.patch
# PATCH-FIX-OPENSUSE cmake-remove-include-path.patch -- openCV include error
Patch2: cmake-remove-include-path.patch
Patch3: retry-pthread_create.patch
Patch4: add-cmake-check-for-libatomic-requirement-when-build.patch
BuildRequires: cmake
BuildRequires: fdupes