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

Adding find package for hsa-runtime64, hsakmt, hip, rocm_smi, hiprand & rocrand #854

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
99 changes: 65 additions & 34 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ if(rocblas_FOUND)
set(RVS_ROCBLAS_VERSION_MAJ ${rocblas_VERSION_MAJOR} )
set(RVS_ROCBLAS_VERSION_MIN ${rocblas_VERSION_MINOR} )
set(RVS_ROCBLAS_VERSION_PAT ${rocblas_VERSION_PATCH} )
set(ROCBLAS_INC_DIR ${rocblas_INCLUDE_DIR} )
get_filename_component(ROCBLAS_LIB_DIR "${ROCBLAS_INC_DIR}/../lib" ABSOLUTE)

if( (RVS_ROCBLAS_VERSION_MAJ GREATER 999) OR (RVS_ROCBLAS_VERSION_MIN GREATER 999) OR (RVS_ROCBLAS_VERSION_PAT GREATER 999) )
message(FATAL_ERROR "RVS rocblas: Too big ROCBLAS version number(s)" )
Expand All @@ -73,17 +75,76 @@ else() #If ROCBLAS not found
message(FATAL_ERROR "rocblas not found !!! Install rocblas to proceed ...")
endif(rocblas_FOUND)

find_package (hipblaslt)
if(hipblaslt_FOUND)
message(STATUS "hipblaslt found")
set(HIPBLASLT_INC_DIR ${hipblaslt_INCLUDE_DIR} )
get_filename_component(HIPBLASLT_LIB_DIR "${HIPBLASLT_INC_DIR}/../lib" ABSOLUTE)
else() #If HIPBLASLT not found
message(FATAL_ERROR "hipblaslt not found !!! Install hipblaslt to proceed ...")
endif(hipblaslt_FOUND)

find_package (hsa-runtime64)
if(hsa-runtime64_FOUND)
message(STATUS "hsa-runtime64 found")
get_target_property(HSA_INC_DIR hsa-runtime64::hsa-runtime64 INTERFACE_INCLUDE_DIRECTORIES)
get_filename_component(HSA_PATH "${HSA_INC_DIR}/.." ABSOLUTE)
get_filename_component(HSA_LIB_DIR "${HSA_PATH}/lib" ABSOLUTE)
set(ROCR_INC_DIR ${HSA_INC_DIR})
set(ROCR_LIB_DIR ${HSA_LIB_DIR})
else() #If HSA not found
message(FATAL_ERROR "hsa not found !!! Install hsa to proceed ...")
endif(hsa-runtime64_FOUND)

find_package (hip)
if(hip_FOUND)
set(HIP_INC_DIR ${hip_INCLUDE_DIR})
set(HIP_LIB_DIR ${hip_LIB_INSTALL_DIR})
else() #If HIP not found
message(FATAL_ERROR "hip not found !!! Install hip to proceed ...")
endif(hip_FOUND)

find_package (rocm_smi)
if(rocm_smi_FOUND)
message(STATUS "rocm_smi found")
set(ROCM_SMI_INC_DIR ${rocm_smi_INCLUDE_DIR} )
set(ROCM_SMI_LIB_DIR ${rocm_smi_LIB_DIR} )
renjithravindrankannath marked this conversation as resolved.
Show resolved Hide resolved
else() #If ROCM_SMI not found
message(FATAL_ERROR "rocm-smi not found !!! Install rocm-smi to proceed ...")
endif(rocm_smi_FOUND)

find_package (hiprand)
renjithravindrankannath marked this conversation as resolved.
Show resolved Hide resolved
if(hiprand_FOUND)
message(STATUS "hiprand found")
set(HIPRAND_INC_DIR ${hiprand_INCLUDE_DIR} )
get_filename_component(HIPRAND_LIB_DIR "${hiprand_INCLUDE_DIR}/../lib" ABSOLUTE)
else() #If HIPRAND not found
message(FATAL_ERROR "hiprand not found !!! Install hiprand to proceed ...")
endif(hiprand_FOUND)

find_package (rocrand)
if(rocrand_FOUND)
message(STATUS "rocrand found")
set(ROCRAND_INC_DIR ${rocrand_INCLUDE_DIR} )
get_filename_component(ROCRAND_LIB_DIR "${rocrand_INCLUDE_DIR}/../lib" ABSOLUTE)
else() #If ROCRAND not found
message(FATAL_ERROR "rocrand not found !!! Install rocrand to proceed ...")
endif(rocrand_FOUND)

