Commit 077e21b4 by Tobias Fuchs

performance_test: fixed compiler warnings, cleanup

parent 517d459b
......@@ -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;
......
......@@ -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
......
#ifndef _EMBB_BASE_CPP_PERF_MEASURE_H
#define _EMBB_BASE_CPP_PERF_MEASURE_H
#include <embb/base/perf/duration.h>
#include <embb/base/perf/performance_metrics.h>
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
/*
* 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_
/*
* 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 <embb/base/perf/call_args.h>
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
......@@ -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;
}
}
......
/*
* Copyright (c) 2014, Siemens AG. All rights reserved.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment