-
Notifications
You must be signed in to change notification settings - Fork 97
Backport src/index/ to C++17 #2478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This commit includes C++17 compatibility fixes for the index module: - Replace inline constexpr variable initialization with function-based initialization for global atomics - Use QL_CONSTEXPR macro for static constexpr variables - Add QLEVER_CPP_17 preprocessor guards for expensive checks that use ranges - Replace inline constexpr with static constexpr where appropriate - Use constexpr lambda variables instead of C++20 consteval functions - Update three_way_comparison and equality operator macros for C++17 - Replace std::accumulate with std::reduce where parallel execution is beneficial - Add backport headers for StartsWith/EndsWith and algorithm utilities - Fix conversion issues with int64_t vs int for Bool datatype 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
joka921
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first round of self-reviews.
| inline std::atomic<size_t>& BUFFER_SIZE_JOIN_PATTERNS_WITH_OSP() { | ||
| static std::atomic<size_t> value = 50'000; | ||
| return value; | ||
| } | ||
|
|
||
| // When merging the vocabulary, this many finished words are buffered | ||
| // before they are written to the output. | ||
| constinit inline std::atomic<size_t> BATCH_SIZE_VOCABULARY_MERGE = 10'000'000; | ||
| inline std::atomic<size_t>& BATCH_SIZE_VOCABULARY_MERGE() { | ||
| static std::atomic<size_t> value = 10'000'000; | ||
| return value; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As those are not depending on anything, I can probably just use inline variables. (also below).
| tracer.beginTrace("rewriteLocalVocabEntries"); | ||
| rewriteLocalVocabEntriesAndBlankNodes(triples); | ||
| tracer.endTrace("rewriteLocalVocabEntries"); | ||
| #ifndef QLEVER_CPP_17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO Check if this commenting out is still needed...
| // directly because of cyclic dependencies. | ||
| static constexpr std::string_view proxyTag = "LveIdProxy"; | ||
| using IdProxy = ad_utility::TypedIndex<uint64_t, proxyTag>; | ||
| static inline constexpr ad_utility::IndexTag lveIdProxyTag = "LveIdProxy"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only inline...
This commit includes C++17 compatibility fixes for the index module:
🤖 Generated with Claude Code