New patch to add half include path for tests in 6.1 (#44697)
* Add half include path for tests in 6.1 * removing unwanted when="@:6.1" * Correcting conditon to apply patch * Stlye check error fix and updating rpp dependency * Audit check error fix * Correcting rpp dependency and adding hsa-rocr-dev lib path to LD_LIBRARY_PATH
This commit is contained in:
parent
61c8326180
commit
bc3903d0e0
@ -0,0 +1,86 @@
|
|||||||
|
From 19f084566394c6556cacf1b812a9a64e1fe0610e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Renjith Ravindran <Renjith.RavindranKannath@amd.com>
|
||||||
|
Date: Wed, 12 Jun 2024 23:33:53 +0000
|
||||||
|
Subject: [PATCH] add half include path for tests in 6.1
|
||||||
|
|
||||||
|
---
|
||||||
|
model_compiler/python/nnir_to_clib.py | 4 ++++
|
||||||
|
samples/mv_objdetect/CMakeLists.txt | 6 +++++-
|
||||||
|
utilities/rocAL/rocAL_unittests/CMakeLists.txt | 3 ++-
|
||||||
|
utilities/rocAL/rocAL_video_unittests/CMakeLists.txt | 3 ++-
|
||||||
|
4 files changed, 13 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/model_compiler/python/nnir_to_clib.py b/model_compiler/python/nnir_to_clib.py
|
||||||
|
index 623bf43..544ed31 100644
|
||||||
|
--- a/model_compiler/python/nnir_to_clib.py
|
||||||
|
+++ b/model_compiler/python/nnir_to_clib.py
|
||||||
|
@@ -160,6 +160,10 @@ if (OPENVX_BACKEND_OPENCL_FOUND)
|
||||||
|
include_directories (${OpenCL_INCLUDE_DIRS} ${OpenCL_INCLUDE_DIRS}/Headers )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
+find_path(HALF_INCLUDE_DIR half.hpp)
|
||||||
|
+message(STATUS "HALF_INCLUDE_DIR: ${HALF_INCLUDE_DIR}")
|
||||||
|
+include_directories(${HALF_INCLUDE_DIR})
|
||||||
|
+
|
||||||
|
find_package(OpenCV QUIET)
|
||||||
|
include_directories (${ROCM_PATH}/include ${ROCM_PATH}/include/mivisionx)
|
||||||
|
include_directories (${PROJECT_SOURCE_DIR}/lib)
|
||||||
|
diff --git a/samples/mv_objdetect/CMakeLists.txt b/samples/mv_objdetect/CMakeLists.txt
|
||||||
|
index 54d527b..c334ae4 100644
|
||||||
|
--- a/samples/mv_objdetect/CMakeLists.txt
|
||||||
|
+++ b/samples/mv_objdetect/CMakeLists.txt
|
||||||
|
@@ -29,6 +29,7 @@ project (mvobjdetect)
|
||||||
|
set (CMAKE_CXX_STANDARD 14)
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||||
|
+find_path(HALF_INCLUDE_DIR half.hpp)
|
||||||
|
find_package(OpenCV QUIET)
|
||||||
|
|
||||||
|
set(ROCM_PATH /opt/rocm CACHE PATH "ROCm Installation Path")
|
||||||
|
@@ -50,7 +51,10 @@ if (OPENVX_BACKEND_OPENCL_FOUND)
|
||||||
|
include_directories (${OpenCL_INCLUDE_DIRS} ${OpenCL_INCLUDE_DIRS}/Headers )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
-include_directories (${ROCM_PATH}/include ${ROCM_PATH}/include/mivisionx ${PROJECT_SOURCE_DIR} )
|
||||||
|
+find_path(HALF_INCLUDE_DIR half.hpp)
|
||||||
|
+message(STATUS "HALF_INCLUDE_DIR: ${HALF_INCLUDE_DIR}")
|
||||||
|
+
|
||||||
|
+include_directories (${ROCM_PATH}/include/mivisionx ${PROJECT_SOURCE_DIR} ${HALF_INCLUDE_DIR} )
|
||||||
|
link_directories (${ROCM_PATH}/lib ${PROJECT_SOURCE_DIR}/lib)
|
||||||
|
option (USE_POSTPROC "Use postprocessing module implementation" ON)
|
||||||
|
set(SOURCES mvobjdetect.cpp mvdeploy_api.cpp visualize.cpp)
|
||||||
|
diff --git a/utilities/rocAL/rocAL_unittests/CMakeLists.txt b/utilities/rocAL/rocAL_unittests/CMakeLists.txt
|
||||||
|
index ba90dce..f3f2df9 100644
|
||||||
|
--- a/utilities/rocAL/rocAL_unittests/CMakeLists.txt
|
||||||
|
+++ b/utilities/rocAL/rocAL_unittests/CMakeLists.txt
|
||||||
|
@@ -43,11 +43,12 @@ include(GNUInstallDirs)
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake)
|
||||||
|
|
||||||
|
+find_path(HALF_INCLUDE_DIR half.hpp)
|
||||||
|
find_package(OpenCV QUIET)
|
||||||
|
find_package(AMDRPP QUIET)
|
||||||
|
|
||||||
|
include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
-include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR}/mivisionx/rocal)
|
||||||
|
+include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR}/mivisionx/rocal ${HALF_INCLUDE_DIR})
|
||||||
|
link_directories(${ROCM_PATH}/lib/)
|
||||||
|
file(GLOB My_Source_Files ./*.cpp)
|
||||||
|
add_executable(${PROJECT_NAME} ${My_Source_Files})
|
||||||
|
diff --git a/utilities/rocAL/rocAL_video_unittests/CMakeLists.txt b/utilities/rocAL/rocAL_video_unittests/CMakeLists.txt
|
||||||
|
index 8f4c0fa..dd23135 100644
|
||||||
|
--- a/utilities/rocAL/rocAL_video_unittests/CMakeLists.txt
|
||||||
|
+++ b/utilities/rocAL/rocAL_video_unittests/CMakeLists.txt
|
||||||
|
@@ -48,7 +48,8 @@ find_package(OpenCV QUIET)
|
||||||
|
find_package(AMDRPP QUIET)
|
||||||
|
|
||||||
|
include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
-include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR}/mivisionx/rocal)
|
||||||
|
+find_path(HALF_INCLUDE_DIR half.hpp)
|
||||||
|
+include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR}/mivisionx/rocal ${HALF_INCLUDE_DIR})
|
||||||
|
link_directories(${ROCM_PATH}/lib/)
|
||||||
|
file(GLOB My_Source_Files ./*.cpp)
|
||||||
|
add_executable(${PROJECT_NAME} ${My_Source_Files})
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
@ -53,7 +53,8 @@ def url_for_version(self, version):
|
|||||||
|
|
||||||
patch("0001-add-half-include-path.patch", when="@5.5")
|
patch("0001-add-half-include-path.patch", when="@5.5")
|
||||||
patch("0001-add-half-include-path-5.6.patch", when="@5.6:")
|
patch("0001-add-half-include-path-5.6.patch", when="@5.6:")
|
||||||
patch("0002-add-half-include-path-for-tests.patch", when="@5.5: +add_tests")
|
patch("0002-add-half-include-path-for-tests.patch", when="@5.5:6.0 +add_tests")
|
||||||
|
patch("0002-add-half-include-path-for-tests-6.1.0.patch", when="@6.1.0: +add_tests")
|
||||||
|
|
||||||
patch(
|
patch(
|
||||||
"https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/commit/da24882438b91a0ae1feee23206b75c1a1256887.patch?full_index=1",
|
"https://github.com/GPUOpen-ProfessionalCompute-Libraries/MIVisionX/commit/da24882438b91a0ae1feee23206b75c1a1256887.patch?full_index=1",
|
||||||
@ -99,6 +100,33 @@ def patch(self):
|
|||||||
"rocAL/rocAL/rocAL_hip/CMakeLists.txt",
|
"rocAL/rocAL/rocAL_hip/CMakeLists.txt",
|
||||||
string=True,
|
string=True,
|
||||||
)
|
)
|
||||||
|
if self.spec.satisfies("@5.5.0:6.0.0 +add_tests"):
|
||||||
|
filter_file(
|
||||||
|
r"${ROCM_PATH}/include/mivisionx",
|
||||||
|
"{0}/include/mivisionx".format(self.spec.prefix),
|
||||||
|
"samples/inference/mv_objdetect/CMakeLists.txt",
|
||||||
|
string=True,
|
||||||
|
)
|
||||||
|
filter_file(
|
||||||
|
r"${ROCM_PATH}/lib",
|
||||||
|
"{0}/lib".format(self.spec.prefix),
|
||||||
|
"samples/inference/mv_objdetect/CMakeLists.txt",
|
||||||
|
string=True,
|
||||||
|
)
|
||||||
|
if self.spec.satisfies("@6.1.0: +add_tests"):
|
||||||
|
filter_file(
|
||||||
|
r"${ROCM_PATH}/include/mivisionx",
|
||||||
|
"{0}/include/mivisionx".format(self.spec.prefix),
|
||||||
|
"samples/mv_objdetect/CMakeLists.txt",
|
||||||
|
string=True,
|
||||||
|
)
|
||||||
|
filter_file(
|
||||||
|
r"${ROCM_PATH}/lib",
|
||||||
|
"{0}/lib".format(self.spec.prefix),
|
||||||
|
"samples/mv_objdetect/CMakeLists.txt",
|
||||||
|
string=True,
|
||||||
|
)
|
||||||
|
|
||||||
if self.spec.satisfies("+add_tests"):
|
if self.spec.satisfies("+add_tests"):
|
||||||
filter_file(
|
filter_file(
|
||||||
r"${ROCM_PATH}/include/mivisionx",
|
r"${ROCM_PATH}/include/mivisionx",
|
||||||
@ -124,18 +152,6 @@ def patch(self):
|
|||||||
"tests/amd_migraphx_tests/resnet50/CMakeLists.txt",
|
"tests/amd_migraphx_tests/resnet50/CMakeLists.txt",
|
||||||
string=True,
|
string=True,
|
||||||
)
|
)
|
||||||
filter_file(
|
|
||||||
r"${ROCM_PATH}/include/mivisionx",
|
|
||||||
"{0}/include/mivisionx".format(self.spec.prefix),
|
|
||||||
"samples/inference/mv_objdetect/CMakeLists.txt",
|
|
||||||
string=True,
|
|
||||||
)
|
|
||||||
filter_file(
|
|
||||||
r"${ROCM_PATH}/lib",
|
|
||||||
"{0}/lib".format(self.spec.prefix),
|
|
||||||
"samples/inference/mv_objdetect/CMakeLists.txt",
|
|
||||||
string=True,
|
|
||||||
)
|
|
||||||
filter_file(
|
filter_file(
|
||||||
r"${ROCM_PATH}/include/mivisionx",
|
r"${ROCM_PATH}/include/mivisionx",
|
||||||
"{0}/include/mivisionx".format(self.spec.prefix),
|
"{0}/include/mivisionx".format(self.spec.prefix),
|
||||||
@ -186,7 +202,7 @@ def patch(self):
|
|||||||
)
|
)
|
||||||
depends_on("openssl")
|
depends_on("openssl")
|
||||||
depends_on("libjpeg-turbo@2.0.6+partial_decoder", type="build")
|
depends_on("libjpeg-turbo@2.0.6+partial_decoder", type="build")
|
||||||
depends_on("rpp", when="@5.5:")
|
depends_on("rpp@1.2.0", when="@5.5:5.6")
|
||||||
depends_on("lmdb", when="@5.5:")
|
depends_on("lmdb", when="@5.5:")
|
||||||
depends_on("py-setuptools", when="@5.6:")
|
depends_on("py-setuptools", when="@5.6:")
|
||||||
depends_on("py-wheel", when="@5.6:")
|
depends_on("py-wheel", when="@5.6:")
|
||||||
@ -258,9 +274,13 @@ def patch(self):
|
|||||||
]:
|
]:
|
||||||
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
depends_on(f"rocm-core@{ver}", when=f"@{ver}")
|
||||||
depends_on("python@3.5:", type="build")
|
depends_on("python@3.5:", type="build")
|
||||||
|
for ver in ["5.7.0", "5.7.1", "6.0.0", "6.0.2", "6.1.0", "6.1.1"]:
|
||||||
|
depends_on(f"rpp@{ver}", when=f"@{ver}")
|
||||||
|
|
||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
env.set("MIVISIONX_MODEL_COMPILER_PATH", self.spec.prefix.libexec.mivisionx.model_compiler)
|
env.set("MIVISIONX_MODEL_COMPILER_PATH", self.spec.prefix.libexec.mivisionx.model_compiler)
|
||||||
|
if self.spec.satisfies("@6.1:"):
|
||||||
|
env.prepend_path("LD_LIBRARY_PATH", self.spec["hsa-rocr-dev"].prefix.lib)
|
||||||
|
|
||||||
def flag_handler(self, name, flags):
|
def flag_handler(self, name, flags):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
|
Loading…
Reference in New Issue
Block a user