public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/proj/guru:master commit in: dev-cpp/tiny-dnn/files/, dev-cpp/tiny-dnn/
@ 2021-05-28 10:28 Andrew Ammerlaan
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Ammerlaan @ 2021-05-28 10:28 UTC (permalink / raw
  To: gentoo-commits

commit:     1fab63f837034302bb8ffa0ef7a5a18dd1c3cc04
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Thu May 27 09:35:36 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Thu May 27 09:35:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1fab63f8

dev-cpp/tiny-dnn: initial import

Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 dev-cpp/tiny-dnn/Manifest                          |  1 +
 ...iny-dnn-add-sphinx-ext-autodoc-to-conf-py.patch | 11 +++
 .../files/tiny-dnn-disable-gtest-download.patch    | 29 +++++++
 dev-cpp/tiny-dnn/metadata.xml                      | 89 ++++++++++++++++++++++
 dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3.ebuild      | 84 ++++++++++++++++++++
 5 files changed, 214 insertions(+)

diff --git a/dev-cpp/tiny-dnn/Manifest b/dev-cpp/tiny-dnn/Manifest
new file mode 100644
index 000000000..5cf90f420
--- /dev/null
+++ b/dev-cpp/tiny-dnn/Manifest
@@ -0,0 +1 @@
+DIST tiny-dnn-1.0.0_alpha3.tar.gz 12885646 BLAKE2B 85c0715ab6c692b77522487775e70b0db645528baed1830c83c9f44d2b67a5207e4f7ea1709b35c6a4217d287199549304e9be19f4a5cec9a1183b0b5dccc562 SHA512 5f2c1a161771efa67e85b1fea395953b7744e29f61187ac5a6c54c912fb195b3aef9a5827135c3668bd0eeea5ae04a33cc433e1f6683e2b7955010a2632d168b

diff --git a/dev-cpp/tiny-dnn/files/tiny-dnn-add-sphinx-ext-autodoc-to-conf-py.patch b/dev-cpp/tiny-dnn/files/tiny-dnn-add-sphinx-ext-autodoc-to-conf-py.patch
new file mode 100644
index 000000000..4fadeaa90
--- /dev/null
+++ b/dev-cpp/tiny-dnn/files/tiny-dnn-add-sphinx-ext-autodoc-to-conf-py.patch
@@ -0,0 +1,11 @@
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -32,7 +32,7 @@
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+ # ones.
+ extensions = [
+-    'sphinx.ext.mathjax'
++    'sphinx.ext.mathjax', 'sphinx.ext.autodoc'
+ ]
+ 
+ # Add any paths that contain templates here, relative to this directory.

diff --git a/dev-cpp/tiny-dnn/files/tiny-dnn-disable-gtest-download.patch b/dev-cpp/tiny-dnn/files/tiny-dnn-disable-gtest-download.patch
new file mode 100644
index 000000000..40b65ed23
--- /dev/null
+++ b/dev-cpp/tiny-dnn/files/tiny-dnn-disable-gtest-download.patch
@@ -0,0 +1,29 @@
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -2,17 +2,6 @@
+ enable_testing()
+ 
+ 
+-include(../cmake/DownloadProject/DownloadProject.cmake)
+-#set(gtest_disable_pthreads on) #TODO(randl): Windows?
+-download_project(
+-    PROJ googletest
+-    GIT_REPOSITORY https://github.com/google/googletest.git
+-    GIT_TAG master
+-    UPDATE_DISCONNECTED 1
+-)
+-
+-add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
+-
+ enable_testing()
+ 
+ # in ../googletest-src/googletest/CMakeLists.txt, BUILD_SHARED_LIBS is set to OFF
+@@ -29,7 +18,7 @@
+ 
+ add_executable(tiny_dnn_test test.cpp test_no_duplicate_symbols.cpp)
+ target_link_libraries(tiny_dnn_test
+-    ${project_library_target_name} ${REQUIRED_LIBRARIES} gtest gmock)
++    ${project_library_target_name} ${REQUIRED_LIBRARIES})
+ 
+ add_test(all_tests tiny_dnn_test)
+ # workaround for https://gitlab.kitware.com/cmake/cmake/issues/8774

