Skip to content

Commit 0e34e5c

Browse files
committed
Help the vectorizer out.
1 parent 14353c6 commit 0e34e5c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

star-sys/STAR/source/stitchAlignToTranscript.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@
55
#include "binarySearch2.h"
66
// #include "stitchGapIndel.cpp"
77

8+
namespace std {
9+
10+
// Specialize array<char, 4> comparison to help the vectorizer out.
11+
//
12+
// Comparing 2 arrays of width 4 should just end up being comparison of 32-bit
13+
// values. The compiler has trouble figuring that out if it goes through the
14+
// default implementation, which uses std::equal.
15+
template<>
16+
inline constexpr bool operator==(const array<char, 4>& a, const array<char, 4>& b) {
17+
return a[0]==b[0] & a[1] == b[1] & a[2] == b[2] & a[3] == b[3];
18+
}
19+
20+
}
821

922
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) {
1023
//stitch together A and B, extend in the gap, returns max score

0 commit comments

Comments
 (0)