From 83e0f5fd7669522f87e2b788ca432a3fff951bfa Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Sun, 3 Nov 2024 15:07:18 +0100 Subject: [PATCH 1/5] Introduce Simdlib and OpenMP versions in ViSP-third-party.txt --- 3rdparty/simdlib/CMakeLists.txt | 3 +++ CMakeLists.txt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/3rdparty/simdlib/CMakeLists.txt b/3rdparty/simdlib/CMakeLists.txt index 7056b6d382..49b7273c10 100644 --- a/3rdparty/simdlib/CMakeLists.txt +++ b/3rdparty/simdlib/CMakeLists.txt @@ -1,5 +1,8 @@ project(${SIMD_LIBRARY}) +# SIMD_VERSION should math the version set in Simd/SimdVersion.h +set(SIMD_VERSION "4.9.109" PARENT_SCOPE) + vp_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(COMMON_CXX_FLAGS "${CMAKE_CXX_FLAGS}") diff --git a/CMakeLists.txt b/CMakeLists.txt index a97bd70bcc..b0b8331c42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1777,7 +1777,7 @@ status(" \\- Use ZLIB:" USE_ZLIB THEN "yes (ver ${ZLIB_VERS status(" Use OpenCV:" USE_OPENCV THEN "yes (ver ${OpenCV_VERSION})" ELSE "no") status(" Use stb_image (built-in):" WITH_STBIMAGE THEN "yes (ver ${STBIMAGE_VERSION})" ELSE "no") status(" Use TinyEXR (built-in):" WITH_TINYEXR THEN "yes (ver ${TINYEXR_VERSION})" ELSE "no") -status(" Use simdlib (built-in):" WITH_SIMDLIB THEN "yes" ELSE "no") +status(" Use simdlib (built-in):" WITH_SIMDLIB THEN "yes (ver ${SIMD_VERSION})" ELSE "no") status(" Use npz I/O (built-in):" WITH_MINIZ THEN "yes" ELSE "no") status("") status(" Real robots: ") @@ -1863,10 +1863,10 @@ status(" Use json (nlohmann system):" USE_NLOHMANN_JSON THEN "yes (ver ${nlo endif() status("") status(" Optimization: ") -status(" Use OpenMP:" USE_OPENMP THEN "yes" ELSE "no") +status(" Use OpenMP:" USE_OPENMP THEN "yes (ver ${OpenMP_CXX_VERSION})" ELSE "no") status(" Use std::thread:" USE_THREADS THEN "yes" ELSE "no") status(" Use pthread:" USE_PTHREAD THEN "yes" ELSE "no") -status(" Use simdlib (built-in):" WITH_SIMDLIB THEN "yes" ELSE "no") +status(" Use simdlib (built-in):" WITH_SIMDLIB THEN "yes (ver ${SIMD_VERSION})" ELSE "no") status("") status(" DNN: ") status(" Use CUDA Toolkit:" USE_TENSORRT AND CUDA_FOUND THEN "yes (ver ${CUDA_VERSION})" ELSE "no") @@ -1875,7 +1875,7 @@ status(" Use TensorRT:" USE_TENSORRT THEN "yes (ver ${TENSORR # ========================== documentation ========================== status("") status(" Documentation: ") -status(" Use doxygen:" DOXYGEN_FOUND THEN "yes" ELSE "no") +status(" Use doxygen:" DOXYGEN_FOUND THEN "yes (ver ${DOXYGEN_VERSION})" ELSE "no") status(" \\- Use mathjax:" USE_MATHJAX THEN "yes" ELSE "no") # ========================== samples and tests ========================== From 998ca205943a8ffbc7195ea1006a9fdeea57d963 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Sun, 3 Nov 2024 15:08:28 +0100 Subject: [PATCH 2/5] Fix warning around "#pragma omp simd" usage that is not available on Apple M1 Pro with Apple clang version 16.0.0 compiler: [ 91%] Building CXX object modules/ar/CMakeFiles/visp_ar.dir/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp.o .../modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp:184:33: warning: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Wpass-failed=transform-warning] 184 | void vpPanda3DGeometryRenderer::getRender(vpImage &normals, vpImage &depth, const vpRect &bb, unsigned int h, unsigned w) const | ^ 1 warning generated. --- .../vpPanda3DGeometryRenderer.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp index a9d65345ed..03379a8bc2 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp @@ -198,16 +198,22 @@ void vpPanda3DGeometryRenderer::getRender(vpImage &normals, vpImage(m_renderParameters.getImageWidth()); for (unsigned int i = 0; i < m_renderParameters.getImageHeight(); ++i) { const float *const rowData = data - i * rowIncrement; vpRGBf *normalRow = normals[top + i]; float *depthRow = depth[top + i]; -#pragma omp simd - for (unsigned int j = 0; j < m_renderParameters.getImageWidth(); ++j) { - normalRow[left + j].R = (rowData[j * 4]); - normalRow[left + j].G = (rowData[j * 4 + 1]); - normalRow[left + j].B = (rowData[j * 4 + 2]); - depthRow[left + j] = (rowData[j * 4 + 3]); +#if defined(_OPENMP) +#pragma omp parallel for +#endif + for (int j = 0; j < image_width; ++j) { + int left_j = left + j; + int j_4 = j + 4; + normalRow[left_j].R = (rowData[j_4]); + normalRow[left_j].G = (rowData[j_4 + 1]); + normalRow[left_j].B = (rowData[j_4 + 2]); + depthRow[left_j] = (rowData[j_4 + 3]); } } } From 5c2e8aab54e77d8a069b3e3e8696abe5b31cbfc1 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Sun, 3 Nov 2024 15:50:48 +0100 Subject: [PATCH 3/5] Use VISP_HAVE_OPENMP macro instead of _OPENMP --- modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp index 03379a8bc2..c080259a01 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp @@ -204,7 +204,7 @@ void vpPanda3DGeometryRenderer::getRender(vpImage &normals, vpImage Date: Mon, 4 Nov 2024 09:19:22 +0100 Subject: [PATCH 4/5] Update with last changes concerning yolo v11 --- ChangeLog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 758f9b1f53..0d9da78b11 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -44,6 +44,8 @@ ViSP 3.x.x (Version in development) . Update tinyexr 3rdparty to 1.0.9 release . Update stb_image 3rdparty to 2.30 version . Update Catch2 3rdparty to 3.7.1 version + . Add compatibility with Yolo v11 in vpDetectorDNNOpenCV a wrapper over the OpenCV DNN module that allows + to detect objects - Applications . Migrate eye-to-hand tutorials in apps - Tutorials From e05728197e88bc36e301752f0b38fd48a3e731f8 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 5 Nov 2024 08:03:16 +0100 Subject: [PATCH 5/5] Fix wrong optimization --- modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp index c080259a01..5f8d211f4b 100644 --- a/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp +++ b/modules/ar/src/panda3d-simulator/vpPanda3DGeometryRenderer.cpp @@ -209,7 +209,7 @@ void vpPanda3DGeometryRenderer::getRender(vpImage &normals, vpImage