[med-svn] [seqan2] 01/01: New upstream version 2.4.0~rc2+dfsg

Michael Crusoe misterc-guest at moszumanska.debian.org
Thu Feb 1 06:47:14 UTC 2018


This is an automated email from the git hooks/post-receive script.

misterc-guest pushed a commit to annotated tag upstream/2.4.0_rc2+dfsg
in repository seqan2.

commit d7aab1356569ba2dd77ee1eb8633dd2b3b116236
Author: Michael R. Crusoe <michael.crusoe at gmail.com>
Date:   Wed Jan 31 08:46:39 2018 -0800

    New upstream version 2.4.0~rc2+dfsg
---
 CHANGELOG.rst                                      |  2 +-
 demos/howto/custom_file_ending.fa.dat              |  4 +
 demos/howto/custom_file_endings.cpp                | 76 ++++++++++++++++++
 demos/howto/custom_file_endings.cpp.stdout         |  2 +
 include/seqan/align/dp_scout_simd.h                |  8 +-
 include/seqan/seq_io/fasta_fastq.h                 | 12 +--
 include/seqan/seq_io/read_embl.h                   |  6 +-
 include/seqan/seq_io/read_genbank.h                |  6 +-
 include/seqan/stream/formatted_file.h              | 24 ++++++
 manual/source/Infrastructure/Use/Install.rst       |  2 +-
 .../Tutorial/HowTo/Recipes/CustomFileEndings.rst   | 89 ++++++++++++++++++++++
 tests/index/test_index_bifm.cpp                    |  2 +
 tests/translation/test_translation.h               |  2 +
 util/cmake/SeqAnSimdUtility.cmake                  | 37 +++++++--
 14 files changed, 246 insertions(+), 26 deletions(-)

diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index ea0d6f4..3a907b5 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -51,7 +51,7 @@ Platform Support
       - ``powerpc, ppc64, ppc64el``
       - ``s390x, alpha, m68k, sh4``
    - Officially **not** supported: ``sparc64``
-   - Thanks to the Debian Med team for their patches!
+   - Thanks to the `Debian Med team <https://www.debian.org/devel/debian-med/>`_ for their patches!
 - Upstream packages:
    - SeqAn2 packages are finally coming to Fedora, thanks to @sagitter
    - Package updates in Debian, Ubuntu, MacPorts, Homebrew and FreeBSD expected shortly.
