From 818fc9077b17b99c1e757808f0b56e83a1081250 Mon Sep 17 00:00:00 2001 From: Tobias Reiter <44025882+tobre1@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:56:31 +0100 Subject: [PATCH] Fix windows error (#63) * Add write to file define * reduce number of reflection tests --- tests/reflection/reflection.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/reflection/reflection.cpp b/tests/reflection/reflection.cpp index 63620f1..0213ea7 100644 --- a/tests/reflection/reflection.cpp +++ b/tests/reflection/reflection.cpp @@ -3,12 +3,14 @@ #include +// #define VR_WRITE_TO_FILE + using namespace viennaray; int main() { using NumericType = double; - constexpr int N = 50000; + constexpr int N = 5000; RNG rngState(12351263); Timer timer; @@ -28,11 +30,13 @@ int main() { << " diffuse reflections: " << timer.currentDuration * 1e-6 << " ms" << std::endl; +#ifdef VR_WRITE_TO_FILE std::ofstream file("diffuse_reflection.txt"); for (auto const &dir : directions) { file << dir[0] << " " << dir[1] << " " << dir[2] << std::endl; } file.close(); +#endif } Vec3D normal = {0.0, 0.0, 1.0}; @@ -61,11 +65,13 @@ int main() { << " coned specular reflections: " << timer.currentDuration * 1e-6 << " ms" << std::endl; +#ifdef VR_WRITE_TO_FILE std::ofstream file("coned_specular_reflection.txt"); for (auto const &dir : directions) { file << dir[0] << " " << dir[1] << " " << dir[2] << std::endl; } file.close(); +#endif } { @@ -82,11 +88,13 @@ int main() { std::cout << "Time for " << N << " coned specular reflections (old): " << timer.currentDuration * 1e-6 << " ms" << std::endl; +#ifdef VR_WRITE_TO_FILE std::ofstream file("coned_specular_reflection_old.txt"); for (auto const &dir : directions) { file << dir[0] << " " << dir[1] << " " << dir[2] << std::endl; } file.close(); +#endif } return 0;