From f2486a6cf962669e4088421cf68fe862665d5477 Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Tue, 28 Jan 2025 10:01:47 -0700 Subject: [PATCH] package/pthreadpool: new package This package is required by tensorflow-lite. Signed-off-by: James Hilliard Signed-off-by: Julien Olivain --- DEVELOPERS | 1 + package/Config.in | 1 + package/pthreadpool/Config.in | 8 +++++++ package/pthreadpool/pthreadpool.hash | 4 ++++ package/pthreadpool/pthreadpool.mk | 33 ++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 package/pthreadpool/Config.in create mode 100644 package/pthreadpool/pthreadpool.hash create mode 100644 package/pthreadpool/pthreadpool.mk diff --git a/DEVELOPERS b/DEVELOPERS index f5abea5a16..b7d4958aec 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -3035,6 +3035,7 @@ F: package/ti-gfx/ N: Stefan Hager F: package/cpuinfo/ F: package/gemmlowp/ +F: package/pthreadpool/ F: package/ruy/ N: Stefan Nickl diff --git a/package/Config.in b/package/Config.in index 594ee41d06..13caddec34 100644 --- a/package/Config.in +++ b/package/Config.in @@ -2297,6 +2297,7 @@ endif source "package/protobuf/Config.in" source "package/protobuf-c/Config.in" source "package/protozero/Config.in" + source "package/pthreadpool/Config.in" source "package/qhull/Config.in" source "package/qlibc/Config.in" source "package/reproc/Config.in" diff --git a/package/pthreadpool/Config.in b/package/pthreadpool/Config.in new file mode 100644 index 0000000000..194ae33f85 --- /dev/null +++ b/package/pthreadpool/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_PTHREADPOOL + bool "pthreadpool" + select BR2_PACKAGE_FXDIV + help + Pthreadpool is a portable and efficient thread pool + implementation. + + https://github.com/Maratyszcza/pthreadpool diff --git a/package/pthreadpool/pthreadpool.hash b/package/pthreadpool/pthreadpool.hash new file mode 100644 index 0000000000..4adc1507f9 --- /dev/null +++ b/package/pthreadpool/pthreadpool.hash @@ -0,0 +1,4 @@ +# Locally calculated +sha256 8d8ebab96df6aa12922643060e72c43bfdca9fd80cf5aacaf7391bc6850560a3 pthreadpool-560c60d342a76076f0557a3946924c6478470044.tar.gz +# License files, locally calculated +sha256 57814a606b4d0fb087d9a534919084b6c11b58a4174cb5a4aef200187780dc3a LICENSE diff --git a/package/pthreadpool/pthreadpool.mk b/package/pthreadpool/pthreadpool.mk new file mode 100644 index 0000000000..6a05256461 --- /dev/null +++ b/package/pthreadpool/pthreadpool.mk @@ -0,0 +1,33 @@ +################################################################################ +# +# pthreadpool +# +################################################################################ + +PTHREADPOOL_VERSION = 560c60d342a76076f0557a3946924c6478470044 +PTHREADPOOL_SITE = $(call github,Maratyszcza,pthreadpool,$(PTHREADPOOL_VERSION)) +PTHREADPOOL_LICENSE = BSD-2-Clause +PTHREADPOOL_LICENSE_FILES = LICENSE +PTHREADPOOL_INSTALL_STAGING = YES +PTHREADPOOL_DEPENDENCIES = fxdiv + +PTHREADPOOL_CFLAGS = $(TARGET_CFLAGS) +PTHREADPOOL_CXXFLAGS = $(TARGET_CXXFLAGS) + +ifeq ($(BR2_PACKAGE_CPUINFO),y) +PTHREADPOOL_DEPENDENCIES += cpuinfo +PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=1 +PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=1 +else +PTHREADPOOL_CFLAGS += -DPTHREADPOOL_USE_CPUINFO=0 +PTHREADPOOL_CXXFLAGS += -DPTHREADPOOL_USE_CPUINFO=0 +endif + +PTHREADPOOL_CONF_OPTS = \ + -DCMAKE_C_FLAGS="$(PTHREADPOOL_CFLAGS)" \ + -DCMAKE_CXX_FLAGS="$(PTHREADPOOL_CXXFLAGS)" \ + -DFXDIV_SOURCE_DIR="$(FXDIV_DIR)" \ + -DPTHREADPOOL_BUILD_TESTS=OFF \ + -DPTHREADPOOL_BUILD_BENCHMARKS=OFF + +$(eval $(cmake-package))