diff --git a/dev-cpp/tiny-dnn/metadata.xml b/dev-cpp/tiny-dnn/metadata.xml
new file mode 100644
index 000000000..5f2810ee5
--- /dev/null
+++ b/dev-cpp/tiny-dnn/metadata.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>lssndrbarbieri@gmail.com</email>
+		<name>Alessandro Barbieri</name>
+	</maintainer>
+	<longdescription>
+Features
+
+Reasonably fast, without GPU:
+With TBB threading and SSE/AVX vectorization.
+98.8% accuracy on MNIST in 13 minutes training (@Core i7-3520M).
+Portable and header-only:
+Runs anywhere as long as you have a compiler which supports C++14.
+Just include tiny_dnn.h and write your model in C++. There is nothing to install.
+Easy to integrate with real applications:
+No output to stdout/stderr.
+A constant throughput (simple parallelization model, no garbage collection).
+Works without throwing an exception.
+Can import caffe's model.
+Simply implemented:
+A good library for learning neural networks.
+
+Supported networks
+
+layer-types
+
+core
+fully connected
+dropout
+linear operation
+zero padding
+power
+convolution
+convolutional
+average pooling
+max pooling
+deconvolutional
+average unpooling
+max unpooling
+normalization
+contrast normalization (only forward pass)
+batch normalization
+split/merge
+concat
+slice
+elementwise-add
+activation functions
+
+tanh
+asinh
+sigmoid
+softmax
+softplus
+softsign
+rectified linear(relu)
+leaky relu
+identity
+scaled tanh
+exponential linear units(elu)
+scaled exponential linear units (selu)
+loss functions
+
+cross-entropy
+mean squared error
+mean absolute error
+mean absolute error with epsilon range
+optimization algorithms
+
+stochastic gradient descent (with/without L2 normalization)
+momentum and Nesterov momentum
+adagrad
+rmsprop
+adam
+adamax
+	</longdescription>
+	<use>
+		<flag name="double-precision">Build tiny-dnn with double precision computations</flag>
+		<!--<flag name="libdnn">Build tiny-dnn with GreenteaLibDNN library support</flag>-->
+		<!--<flag name="nnpack">Build tiny-dnn with NNPACK library support</flag>-->
+		<flag name="opencl">Build tiny-dnn with OpenCL library support</flag>
+		<flag name="serialization">Build tiny-dnn with Serialization support</flag>
+		<flag name="tbb">Build tiny-dnn with TBB library support</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">tiny-dnn/tiny-dnn</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3.ebuild b/dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3.ebuild
new file mode 100644
index 000000000..c01cd7f58
--- /dev/null
+++ b/dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DOCS_BUILDER="sphinx"
+DOCS_DEPEND="dev-python/recommonmark"
+DOCS_DIR="docs"
+MYPV="${PV/_alpha/a}"
+PYTHON_COMPAT=( python3_{7,8,9} )
+
+inherit cmake python-any-r1 docs
+
+DESCRIPTION="header only, dependency-free deep learning framework in C++14"
+HOMEPAGE="https://github.com/tiny-dnn/tiny-dnn"
+SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${MYPV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${PN}-${MYPV}"
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_sse double-precision opencl openmp +serialization tbb test"
+REQUIRED_USE="
+	?? ( openmp tbb )
+"
+RESTRICT="test" #tests doesn't build ...
+
+# headers as rdepend because this is also an header only library
+RDEPEND="
+	opencl? (
+		dev-util/opencl-headers
+		virtual/opencl
+	)
+	serialization? ( dev-libs/cereal )
+	tbb? ( dev-cpp/tbb )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-add-sphinx-ext-autodoc-to-conf-py.patch"
+	"${FILESDIR}/${PN}-disable-gtest-download.patch"
+)
+
+src_prepare() {
+	#remove bundled cereal
+	rm -r cereal || die
+	cmake_src_prepare
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DBUILD_DOCS=OFF
+		-DBUILD_EXAMPLES=OFF
+		-DCOVERALLS=OFF
+		-DUSE_LIBDNN=OFF
+		-DUSE_NNPACK=OFF
+
+		-DBUILD_TESTS=$(usex test)
+		-DUSE_AVX=$(usex cpu_flags_x86_avx)
+		-DUSE_AVX2=$(usex cpu_flags_x86_avx2)
+		-DUSE_DOUBLE=$(usex double-precision)
+		-DUSE_OMP=$(usex openmp)
+		-DUSE_OPENCL=$(usex opencl)
+		-DUSE_SERIALIZER=$(usex serialization)
+		-DUSE_SSE=$(usex cpu_flags_x86_sse)
+		-DUSE_TBB=$(usex tbb)
+	)
+	cmake_src_configure
+}
+
+src_compile() {
+	cmake_src_compile
+	docs_compile
+}
+
+src_install() {
+	cmake_src_install
+	if use doc; then
+		dodoc -r _build/html
+		docompress -x "/usr/share/doc/${PF}/html"
+	fi
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/proj/guru:master commit in: dev-cpp/tiny-dnn/files/, dev-cpp/tiny-dnn/
@ 2022-04-23 17:49 Haelwenn Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Haelwenn Monnier @ 2022-04-23 17:49 UTC (permalink / raw
  To: gentoo-commits

commit:     4e77e72cf8e7f05dc42cbea65fefb39ceec49c6f
Author:     Alessandro Barbieri <lssndrbarbieri <AT> gmail <DOT> com>
AuthorDate: Sat Apr 23 00:48:59 2022 +0000
Commit:     Haelwenn Monnier <contact <AT> hacktivis <DOT> me>
CommitDate: Sat Apr 23 01:52:55 2022 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=4e77e72c

dev-cpp/tiny-dnn: update EAPI 7 -> 8

Signed-off-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>

 .../files/tiny-dnn-1.0.0_alpha3-system-libs.patch  | 123 +++++++++++++++++++++
 ...pha3.ebuild => tiny-dnn-1.0.0_alpha3-r1.ebuild} |  26 +++--
 2 files changed, 139 insertions(+), 10 deletions(-)

diff --git a/dev-cpp/tiny-dnn/files/tiny-dnn-1.0.0_alpha3-system-libs.patch b/dev-cpp/tiny-dnn/files/tiny-dnn-1.0.0_alpha3-system-libs.patch
new file mode 100644
index 000000000..5871abad7
--- /dev/null
+++ b/dev-cpp/tiny-dnn/files/tiny-dnn-1.0.0_alpha3-system-libs.patch
@@ -0,0 +1,123 @@
+--- a/test/test_core.h
++++ b/test/test_core.h
+@@ -35,7 +35,7 @@
+ #include "tiny_dnn/tiny_dnn.h"
+ 
+ #if defined(USE_OPENCL) || defined(USE_CUDA)
+-#include "third_party/CLCudaAPI/clpp11.h"
++#include "CLCudaAPI/clpp11.h"
+ #endif  // defined(USE_OPENCL) || defined(USE_CUDA)
+ 
+ namespace tiny_dnn {
+--- a/tiny_dnn/core/framework/device.fwd.h
++++ b/tiny_dnn/core/framework/device.fwd.h
+@@ -46,9 +46,9 @@
+ 
+ #if defined(USE_OPENCL) || defined(USE_CUDA)
+ #ifdef USE_OPENCL
+-#include "third_party/CLCudaAPI/clpp11.h"
++#include "CLCudaAPI/clpp11.h"
+ #else
+-#include "third_party/CLCudaAPI/cupp11.h"
++#include "CLCudaAPI/cupp11.h"
+ #endif
+ #endif
+ 
+--- a/tiny_dnn/core/framework/program.h
++++ b/tiny_dnn/core/framework/program.h
+@@ -49,9 +49,9 @@
+ 
+ #if defined(USE_OPENCL) || defined(USE_CUDA)
+ #ifdef USE_OPENCL
+-#include "third_party/CLCudaAPI/clpp11.h"
++#include "CLCudaAPI/clpp11.h"
+ #else
+-#include "third_party/CLCudaAPI/cupp11.h"
++#include "CLCudaAPI/cupp11.h"
+ #endif
+ #endif
+ 
+--- a/tiny_dnn/core/framework/program_manager.h
++++ b/tiny_dnn/core/framework/program_manager.h
+@@ -51,9 +51,9 @@
+ 
+ #if defined(USE_OPENCL) || defined(USE_CUDA)
+ #ifdef USE_OPENCL
+-#include "third_party/CLCudaAPI/clpp11.h"
++#include "CLCudaAPI/clpp11.h"
+ #else
+-#include "third_party/CLCudaAPI/cupp11.h"
++#include "CLCudaAPI/cupp11.h"
+ #endif
+ #endif
+ 
+--- a/tiny_dnn/core/framework/tensor.h
++++ b/tiny_dnn/core/framework/tensor.h
+@@ -53,9 +53,9 @@
+ 
+ #if defined(USE_OPENCL) || defined(USE_CUDA)
+ #ifdef USE_OPENCL
+-#include "third_party/CLCudaAPI/clpp11.h"
++#include "CLCudaAPI/clpp11.h"
+ #else
+-#include "third_party/CLCudaAPI/cupp11.h"
++#include "CLCudaAPI/cupp11.h"
+ #endif
+ #endif
+ 
+--- a/tiny_dnn/core/kernels/tiny_quantized_matmul_kernel.h
++++ b/tiny_dnn/core/kernels/tiny_quantized_matmul_kernel.h
+@@ -15,7 +15,7 @@
+ 
+ // Implements a quantized eight-bit version of the matmul operation.
+ 
+-#include "third_party/gemmlowp/public/gemmlowp.h"
++#include "gemmlowp/public/gemmlowp.h"
+ #include "tiny_dnn/core/kernels/tiny_quantization_kernel.h"
+ 
+ namespace tiny_dnn {
+--- a/tiny_dnn/util/image.h
++++ b/tiny_dnn/util/image.h
+@@ -39,15 +39,15 @@
+ 
+ #define STB_IMAGE_IMPLEMENTATION
+ #define STB_IMAGE_INLINE // We need this define to avoid multiple definition
+-#include "third_party/stb/stb_image.h"
++#include "stb/stb_image.h"
+ 
+ #define STB_IMAGE_RESIZE_IMPLEMENTATION
+ #define STB_IMAGE_RESIZE_INLINE
+-#include "third_party/stb/stb_image_resize.h"
++#include "stb/stb_image_resize.h"
+ 
+ #define STB_IMAGE_WRITE_IMPLEMENTATION
+ #define STB_IMAGE_WRITE_INLINE
+-#include "third_party/stb/stb_image_write.h"
++#include "stb/stb_image_write.h"
+ 
+ 
+ namespace tiny_dnn {
+--- a/tiny_dnn/util/util.h
++++ b/tiny_dnn/util/util.h
+@@ -52,9 +52,9 @@
+ 
+ #if defined(USE_OPENCL) || defined(USE_CUDA)
+ #ifdef USE_OPENCL
+-#include "third_party/CLCudaAPI/clpp11.h"
++#include "CLCudaAPI/clpp11.h"
+ #else
+-#include "third_party/CLCudaAPI/cupp11.h"
++#include "CLCudaAPI/cupp11.h"
+ #endif
+ #endif
+ 
+--- a/.travis/cpplint_test.sh
++++ b/.travis/cpplint_test.sh
+@@ -1,6 +1,6 @@
+ #!/bin/bash
+ 
+-python third_party/cpplint.py \
++cpplint.py \
+       --extensions=cpp,h \
+       --filter=-build/header_guard,-runtime/references \
+       tiny_dnn/*/* examples/*/* test/*/*/*/*

diff --git a/dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3.ebuild b/dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3-r1.ebuild
similarity index 84%
rename from dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3.ebuild
rename to dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3-r1.ebuild
index 93895644b..7235c5afa 100644
--- a/dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3.ebuild
+++ b/dev-cpp/tiny-dnn/tiny-dnn-1.0.0_alpha3-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 DOCS_BUILDER="sphinx"
 DOCS_DEPEND="dev-python/recommonmark"
@@ -15,17 +15,16 @@ DESCRIPTION="header only, dependency-free deep learning framework in C++14"
 HOMEPAGE="https://github.com/tiny-dnn/tiny-dnn"
 SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/v${MYPV}.tar.gz -> ${P}.tar.gz"
 S="${WORKDIR}/${PN}-${MYPV}"
+
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_sse double-precision opencl openmp +serialization tbb test"
-REQUIRED_USE="
-	?? ( openmp tbb )
-"
-RESTRICT="test" #tests doesn't build ...
+IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_sse double-precision opencl openmp +serialization tbb test" # TODO: cuda
 
 # headers as rdepend because this is also an header only library
 RDEPEND="
+	dev-cpp/gemmlowp
+	dev-libs/stb
 	opencl? (
 		dev-util/opencl-headers
 		virtual/opencl
@@ -33,19 +32,26 @@ RDEPEND="
 	serialization? ( dev-libs/cereal )
 	tbb? ( dev-cpp/tbb )
 "
-DEPEND="${RDEPEND}"
-BDEPEND="
-	test? ( dev-cpp/gtest )
+DEPEND="
+	${RDEPEND}
+	test? (
+		dev-cpp/catch:0
+		dev-cpp/gtest
+	)
 "
 
+REQUIRED_USE="^^ ( openmp tbb )"
+RESTRICT="test" #tests doesn't build ...
 PATCHES=(
 	"${FILESDIR}/${PN}-add-sphinx-ext-autodoc-to-conf-py.patch"
 	"${FILESDIR}/${PN}-disable-gtest-download.patch"
+	"${FILESDIR}/${P}-system-libs.patch"
 )
 
 src_prepare() {
 	#remove bundled cereal
 	rm -r cereal || die
+	rm -r third_party || die
 	cmake_src_prepare
 }
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-23 17:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-28 10:28 [gentoo-commits] repo/proj/guru:master commit in: dev-cpp/tiny-dnn/files/, dev-cpp/tiny-dnn/ Andrew Ammerlaan
  -- strict thread matches above, loose matches on Subject: below --
2022-04-23 17:49 Haelwenn Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox