From: David Elsing <david.elsing@posteo.net>
To: 58261@debbugs.gnu.org
Cc: David Elsing <david.elsing@posteo.net>
Subject: [bug#58261] [PATCH v3 02/15] gnu: Add pocketfft-cpp.
Date: Thu, 13 Oct 2022 21:04:11 +0000 [thread overview]
Message-ID: <20221013210424.993-3-david.elsing@posteo.net> (raw)
In-Reply-To: <20221007152148.32591-1-david.elsing@posteo.net>
* gnu/packages/cpp.scm (pocketfft-cpp): New variable.
---
gnu/packages/cpp.scm | 29 +++++
.../pocketfft-cpp-default-disable-simd.patch | 108 ++++++++++++++++++
2 files changed, 137 insertions(+)
create mode 100644 gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index eba39ed660..2b5841e777 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -2004,3 +2004,32 @@ (define-public fast-float
floating point numbers from strings. It implements the C++ from_chars
functions for the float and double types.")
(license (list license:asl2.0 license:expat)))) ; dual licensed
+
+(define-public pocketfft-cpp
+ (let ((commit "daa8bb18327bc5c7d22c69428c25cf5dc64167d3")
+ (revision "0"))
+ (package
+ (name "pocketfft-cpp")
+ (version (git-version "0" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mreineck/pocketfft")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1dbkkqkmkxgmz1qjpsqzic5ig3qw1pqndbb3dvjc7xq5f2rdzyq1"))
+ (patches (search-patches
+ "pocketfft-cpp-default-disable-simd.patch"))))
+ (build-system copy-build-system)
+ (arguments
+ (list
+ #:install-plan
+ #~'(("pocketfft_hdronly.h" "include/"))))
+ (home-page "https://github.com/mreineck/pocketfft")
+ (synopsis "C++11 header-only Fast Fourier Transform library")
+ (description "This package provides a single-header C++11 library for
+computing Fast Fourier transformations. It supports multidimensional arrays,
+different floating point sizes and complex transformations.")
+ (license license:bsd-3))))
diff --git a/gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch b/gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch
new file mode 100644
index 0000000000..4d2ddae4b5
--- /dev/null
+++ b/gnu/packages/patches/pocketfft-cpp-default-disable-simd.patch
@@ -0,0 +1,108 @@
+Disable SIMD instructions by default.
+They can be enabled by setting -DPOCKETFFT_NO_VECTORS=0.
+
+diff --git a/pocketfft_hdronly.h b/pocketfft_hdronly.h
+index d75ada6..b2d0a23 100644
+--- a/pocketfft_hdronly.h
++++ b/pocketfft_hdronly.h
+@@ -39,6 +39,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #ifndef POCKETFFT_HDRONLY_H
+ #define POCKETFFT_HDRONLY_H
+
++#ifndef POCKETFFT_NO_VECTORS
++#define POCKETFFT_NO_VECTORS 1
++#endif
++
+ #ifndef __cplusplus
+ #error This file is C++ and requires a C++ compiler.
+ #endif
+@@ -106,29 +110,29 @@ constexpr bool FORWARD = true,
+ BACKWARD = false;
+
+ // only enable vector support for gcc>=5.0 and clang>=5.0
+-#ifndef POCKETFFT_NO_VECTORS
+-#define POCKETFFT_NO_VECTORS
++#if !(POCKETFFT_NO_VECTORS)
++#define POCKETFFT_NO_VECTORS 1
+ #if defined(__INTEL_COMPILER)
+ // do nothing. This is necessary because this compiler also sets __GNUC__.
+ #elif defined(__clang__)
+ // AppleClang has their own version numbering
+ #ifdef __apple_build_version__
+ # if (__clang_major__ > 9) || (__clang_major__ == 9 && __clang_minor__ >= 1)
+-# undef POCKETFFT_NO_VECTORS
++#define POCKETFFT_NO_VECTORS 0
+ # endif
+ #elif __clang_major__ >= 5
+-# undef POCKETFFT_NO_VECTORS
++#define POCKETFFT_NO_VECTORS 0
+ #endif
+ #elif defined(__GNUC__)
+ #if __GNUC__>=5
+-#undef POCKETFFT_NO_VECTORS
++#define POCKETFFT_NO_VECTORS 0
+ #endif
+ #endif
+ #endif
+
+ template<typename T> struct VLEN { static constexpr size_t val=1; };
+
+-#ifndef POCKETFFT_NO_VECTORS
++#if !(POCKETFFT_NO_VECTORS)
+ #if (defined(__AVX512F__))
+ template<> struct VLEN<float> { static constexpr size_t val=16; };
+ template<> struct VLEN<double> { static constexpr size_t val=8; };
+@@ -145,7 +149,7 @@ template<> struct VLEN<double> { static constexpr size_t val=2; };
+ template<> struct VLEN<float> { static constexpr size_t val=4; };
+ template<> struct VLEN<double> { static constexpr size_t val=2; };
+ #else
+-#define POCKETFFT_NO_VECTORS
++#define POCKETFFT_NO_VECTORS 1
+ #endif
+ #endif
+
+@@ -180,7 +184,7 @@ template<typename T> class arr
+ T *p;
+ size_t sz;
+
+-#if defined(POCKETFFT_NO_VECTORS)
++#if POCKETFFT_NO_VECTORS
+ static T *ralloc(size_t num)
+ {
+ if (num==0) return nullptr;
+@@ -3026,7 +3030,7 @@ class rev_iter
+ template<typename T> struct VTYPE {};
+ template <typename T> using vtype_t = typename VTYPE<T>::type;
+
+-#ifndef POCKETFFT_NO_VECTORS
++#if !(POCKETFFT_NO_VECTORS)
+ template<> struct VTYPE<float>
+ {
+ using type = float __attribute__ ((vector_size (VLEN<float>::val*sizeof(float))));
+@@ -3139,7 +3143,7 @@ POCKETFFT_NOINLINE void general_nd(const cndarr<T> &in, ndarr<T> &out,
+ auto storage = alloc_tmp<T0>(in.shape(), len, sizeof(T));
+ const auto &tin(iax==0? in : out);
+ multi_iter<vlen> it(tin, out, axes[iax]);
+-#ifndef POCKETFFT_NO_VECTORS
++#if !(POCKETFFT_NO_VECTORS)
+ if (vlen>1)
+ while (it.remaining()>=vlen)
+ {
+@@ -3245,7 +3249,7 @@ template<typename T> POCKETFFT_NOINLINE void general_r2c(
+ constexpr auto vlen = VLEN<T>::val;
+ auto storage = alloc_tmp<T>(in.shape(), len, sizeof(T));
+ multi_iter<vlen> it(in, out, axis);
+-#ifndef POCKETFFT_NO_VECTORS
++#if !(POCKETFFT_NO_VECTORS)
+ if (vlen>1)
+ while (it.remaining()>=vlen)
+ {
+@@ -3300,7 +3304,7 @@ template<typename T> POCKETFFT_NOINLINE void general_c2r(
+ constexpr auto vlen = VLEN<T>::val;
+ auto storage = alloc_tmp<T>(out.shape(), len, sizeof(T));
+ multi_iter<vlen> it(in, out, axis);
+-#ifndef POCKETFFT_NO_VECTORS
++#if !(POCKETFFT_NO_VECTORS)
+ if (vlen>1)
+ while (it.remaining()>=vlen)
+ {
--
2.37.0
next prev parent reply other threads:[~2022-10-13 21:06 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-02 22:55 [bug#58261] [PATCH 00/11] Add rdkit David Elsing
2022-10-03 0:19 ` [bug#58261] [PATCH 01/11] gnu: Add fast-float David Elsing
2022-10-04 6:57 ` Liliana Marie Prikler via Guix-patches via
2022-10-07 15:08 ` David Elsing
2022-10-03 0:19 ` [bug#58261] [PATCH 02/11] gnu: Add pocketfft David Elsing
2022-10-04 7:09 ` Liliana Marie Prikler
2022-10-07 15:10 ` David Elsing
2022-10-03 0:19 ` [bug#58261] [PATCH 03/11] gnu: Add sajson David Elsing
2022-10-04 7:22 ` Liliana Marie Prikler
2022-10-07 15:10 ` David Elsing
2022-10-03 0:19 ` [bug#58261] [PATCH 04/11] gnu: Add tinydir David Elsing
2022-10-04 7:27 ` Liliana Marie Prikler
2022-10-07 15:11 ` David Elsing
2022-10-07 15:13 ` Liliana Marie Prikler
2022-10-03 0:19 ` [bug#58261] [PATCH 05/11] gnu: Add optionparser David Elsing
2022-10-04 7:42 ` Liliana Marie Prikler
2022-10-07 15:11 ` David Elsing
2022-10-03 0:19 ` [bug#58261] [PATCH 06/11] gnu: Add gemmi David Elsing
2022-10-04 7:49 ` Liliana Marie Prikler
2022-10-07 15:11 ` David Elsing
2022-10-07 15:17 ` Liliana Marie Prikler
2022-10-03 0:19 ` [bug#58261] [PATCH 07/11] gnu: Add freesasa David Elsing
2022-10-04 8:02 ` Liliana Marie Prikler
2022-10-07 15:12 ` David Elsing
2022-10-07 15:19 ` Liliana Marie Prikler
2022-10-03 0:19 ` [bug#58261] [PATCH 08/11] gnu: Add maeparser David Elsing
2022-10-03 0:19 ` [bug#58261] [PATCH 09/11] gnu: Add coordgenlibs David Elsing
2022-10-03 0:19 ` [bug#58261] [PATCH 10/11] gnu: Add yaehmop-tightbind David Elsing
2022-10-04 7:54 ` Liliana Marie Prikler
2022-10-07 15:12 ` David Elsing
2022-10-07 15:25 ` Liliana Marie Prikler
2022-10-03 0:19 ` [bug#58261] [PATCH 11/11] gnu: Add rdkit David Elsing
2022-10-04 8:13 ` Liliana Marie Prikler
2022-10-07 15:12 ` David Elsing
2022-10-07 15:29 ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 00/13] Add rdkit v2 David Elsing
2022-10-09 10:02 ` Liliana Marie Prikler
2022-10-13 20:58 ` David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 00/15] Add rdkit v3 David Elsing
2022-10-15 14:37 ` bug#58261: " Liliana Marie Prikler
2022-10-17 9:55 ` [bug#58261] " David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 01/15] gnu: Add fast-float David Elsing
2022-10-13 21:04 ` David Elsing [this message]
2022-10-13 21:04 ` [bug#58261] [PATCH v3 03/15] gnu: Add sajson David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 04/15] gnu: Add cbehave David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 05/15] gnu: Add tinydir David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 06/15] gnu: Add optionparser David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 07/15] gnu: Add sajson-for-gemmi David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 08/15] gnu: Add gemmi David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 09/15] gnu: Add freesasa David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 10/15] gnu: Add maeparser David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 11/15] gnu: Add coordgenlibs David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 12/15] gnu: Add yaehmop David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 13/15] gnu: Add avalon-toolkit David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 14/15] gnu: Add ringdecomposerlib David Elsing
2022-10-13 21:04 ` [bug#58261] [PATCH v3 15/15] gnu: Add rdkit David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 01/13] gnu: Add fast-float David Elsing
2022-10-09 10:04 ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 02/13] gnu: Add pocketfft David Elsing
2022-10-09 11:42 ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 03/13] gnu: Add sajson David Elsing
2022-10-09 11:46 ` Liliana Marie Prikler
2022-10-13 20:59 ` David Elsing
2022-10-14 21:30 ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 04/13] gnu: Add tinydir David Elsing
2022-10-09 11:48 ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 05/13] gnu: Add optionparser David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 06/13] gnu: Add gemmi David Elsing
2022-10-09 11:54 ` Liliana Marie Prikler
2022-10-13 21:00 ` David Elsing
2022-10-14 21:32 ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 07/13] gnu: Add freesasa David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 08/13] gnu: Add maeparser David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 09/13] gnu: Add coordgenlibs David Elsing
2022-10-09 11:56 ` Liliana Marie Prikler
2022-10-13 21:00 ` David Elsing
2022-10-07 15:21 ` [bug#58261] [PATCH v2 10/13] gnu: Add yaehmop-tightbind David Elsing
2022-10-09 12:02 ` Liliana Marie Prikler
2022-10-13 21:00 ` David Elsing
2022-10-14 21:33 ` Liliana Marie Prikler
2022-10-07 15:21 ` [bug#58261] [PATCH v2 11/13] gnu: Add avalontoolkit David Elsing
2022-10-09 12:06 ` Liliana Marie Prikler
2022-10-13 21:01 ` David Elsing
2022-10-07 15:22 ` [bug#58261] [PATCH v2 12/13] gnu: Add ringdecomposerlib David Elsing
2022-10-07 15:22 ` [bug#58261] [PATCH v2 13/13] gnu: Add rdkit David Elsing
2022-10-09 12:12 ` Liliana Marie Prikler
2022-10-13 21:01 ` David Elsing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221013210424.993-3-david.elsing@posteo.net \
--to=david.elsing@posteo.net \
--cc=58261@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.