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
(O2-1203) [CTF] use merging/splitting iterators during CTF ecoding/decoding for TPC #5199
(O2-1203) [CTF] use merging/splitting iterators during CTF ecoding/decoding for TPC #5199
Conversation
1035af1
to
905161f
Compare
@MichaelLettrich thanks, I've tested it on 200 pbpb events TF, works fine with the same output size as before. It is marked as WIP, do you have other stuff to commit? |
@shahor02 thanks for testing. Feature complete but needs some cleanups in the git history. Opened it as WIP to see if formatting was OK. Will remove WIP and ask for review once git cleanup is done. |
* `CombinedInputIterator` has to be bidirectional since rANS encoder reads backwards. * `CombinedInputIterator` has to be default constructable. Dereferencing it is undefined behaviour though. * Adjust Encoders to work with bidirectional iterators
* `tpc::CTFCoder` uses `CombinedInputIterator` to avoid a temporary vector and elides 2 copies * `tpc::CTFCoder` uses lambdas and type_traits instead of macros to avoid incomprehensible compiler errors * `ctf::EncodedBlocks` remove deref of past-the-end-iterator which is undefined behaviour * Unit tests use merged columns add iterator TPC makeInputIterators replace makecoder macro replace ENCODETPC macro with lambda fix undefined behaviour
* `CombinedOutputIterator` needs to set `value_type` correctly to work with `iterator_traits`. This needs to be passed upon instantiation as a template parameter and cannot be auto-deduced. * `ComninedOutputIterator` fix bug with std::tie caused by returning `ComninedOutputIterator::Proxy` by value when dereferencing the iterator. * `CombinedOutputIteratorFactory` simplifies construction of `CombinedOutputIterator` instances.
* `EncodedBlocks` allow more general iterators in decoder methods * `CTFCoder` use `CombinedOutpurIterator` when decoding merged columns to elide a temporary vector and two copies per element. * `CTFCoder` use functions instead of preprocessor macros for decoding for better compiler error messages
* Use `std::enable_if` type trait for compile-time type checks if iterator holds correct value type
bd1f13d
to
b955309
Compare
@shahor02. Should be good for review now. Can you have a look? |
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.
@MichaelLettrich already did and tested, thanks. Will merge once tests are passed
@shahor02 thanks a lot 👍 |
o2::tpc::CTFCoder
to use merging/splitting iterators fromo2::rans::utils
. This avoids storing intermediate vectors and removes two copy operations per merged/ splitted element and should visibly improve performance in CTF creation.EncodedBlocks
to remove artificial restriction to pointers and use iterators insteadCombinedInputIterator
andCombinedOutputIterator
to make it usable in real world applications