hpx/experimental/sandbox.hpp
Defined in header hpx/experimental/sandbox.hpp.
See Public API for a list of names and headers that are part of the public
HPX API.
-
namespace hpx
-
namespace experimental
-
namespace sandbox
Functions
-
inline environment_info detect_environment()
Detect and return information about the current environment.
-
inline void describe_environment(std::ostream &os)
Print a formatted environment report.
-
template<typename F>
double measure(F &&fn, std::size_t iterations = 5)
Measure the mean execution time of a callable.
-
template<typename SeqFn, typename ParFn>
benchmark_report benchmark(std::string label, SeqFn &&seq_fn, ParFn &&par_fn, std::size_t iterations = 5)
Compare sequential and parallel execution of the same work.
-
struct benchmark_report
#include <sandbox.hpp>
Holds the results of a comparative benchmark.
Public Functions
-
inline void print(std::ostream &os) const
Print a formatted benchmark report.
- Parameters
os – Output stream.
Public Members
-
std::string label
User-provided description.
-
std::size_t iterations = 0
Measurement iterations.
-
double seq_mean_ms = 0.0
Sequential mean time (ms)
-
double par_mean_ms = 0.0
Parallel mean time (ms)
-
double speedup = 0.0
seq_time / par_time
-
double efficiency_pct = 0.0
(speedup / workers) * 100
-
std::size_t num_workers = 0
HPX workers during measurement.
-
struct environment_info
#include <sandbox.hpp>
Describes the hardware and runtime environment.
Public Functions
-
inline void print(std::ostream &os) const
Print a formatted environment report.
- Parameters
os – Output stream.
Public Members
-
std::size_t cores = 0
Physical CPU cores.
-
std::size_t pus = 0
Processing units (hardware threads)
-
std::size_t numa_nodes = 0
NUMA domains.
-
std::size_t hpx_workers = 0
Active HPX worker threads.
-
bool is_sandbox = false
Likely constrained environment.