diff --git a/demos/howto/custom_file_ending.fa.dat b/demos/howto/custom_file_ending.fa.dat
new file mode 100644
index 0000000..20ee5de
--- /dev/null
+++ b/demos/howto/custom_file_ending.fa.dat
@@ -0,0 +1,4 @@
+>My seq
+ACGTAGCGACTGAGCTACAGGCGACGATCGACGAGCTACGGTACGCGAT
+ACGATCGAGCTACGAGCATCAGCGAGCTACGAGGGACTACTTACAGAGC
+ACGATCGAGCTTACAGCGACTAGC
diff --git a/demos/howto/custom_file_endings.cpp b/demos/howto/custom_file_endings.cpp
new file mode 100644
index 0000000..c09072a
--- /dev/null
+++ b/demos/howto/custom_file_endings.cpp
@@ -0,0 +1,76 @@
+//![includes]
+#include <seqan/stream.h>
+#include <seqan/seq_io.h>
+//![includes]
+//![custom_file]
+namespace seqan
+{
+// Your custom file format.
+struct MyFastaAdaptor_;
+using MyFastaAdaptor = Tag<MyFastaAdaptor_>;
+
+// Specilaize sequence input file with custom tag.
+using MySeqFileIn = FormattedFile<Fastq, Input, MyFastaAdaptor>;
+//![custom_file]
+//![custom_format]
+// Your custom format tag.
+struct MySeqFormat_;
+using MySeqFormat = Tag<MySeqFormat_>;
+
+// The extended TagList containing our custom format.
+using MySeqInFormats = TagList<MySeqFormat, SeqInFormats>;
+
+// Overloaded file format metafunction.
+template <>
+struct FileFormat<FormattedFile<Fastq, Input, MyFastaAdaptor> >
+{
+    using Type = TagSelector<MySeqInFormats>;
+};
+
+// Set magic header.
+template <typename T>
+struct MagicHeader<MySeqFormat, T> : public MagicHeader<Fasta, T>
+{};
+//![custom_format]
+//![custom_extension]
+// Specify the valid ending for your fasta adaptor.
+template <typename T>
+struct FileExtensions<MySeqFormat, T>
+{
+    static char const * VALUE[1];
+};
+
+template <typename T>
+char const * FileExtensions<MySeqFormat, T>::VALUE[1] =
+{
+    ".fa.dat"  // fasta file with dat ending.
+};
+//![custom_extension]
+
+//![custom_read_record]
+// Overload an inner readRecord function to delegate to the actual fasta parser.
+template <typename TIdString, typename TSeqString, typename TSpec>
+inline void
+readRecord(TIdString & meta, TSeqString & seq, FormattedFile<Fastq, Input, TSpec> & file, MySeqFormat)
+{
+    readRecord(meta, seq, file.iter, Fasta());  // Just delegate to Fasta parser.
+}
+} // namespace seqan
+//![custom_read_record]
+//![main]
+int main()
+{
+    using namespace seqan;
+    std::string path = getAbsolutePath("demos/howto/custom_file_ending.fa.dat");
+
+    MySeqFileIn seqFile(path.c_str());
+
+    CharString meta;
+    Dna5String seq;
+
+    readRecord(meta, seq, seqFile);
+
+    std::cout << "> " << meta << "\n" << seq << std::endl;
+    return 0;
+}
+//![main]
diff --git a/demos/howto/custom_file_endings.cpp.stdout b/demos/howto/custom_file_endings.cpp.stdout
new file mode 100644
index 0000000..791c47f
--- /dev/null
+++ b/demos/howto/custom_file_endings.cpp.stdout
@@ -0,0 +1,2 @@
+> My seq
+ACGTAGCGACTGAGCTACAGGCGACGATCGACGAGCTACGGTACGCGATACGATCGAGCTACGAGCATCAGCGAGCTACGAGGGACTACTTACAGAGCACGATCGAGCTTACAGCGACTAGC
diff --git a/include/seqan/align/dp_scout_simd.h b/include/seqan/align/dp_scout_simd.h
index 64c9ddd..3c42ab9 100644
--- a/include/seqan/align/dp_scout_simd.h
+++ b/include/seqan/align/dp_scout_simd.h
@@ -97,10 +97,10 @@ public:
     using TBase       = DPScout_<TDPCell, Default>;
     using TScoutState = DPScoutState_<TSpec>;
 
-    TSimdVec    mHorizontalPos;
-    TSimdVec    mVerticalPos;
-    TScoutState * state = nullptr;
-    unsigned _simdLane  = 0;
+    TSimdVec      mHorizontalPos{};
+    TSimdVec      mVerticalPos{};
+    TScoutState * state{nullptr};
+    unsigned      _simdLane{0};
 
     DPScout_(TScoutState & pState) : TBase(), state(&pState)
     {}
