Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

Commit dc64895d authored by Jakob Weiss's avatar Jakob Weiss
Browse files

Improved timing of processors, TextureManager enabled by default

parent b2472508
......@@ -220,9 +220,13 @@ namespace campvis {
}
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 timeSinceLastExec = std::chrono::duration_cast<std::chrono::microseconds>(endTime - processor->getLastExecutionTime());
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 {
_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) {
if (hasInvalidShader()) {
updateShader();
......
......@@ -36,6 +36,7 @@
#include "core/datastructures/datacontainer.h"
#include "core/properties/propertycollection.h"
#include <chrono>
#include <unordered_map>
#include <string>
#include <vector>
......@@ -232,6 +233,16 @@ namespace campvis {
*/
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.
* 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 {
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
std::chrono::high_resolution_clock::time_point _lastExecutionTime; ///< time of last execution
tbb::atomic<int> _ignorePropertyChanges; ///< flag whether signals from properties shall be ignored
/// Flag whether this processor is currently locked
......
......@@ -5,7 +5,7 @@
#include "opengljobprocessor.h"
//#define ENABLE_TEXTURE_POOL
#define ENABLE_TEXTURE_POOL
namespace {
/// 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