Skip to content

Commit

Permalink
adjustments for hip targets (#987)
Browse files Browse the repository at this point in the history
* working on hip fixes

* export blt builtin targets

* interesting facts

* the right name should make things easier

* export target fixes

* order

* again, skip using with cmake until we tpls have updates that will allow us to enable it
  • Loading branch information
cyrush committed Aug 13, 2022
1 parent 6a42e5f commit 509b2aa
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 20 deletions.
25 changes: 14 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ stages:
CMAKE_EXE: /cmake-3.23.2-linux-x86_64/bin/cmake
strategy:
matrix:
ubuntu_20.04_rocm_cuda_5.1.3:
ubuntu_20.04_rocm_5.1.3:
containerImage: ${{ variables.ubuntu_20_04_rocm_5_1_3_tag }}
BUILD_SHARED_LIBS: ON
CMAKE_BUILD_TYPE: Release
Expand Down Expand Up @@ -586,16 +586,17 @@ stages:
${CMAKE_EXE} --install build
displayName: 'Install'
# Skipping until we solve cmake mystery (find_packaged not called?)
# - script: |
# ###########################
# # using with cmake example
# ###########################
# pwd
# ls -l
# cd install/examples/ascent/using-with-cmake
# ${CMAKE_EXE} . -B build
# ${CMAKE_EXE} --build build
# ###########################
# # using with cmake example
# ###########################
# pwd
# ls -l
# export CC=/opt/rocm/llvm/bin/amdclang
# export CXX=/opt/rocm/llvm/bin/amdclang++
# cd install/examples/ascent/using-with-cmake
# ${CMAKE_EXE} . -B build
# ${CMAKE_EXE} --build build
# displayName: 'Test vs Install (using-with-cmake) [build only]'

- script: |
Expand All @@ -605,6 +606,8 @@ stages:
cat install/share/ascent/ascent_config.mk
pwd
ls -l
export CC=/opt/rocm/llvm/bin/amdclang
export CXX=/opt/rocm/llvm/bin/amdclang++
cd install/examples/ascent/using-with-make
env CC=/opt/rocm/llvm/bin/amdclang CXX=/opt/rocm/llvm/bin/amdclang++ make
make
displayName: 'Test vs Install (using-with-make) [build only]'
1 change: 0 additions & 1 deletion src/cmake/Setup3rdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,3 @@ endif()
if (GENTEN_DIR)
include(cmake/thirdparty/SetupGenTen.cmake)
endif()

2 changes: 1 addition & 1 deletion src/cmake/SetupBLT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ set(BLT_TPL_DEPS_EXPORTS)
blt_list_append(TO BLT_TPL_DEPS_EXPORTS ELEMENTS cuda cuda_runtime IF ENABLE_CUDA)
blt_list_append(TO BLT_TPL_DEPS_EXPORTS ELEMENTS blt_hip blt_hip_runtime IF ENABLE_HIP)

if(ENABLE_MPI AND NOT ASCENT_USE_CMAKE_MPI_TARGETS)
if(ENABLE_MPI AND ENABLE_FIND_MPI AND NOT ASCENT_USE_CMAKE_MPI_TARGETS)
list(APPEND BLT_TPL_DEPS_EXPORTS mpi)
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/config/AscentConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if(NOT ASCENT_FOUND)
set(ASCENT_UMPIRE_DIR "@UMPIRE_DIR@")

# advertise if camp support is enabled
set(ASCENT_CAMP_ENABLED @UMPIRE_FOUND@)
set(ASCENT_CAMP_ENABLED @CAMP_FOUND@)
set(ASCENT_CAMP_DIR "@CAMP_DIR@")

##################################################
Expand Down
26 changes: 20 additions & 6 deletions src/config/ascent_setup_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,26 @@ if(ASCENT_OPENMP_ENABLED)
endif()
endif()

###############################################################################
# HIP related tpls will require targets from hip
###############################################################################
if(ASCENT_HIP_ENABLED)
####################################
# IMPORANT NOTE AND FUN CMAKE FACT:
####################################
# The HIP CMake Pacakge *requires* ROCM_PATH to be set.
#
# If not set, it won't find other reqd cmake imports (like AMDDeviceLibs)
#
# You *cannot* just hand the path as an arg like ${ASCENT_ROCM_PATH}
# to find_package, ROCM_PATH must be set.
#
if(NOT ROCM_PATH)
set(ROCM_PATH ${ASCENT_ROCM_PATH})
endif()
find_package(hip REQUIRED CONFIG PATHS ${ROCM_PATH})
endif()

###############################################################################
# Setup Conduit
###############################################################################
Expand Down Expand Up @@ -115,12 +135,6 @@ if(VTKM_DIR)
PATHS ${VTKM_DIR})
endif()

###############################################################################
# HIP + Raja related tpls will require targets from hip
###############################################################################
if(ASCENT_HIP_ENABLED AND ASCENT_UMPIRE_ENABLED)
find_package(hip REQUIRED CONFIG PATHS ${ASCENT_ROCM_PATH})
endif()

###############################################################################
# Setup Camp
Expand Down

0 comments on commit 509b2aa

Please sign in to comment.