find_package(hipblas-common)
if(hipblas-common_FOUND)
message(STATUS "rocrand found")
else() #If hipblas-common not found
message(FATAL_ERROR "hipblas-common not found !!! Install rocrand to proceed ...")
endif(hipblas-common_FOUND)

# Making ROCM_PATH, CMAKE_INSTALL_PREFIX, CPACK_PACKAGING_INSTALL_PREFIX as CACHE
# variables since we will pass them as cmake params appropriately, and
# all find_packages relevant to this build will be in ROCM path hence appending it to CMAKE_PREFIX_PATH
set(ROCM_PATH "/opt/rocm" CACHE PATH "ROCM install path")
set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "CMAKE installation directory")
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm" CACHE PATH "Prefix used in built packages")
list(APPEND CMAKE_PREFIX_PATH "${ROCM_PATH}")
set(ROCR_INC_DIR "${ROCM_PATH}/include" CACHE PATH "Contains header files exported by ROC Runtime" FORCE)
set(ROCR_LIB_DIR "${ROCM_PATH}/lib" CACHE PATH "Contains library files exported by ROC Runtime" FORCE)
set(HIP_INC_DIR "${ROCM_PATH}" CACHE PATH "Contains header files exported by ROC Runtime")
set(ROCT_INC_DIR "${ROCM_PATH}/include" CACHE PATH "Contains header files exported by ROC Trunk" FORCE)

add_definitions(-DROCM_PATH="${ROCM_PATH}")
if(FETCH_ROCMPATH_FROM_ROCMCORE)
Expand Down Expand Up @@ -229,16 +290,6 @@ set(RVS_ROCMSMI "0" CACHE STRING "1 = use local rocm_smi_lib")

set(RVS_LIB_DIR "${CMAKE_BINARY_DIR}/rvslib" CACHE PATH "Contains RVS library")

if (${RVS_OS_TYPE} STREQUAL "centos")
set(ROCT_LIB_DIR "${ROCM_PATH}/lib64" CACHE PATH "Contains library files exported by ROC Trunk")
renjithravindrankannath marked this conversation as resolved.
Show resolved Hide resolved
elseif (${RVS_OS_TYPE} STREQUAL "rhel")
set(ROCT_LIB_DIR "${ROCM_PATH}/lib64" CACHE PATH "Contains library files exported by ROC Trunk")
elseif (${RVS_OS_TYPE} STREQUAL "sles")
set(ROCT_LIB_DIR "${ROCM_PATH}/lib64" CACHE PATH "Contains library files exported by ROC Trunk")
else()
set(ROCT_LIB_DIR "${ROCM_PATH}/lib" CACHE PATH "Contains library files exported by ROC Trunk")
endif()

