forked from acts-project/traccc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sycl_queue_wrapper' of https://github.com/StewMH/traccc …
…into sycl_queue_wrapper
- Loading branch information
Showing
6 changed files
with
109 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
performance/include/traccc/performance/details/comparison_progress.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// System include(s). | ||
#include <iostream> | ||
#include <memory> | ||
#include <string_view> | ||
|
||
namespace traccc::details { | ||
|
||
/// Internal data used by @c comparison_progress | ||
struct comparison_progress_data; | ||
|
||
/// Class for tracking the progress of a comparison operation | ||
/// | ||
/// It's really just a wrapper around the indicators::progress_bar class. | ||
/// It's here to not expose a public dependency on the indicators library. | ||
/// | ||
class comparison_progress { | ||
|
||
public: | ||
/// Constructor with the total number of steps | ||
comparison_progress(std::size_t steps, std::ostream& out = std::cout, | ||
std::string_view description = "Running comparison "); | ||
/// Destructor | ||
~comparison_progress(); | ||
|
||
/// Mark one step done with the progress | ||
void tick(); | ||
|
||
private: | ||
/// Opaque internal data | ||
std::unique_ptr<comparison_progress_data> m_data; | ||
|
||
}; // class comparison_progress | ||
|
||
} // namespace traccc::details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
performance/src/performance/details/comparison_progress.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Local include(s). | ||
#include "traccc/performance/details/comparison_progress.hpp" | ||
|
||
// Indicators include(s). | ||
#include <indicators/progress_bar.hpp> | ||
|
||
namespace traccc::details { | ||
|
||
struct comparison_progress_data { | ||
|
||
/// Progress bar used internally | ||
std::unique_ptr<indicators::ProgressBar> m_bar; | ||
|
||
}; // struct comparison_progress_data | ||
|
||
comparison_progress::comparison_progress(std::size_t steps, std::ostream& out, | ||
std::string_view description) | ||
: m_data(std::make_unique<comparison_progress_data>()) { | ||
|
||
// Set up the progress bar. | ||
m_data->m_bar = std::make_unique<indicators::ProgressBar>( | ||
indicators::option::BarWidth{50}, | ||
indicators::option::PrefixText{description.data()}, | ||
indicators::option::ShowPercentage{true}, | ||
indicators::option::ShowRemainingTime{true}, | ||
indicators::option::MaxProgress{steps}, | ||
indicators::option::Stream{out}); | ||
} | ||
|
||
comparison_progress::~comparison_progress() = default; | ||
|
||
void comparison_progress::tick() { | ||
|
||
m_data->m_bar->tick(); | ||
} | ||
|
||
} // namespace traccc::details |