diff --git a/star-sys/STAR/source/stitchAlignToTranscript.cpp b/star-sys/STAR/source/stitchAlignToTranscript.cpp index d8caab5..33d9832 100644 --- a/star-sys/STAR/source/stitchAlignToTranscript.cpp +++ b/star-sys/STAR/source/stitchAlignToTranscript.cpp @@ -5,6 +5,19 @@ #include "binarySearch2.h" // #include "stitchGapIndel.cpp" +namespace std { + +// Specialize array 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& a, const array& b) { + return (*reinterpret_cast(&a[0])) == (*reinterpret_cast(&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