message(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
message(STATUS "RVS_COVERAGE = ${RVS_COVERAGE}")
message(STATUS "RVS_BUILD_TESTS = ${RVS_BUILD_TESTS}")
Expand Down Expand Up @@ -447,34 +498,14 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/rvs_smi-build/librocm_smi64.so

endif() # if (RVS_ROCMSMI EQUAL 1)

set(HIPRAND_INC_DIR "${ROCM_PATH}/include")
set(HIPRAND_LIB_DIR "${ROCM_PATH}/lib")
set(HIPBLASLT_INC_DIR "${ROCM_PATH}/include")
set(HIPBLASLT_LIB_DIR "${ROCM_PATH}/lib")

if (RVS_ROCBLAS EQUAL 1)
set(ROCBLAS_INC_DIR "${CMAKE_BINARY_DIR}/rvs_rblas-src/build/release/rocblas-install")
set(ROCBLAS_LIB_DIR "${CMAKE_BINARY_DIR}/rvs_rblas-src/build/release/rocblas-install/lib/")
else()
set(ROCBLAS_INC_DIR "${ROCM_PATH}/include")
set(ROCBLAS_LIB_DIR "${ROCM_PATH}/lib")
endif()

if (RVS_ROCMSMI EQUAL 1)
set(ROCM_SMI_INC_DIR "${CMAKE_BINARY_DIR}/rvs_smi-src/include")
set(ROCM_SMI_LIB_DIR "${CMAKE_BINARY_DIR}/rvs_smi-build")
else()
#NOTE:Include folders need to be updated to latest include dir as per REORG Folder structure.
#For backward compatibility we are currently using version details to determine the include path
#Current Work Around to check ROCMSMI Version is using ROCBLAS REORG VERSION
if( RVS_ROCBLAS_VERSION_FLAT LESS 2044000 )
set(ROCM_SMI_INC_DIR "${ROCM_PATH}/rocm_smi/include")
set(ROCM_SMI_LIB_DIR "${ROCM_PATH}/rocm_smi/lib")
else()
message( STATUS "ROCBLAS REORG Enabled Version: ${RVS_ROCBLAS_VERSION_FLAT}" )
set(ROCM_SMI_INC_DIR "${ROCM_PATH}/include")
set(ROCM_SMI_LIB_DIR "${ROCM_PATH}/lib")
endif()
endif()
set(ROCM_SMI_LIB "rocm_smi64" CACHE STRING "rocm_smi library name")

Expand Down
12 changes: 6 additions & 6 deletions babel.so/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ endif()
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -DHIP_VERSION_MAJOR=${HIP_VERSION_MAJOR} -DHIP_VERSION_MINOR=${HIP_VERSION_MINOR} -DHIP_VERSION_PATCH=${HIP_VERSION_GITDATE}")

set(HIP_HCC_BUILD_FLAGS)
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_PATH}/include ${ASAN_CXX_FLAGS}")
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_INC_DIR} ${ASAN_CXX_FLAGS}")

set(HIP_STREAM_BUILD_FLAGS "-DNONTEMPORAL=1 -DTBSIZE=1024 -O3 -std=c++17")

Expand Down Expand Up @@ -109,12 +109,12 @@ set(HIP_HCC_LIB "amdhip64")
add_compile_options(-DRVS_ROCBLAS_VERSION_FLAT=${RVS_ROCBLAS_VERSION_FLAT})

# Determine Roc Runtime header files are accessible
if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime.h)
if(NOT EXISTS ${HIP_INC_DIR}/hip/hip_runtime.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()

if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime_api.h)
if(NOT EXISTS ${HIP_INC_DIR}/hip/hip_runtime_api.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()
Expand All @@ -135,16 +135,16 @@ if(DEFINED RVS_ROCMSMI)
endif()


if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so")
message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR})
if(NOT EXISTS "${HIP_LIB_DIR}/lib${HIP_HCC_LIB}.so")
message("ERROR: ROC Runtime libraries can't be found under specified path. Please set HIP_LIB_DIR path. Current value is : " ${HIP_LIB_DIR})
RETURN()
endif()

## define include directories
include_directories(./ ../ ${ROCR_INC_DIR} ${HIP_INC_DIR})

# Add directories to look for library files to link
link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH})
link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR})
## additional libraries
set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so)

Expand Down
2 changes: 1 addition & 1 deletion cmake_modules/tests_unit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
## define additional unit testing include directories
include_directories(${UT_INC})
## define additional unit testing lib directories
link_directories(${UT_LIB} ${RVS_LIB_DIR})
link_directories(${UT_LIB} ${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR})

file(GLOB TESTSOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} test/test*.cpp )
#message ( "TESTSOURCES: ${TESTSOURCES}" )
Expand Down
16 changes: 8 additions & 8 deletions edp.so/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ endif()
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -DHIP_VERSION_MAJOR=${HIP_VERSION_MAJOR} -DHIP_VERSION_MINOR=${HIP_VERSION_MINOR} -DHIP_VERSION_PATCH=${HIP_VERSION_GITDATE}")

set(HIP_HCC_BUILD_FLAGS)
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_PATH}/include")
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_INC_DIR}")


# Set compiler and compiler flags
Expand All @@ -102,12 +102,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${HIP_HCC_BUILD_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${HIP_HCC_BUILD_FLAGS}")

# Determine Roc Runtime header files are accessible
if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime.h)
if(NOT EXISTS ${HIP_INC_DIR}/hip/hip_runtime.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()

if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime_api.h)
if(NOT EXISTS ${HIP_INC_DIR}/hip/hip_runtime_api.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()
Expand All @@ -128,15 +128,15 @@ if(DEFINED RVS_ROCMSMI)
endif()


if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so")
message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR})
if(NOT EXISTS "${HIP_LIB_DIR}/lib${HIP_HCC_LIB}.so")
message("ERROR: ROC Runtime libraries can't be found under specified path. Please set HIP_LIB_DIR path. Current value is : " ${HIP_LIB_DIR})
RETURN()
endif()