diff --git a/include/seqan/seq_io/fasta_fastq.h b/include/seqan/seq_io/fasta_fastq.h
index fae8004..1cbbb4d 100644
--- a/include/seqan/seq_io/fasta_fastq.h
+++ b/include/seqan/seq_io/fasta_fastq.h
@@ -235,7 +235,7 @@ struct QualityExtractor : public std::unary_function<TValue, char>
 // ----------------------------------------------------------------------------
 
 template <typename TIdString, typename TSeqString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Raw)
 {
     typedef typename Value<TSeqString>::Type                        TAlphabet;
@@ -252,7 +252,7 @@ readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Raw)
 // ----------------------------------------------------------------------------
 
 template <typename TIdString, typename TSeqString, typename TQualString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TQualString & qual, TFwdIterator & iter, Raw const & raw)
 {
     clear(qual);
@@ -264,7 +264,7 @@ readRecord(TIdString & meta, TSeqString & seq, TQualString & qual, TFwdIterator
 // ----------------------------------------------------------------------------
 
 template <typename TIdString, typename TSeqString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Fasta)
 {
     typedef typename Value<TSeqString>::Type                        TAlphabet;
@@ -286,7 +286,7 @@ readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Fasta)
 // ----------------------------------------------------------------------------
 
 template <typename TIdString, typename TSeqString, typename TQualString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TQualString & qual, TFwdIterator & iter, Fasta)
 {
     clear(qual);
@@ -298,7 +298,7 @@ readRecord(TIdString & meta, TSeqString & seq, TQualString & qual, TFwdIterator
 // ----------------------------------------------------------------------------
 
 template <typename TIdString, typename TSeqString, typename TFwdIterator >
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Fastq)
 {
     typedef typename Value<TSeqString>::Type                                TAlphabet;
@@ -349,7 +349,7 @@ readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Fastq)
 // ----------------------------------------------------------------------------
 
 template <typename TIdString, typename TSeqString, typename TQualString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TQualString & qual, TFwdIterator & iter, Fastq)
 {
     typedef typename Value<TSeqString>::Type                                TSeqAlphabet;
diff --git a/include/seqan/seq_io/read_embl.h b/include/seqan/seq_io/read_embl.h
index f7774c0..9f5894f 100644
--- a/include/seqan/seq_io/read_embl.h
+++ b/include/seqan/seq_io/read_embl.h
@@ -156,7 +156,7 @@ nextIs(TFwdIterator & iter, EmblSequence)
 // Read all sequence, eat/ignore '//' line.
 
 template <typename TSeqString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TSeqString & seq, TFwdIterator & iter, EmblSequence)
 {
     typedef typename Value<TSeqString>::Type TSeqAlphabet;
@@ -185,7 +185,7 @@ readRecord(TSeqString & seq, TFwdIterator & iter, EmblSequence)
 // readRecord() for EMBL id/seq pairs.
 
 template <typename TIdString, typename TSeqString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Embl)
 {
     IsBlank isBlank;
@@ -211,7 +211,7 @@ readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, Embl)
 }
 
 template <typename TIdString, typename TSeqString, typename TQualString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TQualString & qual, TFwdIterator & iter, Embl)
 {
     clear(qual);
diff --git a/include/seqan/seq_io/read_genbank.h b/include/seqan/seq_io/read_genbank.h
index afddfb9..d7f6a8f 100644
--- a/include/seqan/seq_io/read_genbank.h
+++ b/include/seqan/seq_io/read_genbank.h
@@ -171,7 +171,7 @@ nextIs(TFwdIterator & iter, GenBankSequence)
 // Read all sequence, eat/ignore '//' line.
 
 template <typename TSeqString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TSeqString & seq, TFwdIterator & iter, GenBankSequence)
 {
     typedef typename Value<TSeqString>::Type TSeqAlphabet;
@@ -201,7 +201,7 @@ readRecord(TSeqString & seq, TFwdIterator & iter, GenBankSequence)
 // readRecord() for GenBank id/seq pairs.
 
 template <typename TIdString, typename TSeqString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, GenBank)
 {
     IsWhitespace isWhite;
@@ -236,7 +236,7 @@ readRecord(TIdString & meta, TSeqString & seq, TFwdIterator & iter, GenBank)
 }
 
 template <typename TIdString, typename TSeqString, typename TQualString, typename TFwdIterator>
