diff --git a/algorithms_cpp/perf/scan_perf.h b/algorithms_cpp/perf/scan_perf.h index 16b5332..062f324 100644 --- a/algorithms_cpp/perf/scan_perf.h +++ b/algorithms_cpp/perf/scan_perf.h @@ -96,7 +96,7 @@ public: private: const embb::base::perf::CallArgs & cargs; const size_t vector_size; - unsigned int load_factor; + size_t load_factor; T * in; T * out; T result; diff --git a/base_cpp/CMakeLists.txt b/base_cpp/CMakeLists.txt index 93b130d..015bb01 100644 --- a/base_cpp/CMakeLists.txt +++ b/base_cpp/CMakeLists.txt @@ -21,7 +21,8 @@ GroupSourcesMSVC(include/embb/base) GroupSourcesMSVC(src) if (BUILD_TESTS STREQUAL ON) GroupSourcesMSVC(test) - GroupSourcesMSVC(perf/include/embb/perf) + GroupSourcesMSVC(perf/include) + GroupSourcesMSVC(perf/src) endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include @@ -48,7 +49,7 @@ if (BUILD_TESTS STREQUAL ON) # Performance tests include_directories(perf/include ${CMAKE_CURRENT_BINARY_DIR}/../partest/include - ${CMAKE_CURRENT_SOURCE_DIR}/../tasks_cpp/include + ${CMAKE_CURRENT_SOURCE_DIR}/../tasks_cpp/include ${CMAKE_CURRENT_BINARY_DIR}/../tasks_cpp/include ) add_library (embb_base_cpp_perf diff --git a/base_cpp/perf/include/embb/base/perf/measure.h b/base_cpp/perf/include/embb/base/perf/measure.h deleted file mode 100644 index e4fa621..0000000 --- a/base_cpp/perf/include/embb/base/perf/measure.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _EMBB_BASE_CPP_PERF_MEASURE_H -#define _EMBB_BASE_CPP_PERF_MEASURE_H - -#include -#include - -namespace embb { -namespace base { -namespace perf { - -struct Measure { - Duration duration; - PerformanceMetrics metrics; -}; - -} // namespace perf -} // namespace base -} // namespace embb - -#endif // _EMBB_BASE_CPP_PERF_DURATION_H diff --git a/base_cpp/perf/include/embb/base/perf/performance_metrics.h b/base_cpp/perf/include/embb/base/perf/performance_metrics.h deleted file mode 100644 index 4e2f194..0000000 --- a/base_cpp/perf/include/embb/base/perf/performance_metrics.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2014, Siemens AG. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef EMBB_BASE_CPP_PERF_PERFORMANCE_METRICS_H_ -#define EMBB_BASE_CPP_PERF_PERFORMANCE_METRICS_H_ - -namespace embb { -namespace base { -namespace perf { - -struct PerformanceMetrics { - float real_time; - float proc_time; - float mflops; - long long flpins; -}; - -} // namespace perf -} // namespace base -} // namespace embb - -#endif // EMBB_BASE_CPP_PERF_PERFORMANCE_METRICS_H_ - diff --git a/base_cpp/perf/include/embb/base/perf/performance_test_runner.h b/base_cpp/perf/include/embb/base/perf/performance_test_runner.h deleted file mode 100644 index a0e4ec0..0000000 --- a/base_cpp/perf/include/embb/base/perf/performance_test_runner.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2014, Siemens AG. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef EMBB_BASE_PERF_PERFORMANCE_TEST_RUNNER_H_ -#define EMBB_BASE_PERF_PERFORMANCE_TEST_RUNNER_H_ - -#include - -namespace embb { -namespace base { -namespace perf { - -class PerformanceTestRunner { - -public: - - PerformanceTestRunner( - const embb::base::perf::CallArgs & args) : - cargs(args) { - } - virtual ~PerformanceTestRunner() { } - virtual void Run() = 0; - -protected: - - inline const embb::base::perf::CallArgs & Args() const { - return cargs; - } - -private: - - const embb::base::perf::CallArgs & cargs; -}; - -} // namespace perf -} // namespace base -} // namespace embb - -#endif \ No newline at end of file diff --git a/base_cpp/perf/include/embb/base/perf/speedup_test.h b/base_cpp/perf/include/embb/base/perf/speedup_test.h index a4dbae2..8b87b79 100644 --- a/base_cpp/perf/include/embb/base/perf/speedup_test.h +++ b/base_cpp/perf/include/embb/base/perf/speedup_test.h @@ -75,23 +75,27 @@ class SpeedupTest : public partest::TestCase { * Prints the durations of all units in comma separated format. */ void PrintReport(std::ostream & ostr) { - double serial_duration = ser_unit_->GetDuration(); + double base_serial_duration = ser_unit_->GetDuration(); // print sample row for sequential run (degree 0): ostr << "0," << std::fixed << std::setprecision(2) - << serial_duration << "," + << base_serial_duration << "," + << std::fixed << 1.0 << "," << std::fixed << 1.0 << std::endl; // print sample rows for parallel runs (degree > 0): std::vector < std::pair< unsigned int, double > > durations = par_unit_->GetDurations(); + double base_parallel_duration = durations[0].second; for (unsigned int i = 0; i < durations.size(); ++i) { ostr << std::fixed << durations[i].first << "," << std::fixed << std::setprecision(2) << durations[i].second << "," - << std::fixed << serial_duration / durations[i].second + << std::fixed << base_serial_duration / durations[i].second + << "," + << std::fixed << base_parallel_duration / durations[i].second << std::endl; } } diff --git a/base_cpp/perf/include/embb/base/perf/time_measure.h b/base_cpp/perf/include/embb/base/perf/time_measure.h index 82f54ff..91eb24c 100644 --- a/base_cpp/perf/include/embb/base/perf/time_measure.h +++ b/base_cpp/perf/include/embb/base/perf/time_measure.h @@ -1,3 +1,4 @@ + /* * Copyright (c) 2014, Siemens AG. All rights reserved. *