mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-08 12:30:00 -05:00
Fixed for Win32 compatability
Renamed OpenCL qualifiers due to conflict with "ERROR" macros Removed boost::timer and boost::system dependencies Added fixed for Windows path handling
This commit is contained in:
+1
-1
Submodule ext/ghoul updated: 684947be61...cfff0062e3
@@ -11,7 +11,7 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <fstream>
|
||||
#include <boost/timer/timer.hpp>
|
||||
//#include <boost/timer/timer.hpp>
|
||||
#include <stdio.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
|
||||
@@ -112,8 +112,13 @@ private:
|
||||
|
||||
// C-style I/O
|
||||
std::FILE *file_;
|
||||
#ifdef WIN32
|
||||
long long dataPos_;
|
||||
#else
|
||||
off_t dataPos_;
|
||||
|
||||
#endif
|
||||
|
||||
bool hasReadHeader_;
|
||||
bool atlasInitialized_;
|
||||
|
||||
@@ -139,7 +144,7 @@ private:
|
||||
unsigned int _z);
|
||||
|
||||
// Timer and timer constants
|
||||
boost::timer::cpu_timer timer_;
|
||||
//boost::timer::cpu_timer timer_;
|
||||
const double BYTES_PER_GB = 1073741824.0;
|
||||
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ TODO: Iteratively break away parts from it into other classes.
|
||||
#include <glm/glm.hpp>
|
||||
#include <ghoul/opencl/ghoul_cl.h>
|
||||
#include <openspace/flare/KernelConstants.h>
|
||||
#include <boost/timer/timer.hpp>
|
||||
//#include <boost/timer/timer.hpp>
|
||||
#include <openspace/flare/TSP.h>
|
||||
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
@@ -184,7 +184,7 @@ private:
|
||||
|
||||
|
||||
// Timer and timer constants
|
||||
boost::timer::cpu_timer timer_;
|
||||
//boost::timer::cpu_timer timer_;
|
||||
|
||||
|
||||
cl_mem cubeFrontCLmem;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#define SGCT_WINDOWS_INCLUDE
|
||||
#include <sgct.h>
|
||||
#include <openspace/flare/Animator.h>
|
||||
#include <openspace/flare/Raycaster.h>
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <ghoul/io/rawvolumereader.h>
|
||||
#include <ghoul/filesystem/file.h>
|
||||
|
||||
#define SGCT_WINDOWS_INCLUDE
|
||||
#include <sgct.h>
|
||||
|
||||
//#include <vector>
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <ghoul/io/rawvolumereader.h>
|
||||
#include <ghoul/filesystem/file.h>
|
||||
|
||||
#define SGCT_WINDOWS_INCLUDE
|
||||
#include <sgct.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
@@ -74,9 +74,9 @@ private:
|
||||
|
||||
// Forward declare template specializations
|
||||
template<>
|
||||
ghoul::TemplateFactory<Renderable()>* FactoryManager::factoryByType();
|
||||
ghoul::TemplateFactory<Renderable>* FactoryManager::factoryByType();
|
||||
template<>
|
||||
ghoul::TemplateFactory<PositionInformation()>* FactoryManager::factoryByType();
|
||||
ghoul::TemplateFactory<PositionInformation>* FactoryManager::factoryByType();
|
||||
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
|
||||
// sgct header has to be included before all others due to Windows header
|
||||
#define SGCT_WINDOWS_INCLUDE
|
||||
#include "sgct.h"
|
||||
|
||||
#include <openspace/interaction/deviceidentifier.h>
|
||||
@@ -109,7 +110,11 @@ bool OpenSpaceEngine::registerBasePathFromConfigurationFile(const std::string& f
|
||||
|
||||
const std::string absolutePath = FileSys.absolutePath(filename);
|
||||
|
||||
#ifdef WIN32
|
||||
auto last = absolutePath.find_last_of("\\");
|
||||
#else
|
||||
auto last = absolutePath.find_last_of("/");
|
||||
#endif
|
||||
if(last == absolutePath.npos)
|
||||
return false;
|
||||
|
||||
@@ -124,8 +129,12 @@ bool OpenSpaceEngine::findConfiguration(std::string& filename) {
|
||||
if (filename != "") {
|
||||
return FileSys.fileExists(filename);
|
||||
}
|
||||
std::string currentDirectory = FileSys.currentDirectory();
|
||||
std::string currentDirectory = FileSys.absolutePath(FileSys.currentDirectory());
|
||||
#ifdef WIN32
|
||||
size_t occurrences = std::count(currentDirectory.begin(), currentDirectory.end(), '\\');
|
||||
#else
|
||||
size_t occurrences = std::count(currentDirectory.begin(), currentDirectory.end(), '/');
|
||||
#endif
|
||||
|
||||
std::string cfgname = "openspace.cfg";
|
||||
|
||||
|
||||
@@ -78,7 +78,11 @@ bool BrickManager::ReadHeader() {
|
||||
INFO("");
|
||||
|
||||
// Keep track of position for data in file
|
||||
#ifdef WIN32
|
||||
dataPos_ = _ftelli64(file_);
|
||||
#else
|
||||
dataPos_ = ftello(file_);
|
||||
#endif
|
||||
|
||||
brickDim_ = xBrickDim_;
|
||||
numBricks_ = xNumBricks_;
|
||||
@@ -107,10 +111,17 @@ bool BrickManager::ReadHeader() {
|
||||
volumeSize_ = brickSize_*numBricksFrame_;
|
||||
numValsTot_ = numBrickVals_*numBricksFrame_;
|
||||
|
||||
#ifdef WIN32
|
||||
_fseeki64(file_, 0, SEEK_END);
|
||||
long long fileSize = _ftelli64(file_);
|
||||
long long calcFileSize = static_cast<long long>(numBricksTree_)*
|
||||
static_cast<long long>(brickSize_)+dataPos_;
|
||||
#else
|
||||
fseeko(file_, 0, SEEK_END);
|
||||
off_t fileSize = ftello(file_);
|
||||
off_t calcFileSize = static_cast<off_t>(numBricksTree_) *
|
||||
static_cast<off_t>(brickSize_) + dataPos_;
|
||||
#endif
|
||||
|
||||
if (fileSize != calcFileSize) {
|
||||
ERROR("Sizes don't match");
|
||||
@@ -391,7 +402,11 @@ bool BrickManager::DiskToPBO(BUFFER_INDEX _pboIndex) {
|
||||
in_.read(reinterpret_cast<char*>(seqBuffer), brickSize_*sequence);
|
||||
*/
|
||||
|
||||
fseeko(file_, offset, SEEK_SET);
|
||||
#ifdef WIN32
|
||||
_fseeki64(file_, offset, SEEK_SET);
|
||||
#else
|
||||
fseeko(file_, offset, SEEK_SET);
|
||||
#endif
|
||||
fread(reinterpret_cast<void*>(seqBuffer), bufSize, 1, file_);
|
||||
if (ferror(file_) != 0) {
|
||||
ERROR("File reading error");
|
||||
|
||||
+16
-16
@@ -85,7 +85,7 @@ bool CLProgram::AddTexture(unsigned int _argNr, ghoul::opengl::Texture *_texture
|
||||
cl_mem texture;
|
||||
switch (_textureType) {
|
||||
case GL_TEXTURE_1D:
|
||||
ERROR("Texture 1D unimplemented");
|
||||
LERROR("Texture 1D unimplemented");
|
||||
return false;
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
@@ -111,7 +111,7 @@ bool CLProgram::AddTexture(unsigned int _argNr, ghoul::opengl::Texture *_texture
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
ERROR("Unknown GL texture type");
|
||||
LERROR("Unknown GL texture type");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ bool CLProgram::AddTexture(unsigned int _argNr, ghoul::opengl::Texture *_texture
|
||||
|
||||
switch (_textureType) {
|
||||
case GL_TEXTURE_1D:
|
||||
ERROR("Texture 1D unimplemented");
|
||||
LERROR("Texture 1D unimplemented");
|
||||
return false;
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
@@ -162,7 +162,7 @@ bool CLProgram::AddTexture(unsigned int _argNr, ghoul::opengl::Texture *_texture
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
ERROR("Unknown GL texture type");
|
||||
LERROR("Unknown GL texture type");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ bool CLProgram::AddBuffer(unsigned int _argNr,
|
||||
cl_mem_flags _permissions) {
|
||||
|
||||
if (!_hostPtr) {
|
||||
ERROR("AddBuffer(): Host pointer is NULL");
|
||||
LERROR("AddBuffer(): Host pointer is NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ bool CLProgram::ReadBuffer(unsigned int _argNr,
|
||||
unsigned int _sizeInBytes,
|
||||
cl_bool _blocking) {
|
||||
if (memArgs_.find((cl_uint)_argNr) == memArgs_.end()) {
|
||||
ERROR("ReadBuffer(): Could not find mem arg " << _argNr);
|
||||
LERROR("ReadBuffer(): Could not find mem arg " << _argNr);
|
||||
return false;
|
||||
}
|
||||
error_ = clEnqueueReadBuffer(clManager_->commandQueues_[CLManager::EXECUTE],
|
||||
@@ -237,7 +237,7 @@ bool CLProgram::ReadBuffer(unsigned int _argNr,
|
||||
|
||||
bool CLProgram::ReleaseBuffer(unsigned int _argNr) {
|
||||
if (memArgs_.find((cl_uint)_argNr) == memArgs_.end()) {
|
||||
ERROR("ReleaseBuffer(): Could not find mem arg " << _argNr);
|
||||
LERROR("ReleaseBuffer(): Could not find mem arg " << _argNr);
|
||||
return false;
|
||||
}
|
||||
//LDEBUG("Releasing memory");
|
||||
@@ -266,8 +266,8 @@ bool CLProgram::PrepareProgram() {
|
||||
|
||||
if (!clManager_->CheckSuccess(error_, "PrepareProgram")) {
|
||||
LDEBUG("error: " << getErrorString(error_));
|
||||
ERROR("Failed to enqueue GL object aqcuisition");
|
||||
ERROR("Failing object: " << it->first);
|
||||
LERROR("Failed to enqueue GL object aqcuisition");
|
||||
LERROR("Failing object: " << it->first);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -280,7 +280,7 @@ bool CLProgram::PrepareProgram() {
|
||||
(it->second).size_,
|
||||
&((it->second).mem_));
|
||||
if (!clManager_->CheckSuccess(error_, "PrepareProgram")) {
|
||||
ERROR("Failed to set kernel argument " << it->first);
|
||||
LERROR("Failed to set kernel argument " << it->first);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -292,7 +292,7 @@ bool CLProgram::PrepareProgram() {
|
||||
sizeof(cl_mem),
|
||||
&(it->second));
|
||||
if (!clManager_->CheckSuccess(error_, "PrepareProgram")) {
|
||||
ERROR("Failed to set texture kernel arg " << it->first);
|
||||
LERROR("Failed to set texture kernel arg " << it->first);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -303,7 +303,7 @@ bool CLProgram::PrepareProgram() {
|
||||
bool CLProgram::SetInt(unsigned int _argNr, int _val) {
|
||||
error_ = clSetKernelArg(kernel_, _argNr, sizeof(int), &_val);
|
||||
if (!clManager_->CheckSuccess(error_, "SetInt")) {
|
||||
ERROR("Failed to set integer value");
|
||||
LERROR("Failed to set integer value");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -331,14 +331,14 @@ bool CLProgram::FinishProgram() {
|
||||
clManager_->commandQueues_[CLManager::EXECUTE], 1,
|
||||
&(it->second), 0, NULL, NULL);
|
||||
if (!clManager_->CheckSuccess(error_, "FinishProgram, release GL objs")) {
|
||||
ERROR("Failed to release GL object");
|
||||
ERROR("Failed object: " << it->first);
|
||||
LERROR("Failed to release GL object");
|
||||
LERROR("Failed object: " << it->first);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
error_ = clFinish(clManager_->commandQueues_[CLManager::EXECUTE]);
|
||||
if (!clManager_->CheckSuccess(error_, "FinishProgram, clFinish")) {
|
||||
ERROR("Failed to finish program");
|
||||
LERROR("Failed to finish program");
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
@@ -369,7 +369,7 @@ char * CLProgram::ReadSource(const std::string &_filename,
|
||||
content[count] = '\0';
|
||||
fclose(in);
|
||||
} else {
|
||||
ERROR("Could not read source from file " << _filename);
|
||||
LERROR("Could not read source from file " << _filename);
|
||||
}
|
||||
_numChars = count;
|
||||
return content;
|
||||
|
||||
+44
-39
@@ -9,6 +9,11 @@
|
||||
#include <sstream>
|
||||
#include <openspace/flare/Utils.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
|
||||
namespace {
|
||||
const std::string _loggerCat = "Flare.Config";
|
||||
}
|
||||
|
||||
using namespace osp;
|
||||
|
||||
@@ -56,7 +61,7 @@ Config::~Config() {}
|
||||
Config * Config::New(const std::string &_configFilename) {
|
||||
Config *config = new Config(_configFilename);
|
||||
if (!config->Read()) {
|
||||
ERROR("Could not read config. Returning NULL.");
|
||||
LERROR("Could not read config. Returning NULL.");
|
||||
delete config;
|
||||
return NULL;
|
||||
}
|
||||
@@ -65,12 +70,12 @@ Config * Config::New(const std::string &_configFilename) {
|
||||
|
||||
bool Config::Read() {
|
||||
|
||||
INFO("\nReading config from " << configFilename_);
|
||||
LINFO("\nReading config from " << configFilename_);
|
||||
|
||||
std::ifstream in;
|
||||
in.open(configFilename_.c_str(), std::ifstream::in);
|
||||
if (!in.is_open()) {
|
||||
ERROR("Could not open " << configFilename_);
|
||||
LERROR("Could not open " << configFilename_);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,120 +92,120 @@ bool Config::Read() {
|
||||
if (variable == "tsp_filename") {
|
||||
ss >> TSPFilename_;
|
||||
TSPFilename_ = absPath(TSPFilename_);
|
||||
INFO("TSP file name: " << TSPFilename_);
|
||||
LINFO("TSP file name: " << TSPFilename_);
|
||||
} else if (variable == "transferfunction_filename") {
|
||||
ss >> TFFilename_;
|
||||
TFFilename_ = absPath(TFFilename_);
|
||||
INFO("Transfer function file name " << TFFilename_);
|
||||
LINFO("Transfer function file name " << TFFilename_);
|
||||
} else if (variable == "spatial_error_tolerance") {
|
||||
ss >> spatialErrorTolerance_;
|
||||
INFO("Spatial error tolerance: " << spatialErrorTolerance_);
|
||||
LINFO("Spatial error tolerance: " << spatialErrorTolerance_);
|
||||
} else if (variable == "temporal_error_tolerance") {
|
||||
ss >> temporalErrorTolerance_;
|
||||
INFO("Temporal error tolerance: " << temporalErrorTolerance_);
|
||||
LINFO("Temporal error tolerance: " << temporalErrorTolerance_);
|
||||
} else if (variable == "tsp_traversal_stepsize") {
|
||||
ss >> TSPTraversalStepsize_;
|
||||
INFO("TSP traversal step size: " << TSPTraversalStepsize_);
|
||||
LINFO("TSP traversal step size: " << TSPTraversalStepsize_);
|
||||
} else if (variable == "raycaster_stepsize") {
|
||||
ss >> raycasterStepsize_;
|
||||
INFO("Ray caster step size: " << raycasterStepsize_);
|
||||
LINFO("Ray caster step size: " << raycasterStepsize_);
|
||||
} else if (variable == "raycaster_intensity") {
|
||||
ss >> raycasterIntensity_;
|
||||
INFO("Ray caster intensity: " << raycasterIntensity_);
|
||||
LINFO("Ray caster intensity: " << raycasterIntensity_);
|
||||
} else if (variable == "animator_refresh_interval") {
|
||||
ss >> animatorRefreshInterval_;
|
||||
INFO("Animator refresh interval: " << animatorRefreshInterval_);
|
||||
LINFO("Animator refresh interval: " << animatorRefreshInterval_);
|
||||
} else if (variable == "win_width") {
|
||||
ss >> winWidth_;
|
||||
INFO("Win width: " << winWidth_);
|
||||
LINFO("Win width: " << winWidth_);
|
||||
} else if (variable == "win_height") {
|
||||
ss >> winHeight_;
|
||||
INFO("Win height: " << winHeight_);
|
||||
LINFO("Win height: " << winHeight_);
|
||||
} else if (variable == "raycaster_kernel_filename") {
|
||||
ss >> raycasterKernelFilename_;
|
||||
raycasterKernelFilename_ = absPath(raycasterKernelFilename_);
|
||||
INFO("Raycaster kernel file name: " << raycasterKernelFilename_);
|
||||
LINFO("Raycaster kernel file name: " << raycasterKernelFilename_);
|
||||
} else if (variable == "tsp_traversal_kernel_filename" ) {
|
||||
ss >> TSPTraversalKernelFilename_;
|
||||
TSPTraversalKernelFilename_ = absPath(TSPTraversalKernelFilename_);
|
||||
INFO("TSP traversal kernel file name: " <<TSPTraversalKernelFilename_);
|
||||
LINFO("TSP traversal kernel file name: " <<TSPTraversalKernelFilename_);
|
||||
} else if (variable == "cube_shader_vert_filename") {
|
||||
ss >> cubeShaderVertFilename_;
|
||||
cubeShaderVertFilename_ = absPath(cubeShaderVertFilename_);
|
||||
INFO("Cube vertex shader file name: " << cubeShaderVertFilename_);
|
||||
LINFO("Cube vertex shader file name: " << cubeShaderVertFilename_);
|
||||
} else if (variable == "cube_shader_frag_filename") {
|
||||
ss >> cubeShaderFragFilename_;
|
||||
cubeShaderFragFilename_ = absPath(cubeShaderFragFilename_);
|
||||
INFO("Cube fragment shader file name: " << cubeShaderFragFilename_);
|
||||
LINFO("Cube fragment shader file name: " << cubeShaderFragFilename_);
|
||||
} else if (variable == "quad_shader_vert_filename") {
|
||||
ss >> quadShaderVertFilename_;
|
||||
quadShaderVertFilename_ = absPath(quadShaderVertFilename_);
|
||||
INFO("Quad vertex shader file name: " << quadShaderVertFilename_);
|
||||
LINFO("Quad vertex shader file name: " << quadShaderVertFilename_);
|
||||
} else if (variable == "quad_shader_frag_filename") {
|
||||
ss >> quadShaderFragFilename_;
|
||||
quadShaderFragFilename_ = absPath(quadShaderFragFilename_);
|
||||
INFO("Cube vertex shader file name: " << quadShaderFragFilename_);
|
||||
LINFO("Cube vertex shader file name: " << quadShaderFragFilename_);
|
||||
} else if (variable == "mouse_pitch_factor") {
|
||||
ss >> mousePitchFactor_;
|
||||
INFO("Mouse pitch factor " << mousePitchFactor_);
|
||||
LINFO("Mouse pitch factor " << mousePitchFactor_);
|
||||
} else if (variable == "mouse_roll_factor") {
|
||||
ss >> mouseRollFactor_;
|
||||
INFO("Mouse roll factor " << mouseRollFactor_);
|
||||
LINFO("Mouse roll factor " << mouseRollFactor_);
|
||||
} else if (variable == "zoom_factor") {
|
||||
ss >> zoomFactor_;
|
||||
INFO("Zoom factor " << zoomFactor_);
|
||||
LINFO("Zoom factor " << zoomFactor_);
|
||||
} else if (variable == "start_pitch") {
|
||||
ss >> startPitch_;
|
||||
INFO("Start pitch: " << startPitch_);
|
||||
LINFO("Start pitch: " << startPitch_);
|
||||
} else if (variable == "start_roll") {
|
||||
ss >> startRoll_;
|
||||
INFO("Start roll: " << startRoll_);
|
||||
LINFO("Start roll: " << startRoll_);
|
||||
} else if (variable == "start_yaw") {
|
||||
ss >> startYaw_;
|
||||
INFO("Start yaw: " << startYaw_);
|
||||
LINFO("Start yaw: " << startYaw_);
|
||||
} else if (variable == "translate_x") {
|
||||
ss >> translateX_;
|
||||
INFO("Translate X: " << translateX_);
|
||||
LINFO("Translate X: " << translateX_);
|
||||
} else if (variable == "translate_y") {
|
||||
ss >> translateY_;
|
||||
INFO("Translate Y: " << translateY_);
|
||||
LINFO("Translate Y: " << translateY_);
|
||||
} else if (variable == "translate_z") {
|
||||
ss >> translateZ_;
|
||||
INFO("Translate Z: " << translateZ_);
|
||||
LINFO("Translate Z: " << translateZ_);
|
||||
} else if (variable == "local_worksize_x") {
|
||||
ss >> localWorkSizeX_;
|
||||
INFO("Local worksize X: " << localWorkSizeX_);
|
||||
LINFO("Local worksize X: " << localWorkSizeX_);
|
||||
} else if (variable == "local_worksize_y") {
|
||||
ss >> localWorkSizeY_;
|
||||
INFO("Local worksize Y: " << localWorkSizeY_);
|
||||
LINFO("Local worksize Y: " << localWorkSizeY_);
|
||||
} else if (variable == "texture_division_factor") {
|
||||
ss >> textureDivisionFactor_;
|
||||
INFO("Texture division factor: " << textureDivisionFactor_);
|
||||
LINFO("Texture division factor: " << textureDivisionFactor_);
|
||||
} else if (variable == "clear_cache") {
|
||||
ss >> clearCache_;
|
||||
INFO("Clearing cache: " << clearCache_);
|
||||
LINFO("Clearing cache: " << clearCache_);
|
||||
} else if (variable == "calculate_error") {
|
||||
ss >> calculateError_;
|
||||
INFO("Calculate error: " << calculateError_);
|
||||
LINFO("Calculate error: " << calculateError_);
|
||||
} else if (variable == "pitch_speed") {
|
||||
ss >> pitchSpeed_;
|
||||
INFO("Pitch speed: " << pitchSpeed_);
|
||||
LINFO("Pitch speed: " << pitchSpeed_);
|
||||
} else if (variable == "roll_speed") {
|
||||
ss >> rollSpeed_;
|
||||
INFO("Roll speed: " << rollSpeed_);
|
||||
LINFO("Roll speed: " << rollSpeed_);
|
||||
} else if (variable == "yaw_speed") {
|
||||
ss >> yawSpeed_;
|
||||
INFO("Yaw speed: " << yawSpeed_);
|
||||
LINFO("Yaw speed: " << yawSpeed_);
|
||||
} else if (variable == "take_screenshot") {
|
||||
ss >> takeScreenshot_;
|
||||
INFO("Take screenshot: " << takeScreenshot_);
|
||||
LINFO("Take screenshot: " << takeScreenshot_);
|
||||
} else {
|
||||
ERROR("Variable name " << variable << " unknown");
|
||||
LERROR("Variable name " << variable << " unknown");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INFO("");
|
||||
LINFO("");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <openspace/flare/KernelConstants.h>
|
||||
#include <openspace/flare/Config.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h> // sync()
|
||||
//#include <unistd.h> // sync()
|
||||
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ bool Raycaster::Render(float _timestep) {
|
||||
|
||||
// Clear cache for benchmarking
|
||||
if (config_->ClearCache()) {
|
||||
sync();
|
||||
//sync();
|
||||
std::ofstream ofs("/proc/sys/vm/drop_caches");
|
||||
ofs << "3" << std::endl;
|
||||
ofs.close();
|
||||
|
||||
+28
-3
@@ -51,7 +51,11 @@ bool TSP::ReadHeader() {
|
||||
INFO("Brick dimensions: "<<xBrickDim_<<" "<<yBrickDim_<<" "<< zBrickDim_);
|
||||
INFO("Num bricks: "<<xNumBricks_<<" "<<yNumBricks_ <<" "<< zNumBricks_);
|
||||
|
||||
#ifdef WIN32
|
||||
dataPos_ = _ftelli64(in);
|
||||
#else
|
||||
dataPos_ = ftello(in);
|
||||
#endif
|
||||
|
||||
paddedBrickDim_ = xBrickDim_ + 2*paddingWidth_;
|
||||
// TODO support dimensions of different size
|
||||
@@ -165,8 +169,13 @@ bool TSP::CalculateSpatialError() {
|
||||
for (unsigned int brick=0; brick<numTotalNodes_; ++brick) {
|
||||
|
||||
// Offset in file
|
||||
#ifdef WIN32
|
||||
long long offset = dataPos_ + static_cast<long long>(brick*numBrickVals*sizeof(float));
|
||||
_fseeki64(in, offset, SEEK_SET);
|
||||
#else
|
||||
off_t offset = dataPos_ + static_cast<off_t>(brick*numBrickVals*sizeof(float));
|
||||
fseeko(in, offset, SEEK_SET);
|
||||
#endif
|
||||
|
||||
fread(reinterpret_cast<void*>(&buffer[0]),
|
||||
static_cast<size_t>(numBrickVals)*sizeof(float), 1, in);
|
||||
@@ -212,8 +221,13 @@ bool TSP::CalculateSpatialError() {
|
||||
lb!=coveredLeafBricks.end(); ++lb) {
|
||||
|
||||
// Read brick
|
||||
#ifdef WIN32
|
||||
long long offset = dataPos_ + static_cast<long long>((*lb)*numBrickVals*sizeof(float));
|
||||
_fseeki64(in, offset, SEEK_SET);
|
||||
#else
|
||||
off_t offset = dataPos_+static_cast<off_t>((*lb)*numBrickVals*sizeof(float));
|
||||
fseeko(in, offset, SEEK_SET);
|
||||
#endif
|
||||
fread(reinterpret_cast<void*>(&buffer[0]),
|
||||
static_cast<size_t>(numBrickVals)*sizeof(float), 1, in);
|
||||
|
||||
@@ -323,8 +337,13 @@ bool TSP::CalculateTemporalError() {
|
||||
std::vector<float> voxelStdDevs(numBrickVals);
|
||||
|
||||
// Read the whole brick to fill the averages
|
||||
#ifdef WIN32
|
||||
long long offset = dataPos_ + static_cast<long long>(brick*numBrickVals*sizeof(float));
|
||||
_fseeki64(in, offset, SEEK_SET);
|
||||
#else
|
||||
off_t offset = dataPos_+static_cast<off_t>(brick*numBrickVals*sizeof(float));
|
||||
fseeko(in, offset, SEEK_SET);
|
||||
#endif
|
||||
fread(reinterpret_cast<void*>(&voxelAverages[0]),
|
||||
static_cast<size_t>(numBrickVals)*sizeof(float), 1, in);
|
||||
|
||||
@@ -349,9 +368,15 @@ bool TSP::CalculateTemporalError() {
|
||||
leaf != coveredBricks.end(); ++leaf) {
|
||||
|
||||
// Sample the leaves at the corresponding voxel position
|
||||
off_t sampleOffset = dataPos_ +
|
||||
static_cast<off_t>((*leaf*numBrickVals+voxel)*sizeof(float));
|
||||
fseeko(in, sampleOffset, SEEK_SET);
|
||||
#ifdef WIN32
|
||||
long long sampleOffset = dataPos_ +
|
||||
static_cast<long long>((*leaf*numBrickVals + voxel)*sizeof(float));
|
||||
_fseeki64(in, sampleOffset, SEEK_SET);
|
||||
#else
|
||||
off_t sampleOffset = dataPos_ +
|
||||
static_cast<off_t>((*leaf*numBrickVals + voxel)*sizeof(float));
|
||||
fseeko(in, sampleOffset, SEEK_SET);
|
||||
#endif
|
||||
float sample;
|
||||
fread(reinterpret_cast<void*>(&sample), sizeof(float), 1, in);
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ namespace {
|
||||
acq = kernel.argumentAccessQualifier(arguments);
|
||||
atq = kernel.argumentTypeQualifier(arguments);
|
||||
++arguments;
|
||||
} while (adq != CLKernel::AddressQualifier::ERROR &&
|
||||
acq != CLKernel::AccessQualifier::ERROR &&
|
||||
atq != CLKernel::TypeQualifier::ERROR);
|
||||
} while (adq != CLKernel::AddressQualifier::Error &&
|
||||
acq != CLKernel::AccessQualifier::Error &&
|
||||
atq != CLKernel::TypeQualifier::Error);
|
||||
|
||||
return arguments - 1;
|
||||
}
|
||||
@@ -371,7 +371,7 @@ void RenderableVolumeExpert::safeKernelCompilation() {
|
||||
|
||||
for (int i = 3; i<maxarguments; ++i) {
|
||||
CLKernel::AccessQualifier acq = tmpKernel.argumentAccessQualifier(i);
|
||||
CLKernel::AccessQualifier expected = CLKernel::AccessQualifier::READ_ONLY;
|
||||
CLKernel::AccessQualifier expected = CLKernel::AccessQualifier::ReadOnly;
|
||||
if (acq != expected) {
|
||||
LWARNING("Argument " << i << " is '" <<
|
||||
CLKernel::AccessQualifierName(acq) <<"', expected '" <<
|
||||
|
||||
Reference in New Issue
Block a user