## define include directories
include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR})
include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR} ${YAML_CPP_INCLUDE_DIR} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR})
# Add directories to look for library files to link
link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR})
link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR})
renjithravindrankannath marked this conversation as resolved.
Show resolved Hide resolved
## additional libraries
set (PROJECT_LINK_LIBS rvslib libpthread.so libpciaccess.so libpci.so libm.so)

Expand All @@ -148,7 +148,7 @@ add_library( ${RVS_TARGET} SHARED ${SOURCES})
set_target_properties(${RVS_TARGET} PROPERTIES
SUFFIX .so.${LIB_VERSION_STRING}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB})
target_link_libraries(${RVS_TARGET} ${PROJECT_LINK_LIBS} ${HIP_HCC_LIB} ${ROCBLAS_LIB} ${HIPRAND_LIB} ${ROCRAND_LIB})
add_dependencies(${RVS_TARGET} rvslib)

add_custom_command(TARGET ${RVS_TARGET} POST_BUILD
Expand Down
6 changes: 3 additions & 3 deletions gm.so/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ endif()
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -DHIP_VERSION_MAJOR=${HIP_VERSION_MAJOR} -DHIP_VERSION_MINOR=${HIP_VERSION_MINOR} -DHIP_VERSION_PATCH=${HIP_VERSION_GITDATE}")

set(HIP_HCC_BUILD_FLAGS)
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_PATH}/include ${ASAN_CXX_FLAGS}")
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_INC_DIR} ${ASAN_CXX_FLAGS}")

# Set compiler and compiler flags
set(CMAKE_CXX_COMPILER "${HIPCC_PATH}/bin/hipcc")
Expand Down Expand Up @@ -118,9 +118,9 @@ if(DEFINED RVS_ROCMSMI)
endif()

## define include directories
include_directories(./ ../ ${ROCM_SMI_INC_DIR})
include_directories(./ ../ ${ROCM_SMI_INC_DIR} ${YAML_CPP_INCLUDE_DIR})
# Add directories to look for library files to link
link_directories(${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH})
link_directories(${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR} ${HIPBLASLT_LIB_DIR})
## additional libraries
set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so)

Expand Down
5 changes: 2 additions & 3 deletions gm.so/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@
set(ROCBLAS_LIB "rocblas")
set(HIPRAND_LIB "hiprand")
set(HIPBLASLT_LIB "hipblaslt")
set(ROC_THUNK_NAME "hsakmt")
set(CORE_RUNTIME_NAME "hsa-runtime")
set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64")

set(UT_LINK_LIBS libpthread.so libpci.so libm.so libdl.so "lib${ROCM_SMI_LIB}.so"
${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB}
${ROCBLAS_LIB} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB}
)

# Add directories to look for library files to link
link_directories(${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR})
link_directories(${ROCM_SMI_LIB_DIR} ${ROCBLAS_LIB_DIR} ${HIPRAND_LIB_DIR} ${HSA_LIB_DIR} ${HIPBLASLT_LIB_DIR} ${YAML_CPP_LIBRARY_DIR})

set (UT_SOURCES src/action.cpp src/worker.cpp
)
Expand Down
6 changes: 3 additions & 3 deletions gpup.so/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ endif()
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -DHIP_VERSION_MAJOR=${HIP_VERSION_MAJOR} -DHIP_VERSION_MINOR=${HIP_VERSION_MINOR} -DHIP_VERSION_PATCH=${HIP_VERSION_GITDATE}")

set(HIP_HCC_BUILD_FLAGS)
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_PATH}/include ${ASAN_CXX_FLAGS}")
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_INC_DIR} ${ASAN_CXX_FLAGS}")


# Set compiler and compiler flags
Expand All @@ -109,9 +109,9 @@ else()
endif()

## define include directories
include_directories(./ ../ include ../include)
include_directories(./ ../ include ../include ${YAML_CPP_INCLUDE_DIR})
# Add directories to look for library files to link
link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH})
link_directories(${RVS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_LIB_DIR} ${ROCRAND_LIB_DIR} ${ROCR_LIB_DIR})
## additional libraries
set (PROJECT_LINK_LIBS rvslib libpci.so libm.so)

