From 6d9da3af9f4cc59870b53e6e6a849c6a976bef9e Mon Sep 17 00:00:00 2001 From: Sebastian Hahta <joseha@utu.fi> Date: Thu, 23 Apr 2020 10:01:41 +0300 Subject: [PATCH] nvcc: --expt-relaxed-constexpr for numeric_limits --- lib/libstereo/CMakeLists.txt | 5 +++-- lib/libstereo/src/wta.hpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libstereo/CMakeLists.txt b/lib/libstereo/CMakeLists.txt index 175a3c670..78f367ad5 100644 --- a/lib/libstereo/CMakeLists.txt +++ b/lib/libstereo/CMakeLists.txt @@ -20,10 +20,10 @@ set(CMAKE_USE_RELATIVE_PATHS ON) set(CMAKE_CXX_FLAGS_RELEASE) if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CUDA_FLAGS "--gpu-architecture=compute_61 -std=c++14 -Xcompiler -fPIC -Xcompiler ${OpenMP_CXX_FLAGS}") + set(CMAKE_CUDA_FLAGS "--gpu-architecture=compute_61 -std=c++14 -Xcompiler -fPIC -Xcompiler ${OpenMP_CXX_FLAGS} --expt-relaxed-constexpr") set(CMAKE_CUDA_FLAGS_RELEASE "-O3") else() - set(CMAKE_CUDA_FLAGS "--gpu-architecture=compute_61 -std=c++14") + set(CMAKE_CUDA_FLAGS "--gpu-architecture=compute_61 -std=c++14 --expt-relaxed-constexpr") set(CMAKE_CUDA_FLAGS_RELEASE "-O3") endif() @@ -51,6 +51,7 @@ set_target_properties(libstereo PROPERTIES PUBLIC_HEADER include/stereo.hpp) else() add_library(libstereo src/stereo_gradientstree.cu + src/stereo_gtsgm.cu src/stereo_misgm.cu src/stereo_misgm2.cu src/stereo_censussgm.cu diff --git a/lib/libstereo/src/wta.hpp b/lib/libstereo/src/wta.hpp index 679638c9e..b23325ebd 100644 --- a/lib/libstereo/src/wta.hpp +++ b/lib/libstereo/src/wta.hpp @@ -76,7 +76,7 @@ namespace algorithms { auto* ptr_min_cost = min_cost.ptr(y); for (int x = 0; x < dsi.width; ++x) { - TCost min1 = TCost(-1); //std::numeric_limits<TCost>::max(); + TCost min1 = std::numeric_limits<TCost>::max(); //TCost min2 = TCost(-1); //std::numeric_limits<TCost>::max(); TDisp d = TDisp(0); @@ -146,7 +146,7 @@ namespace algorithms { TDisp* ptr_disparity = disparity.ptr(y); for (int x = thread.x; x < size.x; x+=stride.x) { - TCost min1 = TCost(-1); //std::numeric_limits<TCost>::max(); + TCost min1 = std::numeric_limits<TCost>::max(); TDisp d = TDisp(0); for (int d_ = dsi.disp_min; d_ < min(dsi.disp_max+1, dsi.width-x); d_++) { -- GitLab