Fix cmake for AMDGPU platform (#13801)
* HIP cmake. Enable whole archieve build for pybind library. Disable two warning. Rollback to C++11. Link RCCL to WA gpu kernel loading issue. Update eigen to fix build failure. Add more include directories. Fix O3 build failure. Update eigen. fix tensor_util_test segment fault issue add more macro check in hip.cmake. we may consider refine hip.cmake to inherit all add_definitions() in parrent scope, in the future. Fix rocRAND load. Update eigen to fix gru_unit_op and reduce_op. Add HIP support to testing. Update eigen to support int16 and int8 in arg min and arg max. * add rocprim as cub library used by nv implementation * Reduce build time in rocprim. * Add rocprim introduction, remove useless cmake code. * Remove useless flags and format cmake file.pr/14530
parent
746554681a
commit
61c5f13fcf
@ -0,0 +1,44 @@
|
||||
if (NOT WITH_AMD_GPU)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# rocprim is "ROCm Parallel Primitives" for short.
|
||||
# It is a header-only library providing HIP and HC parallel primitives
|
||||
# for developing performant GPU-accelerated code on AMD ROCm platform.
|
||||
|
||||
if("x${HCC_HOME}" STREQUAL "x")
|
||||
set(HCC_HOME "/opt/rocm/hcc")
|
||||
endif()
|
||||
|
||||
INCLUDE(ExternalProject)
|
||||
|
||||
SET(ROCPRIM_SOURCE_DIR ${THIRD_PARTY_PATH}/rocprim)
|
||||
SET(ROCPRIM_INSTALL_DIR ${THIRD_PARTY_PATH}/install/rocprim)
|
||||
SET(ROCPRIM_INCLUDE_DIR ${ROCPRIM_INSTALL_DIR}/include)
|
||||
|
||||
ExternalProject_Add(
|
||||
extern_rocprim
|
||||
GIT_REPOSITORY "https://github.com/ROCmSoftwarePlatform/rocPRIM.git"
|
||||
GIT_TAG 5bd41b96ab8d8343330fb2c3e1b96775bde3b3fc
|
||||
PREFIX ${ROCPRIM_SOURCE_DIR}
|
||||
UPDATE_COMMAND ""
|
||||
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${HCC_HOME}/bin/hcc
|
||||
CMAKE_ARGS -DONLY_INSTALL=ON
|
||||
CMAKE_ARGS -DBUILD_TEST=OFF
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ROCPRIM_INSTALL_DIR}
|
||||
|
||||
INSTALL_DIR ${ROCPRIM_INSTALL_DIR}
|
||||
${EXTERNAL_PROJECT_LOG_ARGS}
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(${ROCPRIM_INCLUDE_DIR})
|
||||
|
||||
if (${CMAKE_VERSION} VERSION_LESS "3.3.0")
|
||||
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/rocprim_dummy.c)
|
||||
file(WRITE ${dummyfile} "const char *dummy_rocprim = \"${dummyfile}\";")
|
||||
add_library(rocprim STATIC ${dummyfile})
|
||||
else()
|
||||
add_library(rocprim INTERFACE)
|
||||
endif()
|
||||
|
||||
add_dependencies(rocprim extern_rocprim)
|
Loading…
Reference in new issue