-inline SEQAN_FUNC_ENABLE_IF(Not<IsSameType<TFwdIterator, FormattedFile<Fastq, Input> > >, void)
+inline SEQAN_FUNC_ENABLE_IF(Not<IsInputFile<TFwdIterator> >, void)
 readRecord(TIdString & meta, TSeqString & seq, TQualString & qual, TFwdIterator & iter, GenBank)
 {
     clear(qual);
diff --git a/include/seqan/stream/formatted_file.h b/include/seqan/stream/formatted_file.h
index 5421aad..246d5af 100644
--- a/include/seqan/stream/formatted_file.h
+++ b/include/seqan/stream/formatted_file.h
@@ -365,6 +365,30 @@ struct FormattedFile
 // ============================================================================
 
 // ----------------------------------------------------------------------------
+// Metafunction IsInputFile
+// ----------------------------------------------------------------------------
+
+template <typename T>
+struct IsInputFile : False
+{};
+
+template <typename TFormat, typename TSpec>
+struct IsInputFile<FormattedFile<TFormat, Input, TSpec> > : True
+{};
+
+// ----------------------------------------------------------------------------
+// Metafunction IsOutputFile
+// ----------------------------------------------------------------------------
+
+template <typename T>
+struct IsOutputFile : False
+{};
+
+template <typename TFormat, typename TSpec>
+struct IsOutputFile<FormattedFile<TFormat, Output, TSpec> > : True
+{};
+
+// ----------------------------------------------------------------------------
 // Metafunction DirectionIterator
 // ----------------------------------------------------------------------------
 
diff --git a/manual/source/Infrastructure/Use/Install.rst b/manual/source/Infrastructure/Use/Install.rst
index e3ce7d4..97f7d48 100644
--- a/manual/source/Infrastructure/Use/Install.rst
+++ b/manual/source/Infrastructure/Use/Install.rst
@@ -39,7 +39,7 @@ SeqAn is available natively on the following platforms.
 | **N** |br| +------------+----------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | **U** |br| | Debian     | libseqan2-dev  | ``apt install libseqan2-dev``           | `info <https://packages.debian.org/search?keywords=libseqan2-dev>`__ | `contact <mailto:debian-med-packaging()lists.alioth.debian.org>`__                              |
 | / |br|     +------------+----------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
-| **L** |br| | Fedora     | seqan-devel    | ``yum install seqan-devel``             | `info <https://apps.fedoraproject.org/packages/seqan-devel>`__ | `contact <mailto:sagitter()fedoraproject.org>`__                                                      |
+| **L** |br| | Fedora     | seqan2-headers | ``yum install seqan2-headers``          | `info <https://apps.fedoraproject.org/packages/seqan2-headers>`__ | `contact <mailto:sagitter()fedoraproject.org>`__                                                   |
 | **I** |br| +------------+----------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | **N** |br| | Gentoo     | seqan          | ``emerge sci-biology/seqan``            | `info <https://packages.gentoo.org/packages/sci-biology/seqan>`__ | `contact <mailto:sci-biology at gentoo.org>`__                                                        |
 | **U** |br| +------------+----------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/manual/source/Tutorial/HowTo/Recipes/CustomFileEndings.rst b/manual/source/Tutorial/HowTo/Recipes/CustomFileEndings.rst
new file mode 100644
index 0000000..a7f2133
--- /dev/null
+++ b/manual/source/Tutorial/HowTo/Recipes/CustomFileEndings.rst
@@ -0,0 +1,89 @@
+.. sidebar:: ToC
+
+    .. contents::
+
+.. _how-to-recipes-custom-file-endings:
+
+Custom File Endings
+===================
+
+SeqAn's File-I/O uses file endings to determine the format of the file, e.g. whether to read in a sequence file
+in **FASTA** format or an alignment file in **BAM** format.
+Without this, it would be very cumbersome to guess the correct file format in order to use the correct parsing
+algorithm.
+However, in some use cases application developer might want to extend the fixed endings by their own endings.
+This might be useful when writing applications for workflow systems, which might add arbitrary endings to
+the respective files. Using SeqAn to read in a file with unsupported file ending would raise an exception,
+which helps to spot user errors much easier.
+
+In the following we will describe how to extend the file formats for existing parsers in SeqAn.
+The central data structure when reading formatted files is the :dox:`FormattedFile` class.
+The formatted file is used to select the file type to be parsed and whether it should open an input (for reading) or an
+output stream (for writing).
+For example you can use the :dox:`SeqFileIn` to read sequence files.
+We will use the ``SeqFileIn`` to show how to extend the known file extensions with a custom one, namely a ``.fa.dat``
+extension.
+
+In the beginning we include all necessary headers:
+
+.. includefrags:: demos/howto/custom_file_endings.cpp
+   :fragment: includes
+
+The first step to our own format is the definition of our own sequence input file which we will call ``MySeqFileIn``.
+To do so, we define a new tag with a unique name, like ``MyFastaAdaptor``.
+We use this tag to specialize the :dox:`SeqFileIn`, which can be done by using the third template parameter.
+The following code snippet shows the defintion.
+
+.. includefrags:: demos/howto/custom_file_endings.cpp
+   :fragment: custom_file
+
+Next, we define our custom format.
+Again we define a new tag, which uniquely represents our new format.
+In this example we call it ``MySeqFormat``. Given this new format tag, we extend the already existing format TagList
+of the input sequence file by defining a new TagList.
+
+.. hint::
+
+   The :dox:`TagList` allows us to create a list of tags, which can be recursively iterated by a tag-apply function, to
+   map a runtime value to it's corresponding tag and by thus employing tag-dispatching to the corresponding function.
+   This might induce a certain compile time overhead, but it does not infer any runtime polymorphism.
+
+Two more steps are required.
+First, we have to overload a metafunction called ``FileFormat`` for our newly defined ``MySeqFileIn`` type, which we use
+to declare a :dox:`TagSelector` type for our extended format TagList called ``MySeqInFormats``.
+This meta-function will be used internally to test if the provided file extension format is contained in the format list
+by the principle explained in the hint box above.
+To finish the format definition we need to tell how the magic header looks like.
+A magic header is used to determine the correct file format if the extension cannot be known.
+This is for example the case, if the data is read from an input stream rather than a file.
+
+The following code snippet will demonstrate the adaption we need to make to our code:
+
+.. includefrags:: demos/howto/custom_file_endings.cpp
+   :fragment: custom_format
+
+After we added our custom file and custom format, we now have to specify the actual extension.
+This is shown here:
+
+.. includefrags:: demos/howto/custom_file_endings.cpp
+   :fragment: custom_extension
+
+Therefore, we overload the ``FileExtensions`` value meta-function with our defined ``MySeqFormat`` tag, which defines
+in an array of ``char *``` with one element in it, namely our `.fa.dat` extension.
+
+The last step before we can use our extended format tag is to tell SeqAn what to do, if a file is read with our custom
+file ending.
+This can be simply achieved by overloading the respective :dox:`FormattedFileIn#readRecord` function by using our
+``MySeqFormat`` tag:
+
+.. includefrags:: demos/howto/custom_file_endings.cpp
+   :fragment: custom_read_record
+
+Now we are ready to use our new file extension in a real application, which would otherwise cause an :dox:`IOError`.
+
+.. includefrags:: demos/howto/custom_file_endings.cpp
+   :fragment: main
+
+The output of this example would be:
+
+.. includefrags:: demos/howto/custom_file_endings.cpp.stdout
diff --git a/tests/index/test_index_bifm.cpp b/tests/index/test_index_bifm.cpp
index c28213c..cf081cf 100644
--- a/tests/index/test_index_bifm.cpp
+++ b/tests/index/test_index_bifm.cpp
@@ -162,6 +162,7 @@ SEQAN_TYPED_TEST(BidirectionalFMIndexTest, SearchInString)
     }
 }
 
