11.08., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit dc64895d authored by Jakob Weiss's avatar Jakob Weiss

Improved timing of processors, TextureManager enabled by default

parent b2472508
...@@ -220,9 +220,13 @@ namespace campvis { ...@@ -220,9 +220,13 @@ namespace campvis {
} }
std::chrono::high_resolution_clock::time_point endTime = std::chrono::high_resolution_clock::now(); std::chrono::high_resolution_clock::time_point endTime = std::chrono::high_resolution_clock::now();
auto dT = std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime); auto dT = std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime);
auto timeSinceLastExec = std::chrono::duration_cast<std::chrono::microseconds>(endTime - processor->getLastExecutionTime());
double dTms = double(dT.count()) / 1000.; double dTms = double(dT.count()) / 1000.;
double timeSinceLastExecMs = double(timeSinceLastExec.count()) / 1000.;
LINFO("Executed processor " << processor->getName() << " GPU duration: \t" << double(gpuTimeElapsed)/1e6 << ", total: \t" << dTms << " ms"); processor->setLastExeuctionTime(endTime);
LINFO("Timing " << processor->getName() << ": GPU: \t" << double(gpuTimeElapsed)/1e6 << "ms, total: \t" << dTms << "ms, since Last Exec: \t" << timeSinceLastExecMs << "ms.");
} }
} }
} }
......
...@@ -147,6 +147,16 @@ namespace campvis { ...@@ -147,6 +147,16 @@ namespace campvis {
_clockExecutionTime = value; _clockExecutionTime = value;
} }
std::chrono::high_resolution_clock::time_point AbstractProcessor::getLastExecutionTime()
{
return _lastExecutionTime;
}
void AbstractProcessor::setLastExeuctionTime(const std::chrono::high_resolution_clock::time_point & executionTime)
{
_lastExecutionTime = executionTime;
}
void AbstractProcessor::process(DataContainer& data) { void AbstractProcessor::process(DataContainer& data) {
if (hasInvalidShader()) { if (hasInvalidShader()) {
updateShader(); updateShader();
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "core/datastructures/datacontainer.h" #include "core/datastructures/datacontainer.h"
#include "core/properties/propertycollection.h" #include "core/properties/propertycollection.h"
#include <chrono>
#include <unordered_map> #include <unordered_map>
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -232,6 +233,16 @@ namespace campvis { ...@@ -232,6 +233,16 @@ namespace campvis {
*/ */
void setClockExecutionTime(bool value); void setClockExecutionTime(bool value);
/**
* Returns the absolute time of the last (timed) execution
*/
std::chrono::high_resolution_clock::time_point getLastExecutionTime();
/**
* Sets the absolute time of the last execution
*/
void setLastExeuctionTime(const std::chrono::high_resolution_clock::time_point& executionTime);
/** /**
* Returns the current lockProcessor status of this processor. * Returns the current lockProcessor status of this processor.
* If a processor is locked, all of its properties are locked and its process method must not be called. * If a processor is locked, all of its properties are locked and its process method must not be called.
...@@ -388,6 +399,7 @@ namespace campvis { ...@@ -388,6 +399,7 @@ namespace campvis {
tbb::atomic<bool> _enabled; ///< flag whether this processor is currently enabled tbb::atomic<bool> _enabled; ///< flag whether this processor is currently enabled
tbb::atomic<bool> _clockExecutionTime; ///< flag whether to measure the execution time of this processor tbb::atomic<bool> _clockExecutionTime; ///< flag whether to measure the execution time of this processor
std::chrono::high_resolution_clock::time_point _lastExecutionTime; ///< time of last execution
tbb::atomic<int> _ignorePropertyChanges; ///< flag whether signals from properties shall be ignored tbb::atomic<int> _ignorePropertyChanges; ///< flag whether signals from properties shall be ignored
/// Flag whether this processor is currently locked /// Flag whether this processor is currently locked
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "opengljobprocessor.h" #include "opengljobprocessor.h"
//#define ENABLE_TEXTURE_POOL #define ENABLE_TEXTURE_POOL
namespace { namespace {
/// private class to format iostream to use points as a thousands separator /// private class to format iostream to use points as a thousands separator
......
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 to comment