Skip to content

Commit

Permalink
Help the vectorizer out.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-azarchs committed Sep 6, 2022
1 parent 14353c6 commit b34d0ff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions star-sys/STAR/source/stitchAlignToTranscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
#include "binarySearch2.h"
// #include "stitchGapIndel.cpp"

namespace std {

// Specialize array<char, 4> comparison to help the vectorizer out.
//
// Comparing 2 arrays of width 4 should just end up being comparison of 32-bit
// values. The compiler has trouble figuring that out if it goes through the
// default implementation, which uses std::equal.
template<>
inline bool operator==(const array<char, 4>& a, const array<char, 4>& b) {
return (*reinterpret_cast<const uint32_t*>(&a[0])) == (*reinterpret_cast<const uint32_t*>(&b[0]));
}

}

intScore stitchAlignToTranscript(uint rAend, uint gAend, uint rBstart, uint gBstart, uint L, uint iFragB, uint sjAB, const Parameters& P, char* R, const Genome &mapGen, Transcript *trA, const uint outFilterMismatchNmaxTotal) {
//stitch together A and B, extend in the gap, returns max score
Expand Down

0 comments on commit b34d0ff

Please sign in to comment.