+#ifndef __alpha__ // NOTE(h-2): fails on alpha for unknown reasons
 SEQAN_TYPED_TEST(BidirectionalFMIndexTest, SearchInStringSet)
 {
     typedef typename TestFixture::TIndex                        TIndex;
@@ -198,6 +199,7 @@ SEQAN_TYPED_TEST(BidirectionalFMIndexTest, SearchInStringSet)
         }
     }
 }
+#endif // __alpha__
 
 // ==========================================================================
 // Functions
diff --git a/tests/translation/test_translation.h b/tests/translation/test_translation.h
index 6dba4e7..32ebcc1 100644
--- a/tests/translation/test_translation.h
+++ b/tests/translation/test_translation.h
@@ -474,8 +474,10 @@ SEQAN_DEFINE_TEST(test_translation_onestring_multiframe_parallel)
 
 SEQAN_DEFINE_TEST(test_translation_onestring_multiframe_concatdirect_parallel)
 {
+#ifndef __alpha__ // NOTE(h-2): fails on alpha for unknown reasons
     typedef StringSet<String<AminoAcid>, Owner<ConcatDirect<> > > TConcatSet;
     test_translation_onestring_multiframe_impl<TConcatSet, Parallel>();
+#endif
 }
 
 template <typename TSourceSet, typename TResultSet, typename TParallelism>
