Skip to content

Commit

Permalink
Merge pull request #75 from quanteda/fix-old-tbb
Browse files Browse the repository at this point in the history
Fix for systems without TBB
  • Loading branch information
kbenoit committed Apr 8, 2024
2 parents 09359f3 + 59402a1 commit 4ffa108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/collocations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ float GLOBAL_PATTERN_MAX_LOAD_FACTOR = 0.05;
float GLOBAL_NGRAMS_MAX_LOAD_FACTOR = 0.25;
#endif

#if QUANTEDA_USE_TBB
#if TBB_VERSION_MAJOR >= 2021
typedef std::atomic<unsigned int> UintAtomic; //oneAPI TBB
#else
typedef tbb::atomic<unsigned int> UintAtomic; //old TBB
#endif

#if QUANTEDA_USE_TBB
typedef tbb::concurrent_unordered_map<Ngram, std::pair<UintAtomic, UintAtomic>, hash_ngram, equal_ngram> MapNgramsPair;
#else
typedef std::atomic<unsigned int> UintAtomic;
typedef std::unordered_map<Ngram, std::pair<UintAtomic, UintAtomic>, hash_ngram, equal_ngram> MapNgramsPair;
#endif
typedef std::vector<std::pair<Ngram, unsigned int>> VecNgramsPair;
Expand Down

0 comments on commit 4ffa108

Please sign in to comment.