Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add include directories for rocTracer, hipBLAS-common, rocRAND #3615

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,10 @@ if( MIOPEN_BACKEND STREQUAL "HIP" OR MIOPEN_BACKEND STREQUAL "HIPOC" OR MIOPEN_B
set_var_to_condition(MIOPEN_USE_HIPBLASLT_DEFAULT NOT WIN32)
option(MIOPEN_USE_HIPBLASLT "Use hipBlasLt" ${MIOPEN_USE_HIPBLASLT_DEFAULT})
if(MIOPEN_USE_HIPBLASLT)
find_package(hipblas REQUIRED PATHS /opt/rocm $ENV{HIP_PATH})
message(STATUS "Build with hipbBLAS ${hipblas_VERSION} ${hipblas_DIR}")
find_package(hipblaslt REQUIRED PATHS /opt/rocm $ENV{HIP_PATH})
message(STATUS "Build with hipbBLASLt ${hipblaslt_VERSION} ${hipblaslt_DIR}")
message(STATUS "Build with hipBLASLt ${hipblaslt_VERSION} ${hipblaslt_DIR}")
find_package(hipblas-common REQUIRED PATHS /opt/rocm $ENV{HIP_PATH})
message(STATUS "Build with hipBLAS-common ${hipblas-common_VERSION} ${hipBLAS-common_DIR}")
else()
message(STATUS "Build without hipbBLASLt")
endif()
Expand Down Expand Up @@ -534,9 +534,11 @@ set(MIOPEN_SYSTEM_FIND_DB_SUFFIX "${MIOPEN_BACKEND}" CACHE PATH "Filename suffix
# Enabled via the MIOPEN_ENABLE_LOGGING_ROCTX env var.
set(MIOPEN_USE_ROCTRACER ON CACHE BOOL "")
if(NOT WIN32 AND MIOPEN_USE_ROCTRACER)
find_path(ROCTRACER_INCLUDE_DIR "roctracer/roctx.h")
find_library(rocTracer roctx64)
if(rocTracer)
if(rocTracer AND ROCTRACER_INCLUDE_DIR)
MESSAGE(STATUS "Build with rocTracer: " ${rocTracer})
MESSAGE(STATUS "rocTracer include directory: " ${ROCTRACER_INCLUDE_DIR})
set(MIOPEN_PACKAGE_REQS "${MIOPEN_PACKAGE_REQS}, roctracer")
else()
message(WARNING "rocTracer cannot be found! Build without rocTracer")
Expand All @@ -559,12 +561,10 @@ if(MIOPEN_OFFLINE_COMPILER_PATHS_V2)
set(MIOPEN_PACKAGE_REQS "${MIOPEN_PACKAGE_REQS}, rocm-core")
endif()

if(MIOPEN_BUILD_DRIVER)
# PR #2785 MIOpenDriver to use rocrand to init buffers
find_package(rocrand REQUIRED)
message(STATUS "Build with rocrand ${rocrand_VERSION} ${rocrand_DIR}")
set(MIOPEN_PACKAGE_REQS "${MIOPEN_PACKAGE_REQS}, rocrand")
endif()
# PR #2785 MIOpenDriver to use rocrand to init buffers
find_package(rocrand REQUIRED)
message(STATUS "Build with rocrand ${rocrand_VERSION} ${rocrand_DIR}")
set(MIOPEN_PACKAGE_REQS "${MIOPEN_PACKAGE_REQS}, rocrand")

if(MIOPEN_BACKEND STREQUAL "HIP")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${MIOPEN_PACKAGE_REQS}")
Expand Down
9 changes: 8 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,11 @@ endif()

if(hipblaslt_FOUND)
target_link_libraries( MIOpen PRIVATE roc::hipblaslt )
target_include_directories( MIOpen INTERFACE $<BUILD_INTERFACE:${HIPBLAS-COMMON_INCLUDE_DIR}> )
endif()

target_include_directories( MIOpen PRIVATE ${ROCRAND_INCLUDE_DIR} )

# For backward compatibility with ROCm 5.3
# Build with library libMLIRMIOpen
if(LIBMLIRMIOPEN)
Expand All @@ -958,6 +961,7 @@ if(rocMLIR_FOUND)
endif()

target_link_libraries(MIOpen PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(MIOpen INTERFACE $<BUILD_INTERFACE:nlohmann_json::nlohmann_json>)

target_internal_library(MIOpen
Boost::filesystem
Expand Down Expand Up @@ -988,6 +992,7 @@ endif()
if(MIOPEN_ENABLE_SQLITE)
# MIOpen depends on SQLite
target_link_libraries(MIOpen PRIVATE SQLite::SQLite3)
target_link_libraries(MIOpen INTERFACE $<BUILD_INTERFACE:SQLite::SQLite3>)
endif()
############################################################
# MIOpen depends on librt for Boost.Interprocess
Expand All @@ -1000,7 +1005,9 @@ if(NOT WIN32 AND NOT APPLE)
endif()

if(MIOPEN_USE_ROCTRACER)
target_link_libraries(MIOpen PRIVATE roctx64)
target_include_directories(MIOpen PRIVATE ${ROCTRACER_INCLUDE_DIR})
target_include_directories(MIOpen INTERFACE $<BUILD_INTERFACE:${ROCTRACER_INCLUDE_DIR}>)
target_link_libraries(MIOpen PRIVATE ${rocTracer})
endif()

############################################################
Expand Down
2 changes: 1 addition & 1 deletion src/include/miopen/handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#endif

#if MIOPEN_USE_HIPBLASLT
#include <hipblas/hipblas.h>
#include <hipblas-common/hipblas-common.h>

using hipblasLtHandle_t = void*;
extern "C" hipblasStatus_t hipblasLtDestroy(hipblasLtHandle_t handle);
Expand Down
Loading