Expand Down
5 changes: 2 additions & 3 deletions gpup.so/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
set(ROCBLAS_LIB "rocblas")
set(HIPRAND_LIB "hiprand")
set(HIPBLASLT_LIB "hipblaslt")
set(ROC_THUNK_NAME "hsakmt")
set(CORE_RUNTIME_NAME "hsa-runtime")
set(CORE_RUNTIME_TARGET "${CORE_RUNTIME_NAME}64")

set(UT_LINK_LIBS libpthread.so libm.so libdl.so ${ROCM_SMI_LIB}
${ROCBLAS_LIB} ${ROC_THUNK_NAME} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB})
${ROCBLAS_LIB} ${CORE_RUNTIME_TARGET} ${ROCM_CORE} ${YAML_CPP_LIBRARIES} ${HIPRAND_LIB} ${HIPBLASLT_LIB})

# Add directories to look for library files to link
link_directories(${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ROCT_LIB_DIR} ${ROCBLAS_LIB_DIR})
link_directories(${RVS_LIB_DIR} ${ROCM_SMI_LIB_DIR} ${ROCBLAS_LIB_DIR} ${HIPBLASLT_LIB_DIR} ${YAML_CPP_LIBRARY_DIR})

set (UT_SOURCES src/action.cpp
)
Expand Down
14 changes: 7 additions & 7 deletions gst.so/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ endif()
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -DHIP_VERSION_MAJOR=${HIP_VERSION_MAJOR} -DHIP_VERSION_MINOR=${HIP_VERSION_MINOR} -DHIP_VERSION_PATCH=${HIP_VERSION_GITDATE}")

set(HIP_HCC_BUILD_FLAGS)
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_PATH}/include ${ASAN_CXX_FLAGS}")
set(HIP_HCC_BUILD_FLAGS "${HIP_HCC_BUILD_FLAGS} -fPIC ${HCC_CXX_FLAGS} -I${HSA_INC_DIR} ${ASAN_CXX_FLAGS}")

# Set compiler and compiler flags
set(CMAKE_CXX_COMPILER "${HIPCC_PATH}/bin/hipcc")
Expand All @@ -111,12 +111,12 @@ else()
endif()

# Determine Roc Runtime header files are accessible
if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime.h)
if(NOT EXISTS ${HIP_INC_DIR}/hip/hip_runtime.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()

if(NOT EXISTS ${HIP_INC_DIR}/include/hip/hip_runtime_api.h)
if(NOT EXISTS ${HIP_INC_DIR}/hip/hip_runtime_api.h)
message("ERROR: ROC Runtime headers can't be found under specified path. Please set HIP_INC_DIR path. Current value is : " ${HIP_INC_DIR})
RETURN()
endif()
Expand All @@ -137,15 +137,15 @@ if(DEFINED RVS_ROCMSMI)
endif()


if(NOT EXISTS "${ROCR_LIB_DIR}/lib${HIP_HCC_LIB}.so")
message("ERROR: ROC Runtime libraries can't be found under specified path. Please set ROCR_LIB_DIR path. Current value is : " ${ROCR_LIB_DIR})
if(NOT EXISTS "${HIP_LIB_DIR}/lib${HIP_HCC_LIB}.so")
message("ERROR: ROC Runtime libraries can't be found under specified path. Please set HIP_LIB_DIR path. Current value is : " ${HIP_LIB_DIR})
RETURN()
endif()

## define include directories
include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR})
include_directories(./ ../ ${ROCR_INC_DIR} ${ROCBLAS_INC_DIR} ${HIP_INC_DIR} ${HIPRAND_INC_DIR} ${ROCRAND_INC_DIR} ${HIPBLASLT_INC_DIR} ${HIPBLAS-COMMON_INCLUDE_DIR})
# Add directories to look for library files to link
link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH})
link_directories(${RVS_LIB_DIR} ${ROCR_LIB_DIR} ${HIP_LIB_DIR} ${ROCBLAS_LIB_DIR} ${ASAN_LIB_PATH} ${ROCM_SMI_LIB_DIR} ${HIPRAND_DIR} ${ROCRAND_DIR})
## additional libraries
set (PROJECT_LINK_LIBS rvslib libpthread.so libpci.so libm.so)

Expand Down
Loading
Loading