Skip to content

Commit c66be7f

Browse files
committed
[INTERNAL] cleanup and deactivate AVX2-SIMD in auto-detection
1 parent ea3a895 commit c66be7f

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/lambda.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,8 @@ realMain(LambdaOptions & options,
455455

456456
// extend
457457
buf = sysTime();
458-
#ifdef SEQAN_SIMD_ENABLED
459-
if (options.extensionMode == LambdaOptions::ExtensionMode::FULL_SIMD)
460-
res = iterateMatchesFullSimd(localHolder);
461-
else
462-
#endif
463-
if (options.extensionMode == LambdaOptions::ExtensionMode::FULL_SERIAL)
464-
res = iterateMatchesFullSerial(localHolder);
465-
else
458+
if (length(localHolder.matches) > 0)
466459
res = iterateMatches(localHolder);
467-
468460
localHolder.stats.timeExtend += sysTime() - buf;
469461
if (res)
470462
continue;

src/lambda.hpp

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ loadQuery(GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h> & global
625625
{
626626
if (maxLen <= 100)
627627
{
628-
#if defined(SEQAN_SIMD_ENABLED) && defined(__AVX2__)
628+
#if 0 // defined(SEQAN_SIMD_ENABLED) && defined(__AVX2__)
629629
options.extensionMode = LambdaOptions::ExtensionMode::FULL_SIMD;
630630
options.band = -1;
631631
#else
@@ -915,6 +915,8 @@ onFindVariable(LocalDataHolder<TGlobalHolder, TScoreExtension> & lH,
915915
// Function search()
916916
// --------------------------------------------------------------------------
917917

918+
//TODO experiment with tuned branch prediction
919+
918920
template <typename TIndexIt, typename TNeedleIt, typename TLambda, typename TLambda2>
919921
inline void
920922
__goDownNoErrors(TIndexIt const & indexIt,
@@ -1148,18 +1150,13 @@ template <typename TLocalHolder>
11481150
inline void
11491151
search(TLocalHolder & lH)
11501152
{
1151-
if (lH.options.adaptiveSeeding)
1152-
__serachAdaptive(lH, lH.options.seedLength);
1153-
else if (lH.options.maxSeedDist == 0)
1153+
//TODO implement adaptive seeding with 0-n mismatches
1154+
if (lH.options.maxSeedDist == 0)
11541155
__search<Backtracking<Exact>>(lH);
1155-
else if (lH.options.hammingOnly)
1156-
__search<Backtracking<HammingDistance>>(lH);
1156+
else if (lH.options.adaptiveSeeding)
1157+
__serachAdaptive(lH, lH.options.seedLength);
11571158
else
1158-
#if 0 // reactivate if edit-distance seeding is readded
1159-
__search<Backtracking<EditDistance>>(lH);
1160-
#else
1161-
return;
1162-
#endif
1159+
__search<Backtracking<HammingDistance>>(lH);
11631160
}
11641161

11651162
// --------------------------------------------------------------------------
@@ -1630,7 +1627,7 @@ computeBlastMatch(TBlastMatch & bm,
16301627

16311628
template <typename TLocalHolder>
16321629
inline int
1633-
iterateMatches(TLocalHolder & lH)
1630+
iterateMatchesExtend(TLocalHolder & lH)
16341631
{
16351632
using TGlobalHolder = typename TLocalHolder::TGlobalHolder;
16361633
// using TMatch = typename TGlobalHolder::TMatch;
@@ -1936,7 +1933,6 @@ iterateMatches(TLocalHolder & lH)
19361933
}
19371934

19381935
#ifdef SEQAN_SIMD_ENABLED
1939-
19401936
template <typename TLocalHolder>
19411937
inline int
19421938
iterateMatchesFullSimd(TLocalHolder & lH)
@@ -2120,9 +2116,6 @@ template <typename TLocalHolder>
21202116
inline int
21212117
iterateMatchesFullSerial(TLocalHolder & lH)
21222118
{
2123-
if (length(lH.matches) == 0)
2124-
return 0;
2125-
21262119
using TGlobalHolder = typename TLocalHolder::TGlobalHolder;
21272120
using TMatch = typename TGlobalHolder::TMatch;
21282121
using TPos = typename TMatch::TPos;
@@ -2233,4 +2226,19 @@ iterateMatchesFullSerial(TLocalHolder & lH)
22332226
return 0;
22342227
}
22352228

2229+
template <typename TLocalHolder>
2230+
inline int
2231+
iterateMatches(TLocalHolder & lH)
2232+
{
2233+
#ifdef SEQAN_SIMD_ENABLED
2234+
if (lH.options.extensionMode == LambdaOptions::ExtensionMode::FULL_SIMD)
2235+
return iterateMatchesFullSimd(lH);
2236+
else
2237+
#endif
2238+
if (lH.options.extensionMode == LambdaOptions::ExtensionMode::FULL_SERIAL)
2239+
return iterateMatchesFullSerial(lH);
2240+
else
2241+
return iterateMatchesExtend(lH);
2242+
}
2243+
22362244
#endif // HEADER GUARD

0 commit comments

Comments
 (0)