Adding dependency of roctracer-dev and patch in miopen-hip (#42637)
This commit is contained in:
parent
3290e2c189
commit
62160021c1
3 changed files with 47 additions and 2 deletions
|
@ -0,0 +1,34 @@
|
|||
From 710c4a97891a17b7c8a6ecde01c9ab747becc69b Mon Sep 17 00:00:00 2001
|
||||
From: Renjith Ravindran <Renjith.RavindranKannath@amd.com>
|
||||
Date: Tue, 13 Feb 2024 06:47:02 +0000
|
||||
Subject: [PATCH] adding roctracer-dev include and library path
|
||||
|
||||
---
|
||||
src/CMakeLists.txt | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 7866ad1..8c83b3b 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -714,6 +714,8 @@ set(MIOPEN_CK_LINK_FLAGS composable_kernel::device_operations hip::host)
|
||||
endif()
|
||||
|
||||
target_include_directories(MIOpen SYSTEM PUBLIC $<BUILD_INTERFACE:${HALF_INCLUDE_DIR}>)
|
||||
+target_include_directories(MIOpen SYSTEM PUBLIC "${NLOHMANN_JSON_INCLUDE}")
|
||||
+target_include_directories(MIOpen SYSTEM PUBLIC "${ROCTRACER_INCLUDE_DIR}")
|
||||
target_include_directories(MIOpen SYSTEM PRIVATE ${BZIP2_INCLUDE_DIR})
|
||||
# Workaround : change in rocm-cmake was causing linking error so had to add ${CMAKE_DL_LIBS}
|
||||
# We can remove ${CMAKE_DL_LIBS} once root cause is identified.
|
||||
@@ -855,7 +857,7 @@ if(NOT WIN32 AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
- target_link_libraries(MIOpen PRIVATE roctx64)
|
||||
+ target_link_libraries(MIOpen PRIVATE "${ROCTRACER_LIB_DIR}/libroctx64.so")
|
||||
endif()
|
||||
|
||||
############################################################
|
||||
--
|
||||
2.39.3
|
||||
|
|
@ -53,11 +53,12 @@ class MiopenHip(CMakePackage):
|
|||
depends_on("half")
|
||||
depends_on("zlib-api")
|
||||
|
||||
patch("miopen-hip-include-nlohmann-include-directory.patch", when="@5.4.0:")
|
||||
patch("miopen-hip-include-nlohmann-include-directory.patch", when="@5.4.0:5.7")
|
||||
patch("0002-add-include-dir-miopen-hip-6.0.0.patch", when="@6.0")
|
||||
patch(
|
||||
"https://github.com/ROCm/MIOpen/pull/2276/commits/f60aa1ff89f8fb596b4a6a4c70aa7d557803db87.patch?full_index=1",
|
||||
sha256="c777d9f4cd2bbfec632b38620c0f70bb0cce8da1",
|
||||
when="@5.7:",
|
||||
when="@5.7",
|
||||
)
|
||||
|
||||
for ver in [
|
||||
|
@ -93,6 +94,8 @@ class MiopenHip(CMakePackage):
|
|||
for ver in ["5.4.0", "5.4.3", "5.5.0"]:
|
||||
depends_on("nlohmann-json", type="link")
|
||||
depends_on(f"rocmlir@{ver}", when=f"@{ver}")
|
||||
for ver in ["6.0.0", "6.0.2"]:
|
||||
depends_on("roctracer-dev@" + ver, when="@" + ver)
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
lib_dir = self.spec["zlib-api"].libs.directories[0]
|
||||
|
@ -147,4 +150,9 @@ def cmake_args(self):
|
|||
args.append(
|
||||
"-DNLOHMANN_JSON_INCLUDE={0}".format(self.spec["nlohmann-json"].prefix.include)
|
||||
)
|
||||
if self.spec.satisfies("@6.0.0:"):
|
||||
args.append(
|
||||
"-DROCTRACER_INCLUDE_DIR={0}".format(self.spec["roctracer-dev"].prefix.include)
|
||||
)
|
||||
args.append("-DROCTRACER_LIB_DIR={0}".format(self.spec["roctracer-dev"].prefix.lib))
|
||||
return args
|
||||
|
|
|
@ -110,4 +110,7 @@ def cmake_args(self):
|
|||
]
|
||||
if self.spec.satisfies("@:5.4.0"):
|
||||
args.append(self.define("ROCPROFILER_PATH", self.spec["rocprofiler-dev"].prefix))
|
||||
if self.spec.satisfies("@6.0:"):
|
||||
args.append("-DCMAKE_INSTALL_LIBDIR=lib")
|
||||
|
||||
return args
|
||||
|
|
Loading…
Reference in a new issue