diff --git a/util/cmake/SeqAnSimdUtility.cmake b/util/cmake/SeqAnSimdUtility.cmake
index 01c5816..10eae75 100644
--- a/util/cmake/SeqAnSimdUtility.cmake
+++ b/util/cmake/SeqAnSimdUtility.cmake
@@ -191,16 +191,37 @@ int main() {
   std::default_random_engine e(r());
   std::uniform_int_distribution<int64_t> d(1, 10);
 
-  alignas(64) uint64_t s[]{9,9,9,9,9,9,9,9};
-  alignas(64) uint64_t t[]{0,0,0,0,0,0,0,0};
+  { // Some avx2 bug on AppleClang when compiling with avx512_skx or higher
+    using TSimdVector = int8_t __attribute__ ((__vector_size__(32)));
+
+    TSimdVector a{0u}, b{0u};
+
+    for (auto i = 0; i < 32; ++i)
+    {
+        a[i] = (i - 1) * 3;
+        b[i] = 32 - i;
+    }
+    TSimdVector c = _mm256_cmpeq_epi8(a, b);
+
+    for (auto i = 0; i < 32; ++i)
+    {
+        if (c[i] == (a[i] == b[i]))
+            std::cout << \"Failed!\" << std::endl;
+    }
+  }
+
+  {
+    alignas(64) uint64_t s[]{9,9,9,9,9,9,9,9};
+    alignas(64) uint64_t t[]{0,0,0,0,0,0,0,0};
 
-  // gcc 4.9 does not know _mm512_cmpgt_epu64_mask
-  volatile auto a = _mm512_setr_epi64(d(e),d(e),d(e),d(e),d(e),d(e),d(e),d(e));
-  volatile auto m = _mm512_cmpgt_epu64_mask(a, _mm512_set1_epi64(4)); // m = a > 4
-  volatile auto z = _mm512_mask_load_epi64(a, m, s); // (a > 4) ? s : a
-  _mm512_store_epi64(t, z);
+    // gcc 4.9 does not know _mm512_cmpgt_epu64_mask
+    volatile auto a = _mm512_setr_epi64(d(e),d(e),d(e),d(e),d(e),d(e),d(e),d(e));
+    volatile auto m = _mm512_cmpgt_epu64_mask(a, _mm512_set1_epi64(4)); // m = a > 4
+    volatile auto z = _mm512_mask_load_epi64(a, m, s); // (a > 4) ? s : a
+    _mm512_store_epi64(t, z);
 
-  std::cout << \"(\" << t[0] << \", \" << t[1] << \", \" << t[2] << \", \" << t[3] << \", ...)\" << std::endl;
+    std::cout << \"(\" << t[0] << \", \" << t[1] << \", \" << t[2] << \", \" << t[3] << \", ...)\" << std::endl;
+  }
   return 0;
 }")
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/seqan2.git



More information about the debian-med-commit mailing list