forked from elemental/Elemental
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support HIP/ROCm backends for GPUs (#101)
* Add hydrogen error handling mechanisms * new cuda management infrastructure * everything in rocm compiles i think. linker issues pending * remove override decoration from Element/BlockMatrix functions * patch for finding rocblas; not sure if this is strictly necessary any more * forward kernel arguments by reference * a few tweaks to the CMakeLists * Make sure ROCm and CUDA aren't enabled at the same time. * correct a discrepancy in hipMemcpy2DAsync semantics * clean up HAVE_CUDA macro usage; streamline copy syntax * use nonblocking stream; clean up the mempool * straggler HAVE_CUDA use in include tree * preprocessor macro cleanup in blaslike tests * Remove debugging print statements * add short-circuit returns to copy/fill routines when size is zero * some cleanup * fix some new rocm issues * update aluminum version number * update version number * remove some unneeded CMake * revert changes related to the hip override bug * add support for hipCUB and generalize cublas tensor option * fix annoying clang warnings (that GCC _should_ throw, too, but it doesn't) * address some review comments * fix use of streams that should have been SyncInfos * Clean up device library functions * cleanup timer nonsense in Gemm test * fix some hipCUB linkage * Apply suggestions from code review Co-authored-by: Tim Moon <moon13@llnl.gov> * Apply suggestions from code review Co-authored-by: Tim Moon <moon13@llnl.gov> * remove unneeded metafunction. DiHydrogen has a cleaner implementation anyway.
- Loading branch information
Showing
179 changed files
with
4,733 additions
and
1,917 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Find rocBLAS library and supporting header | ||
# | ||
# rocBLAS_DIR or ROCBLAS_DIR[in]: The prefix for rocBLAS | ||
# | ||
# ROCBLAS_INCLUDE_PATH[out,cache]: The include path for rocBLAS | ||
# ROCBLAS_LIBRARY[out,cache]: The rocBLAS library | ||
# | ||
# ROCBLAS_LIBRARIES[out]: The thing to link to for rocBLAS | ||
# ROCBLAS_FOUND[out]: Variable indicating whether rocBLAS has been found | ||
# | ||
# rocm::rocblas: Imported library for rocBLAS | ||
# | ||
|
||
find_path(ROCBLAS_INCLUDE_PATH rocblas.h | ||
HINTS ${rocBLAS_DIR} $ENV{rocBLAS_DIR} ${ROCBLAS_DIR} $ENV{ROCBLAS_DIR} | ||
PATH_SUFFIXES include | ||
NO_DEFAULT_PATH | ||
DOC "The rocBLAS include path.") | ||
find_path(ROCBLAS_INCLUDE_PATH rocblas.h) | ||
|
||
find_library(ROCBLAS_LIBRARY rocblas | ||
HINTS ${rocBLAS_DIR} $ENV{rocBLAS_DIR} ${ROCBLAS_DIR} $ENV{ROCBLAS_DIR} | ||
PATH_SUFFIXES lib64 lib | ||
NO_DEFAULT_PATH | ||
DOC "The rocBLAS library.") | ||
find_library(ROCBLAS_LIBRARY rocblas) | ||
|
||
# Standard handling of the package arguments | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Rocblas | ||
REQUIRED_VARS ROCBLAS_LIBRARY ROCBLAS_INCLUDE_PATH) | ||
|
||
if (NOT TARGET rocblas::rocblas) | ||
add_library(rocblas::rocblas INTERFACE IMPORTED) | ||
endif () | ||
|
||
if (ROCBLAS_INCLUDE_PATH AND ROCBLAS_LIBRARY) | ||
set_target_properties(rocblas::rocblas PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES | ||
"${ROCBLAS_INCLUDE_PATH};/opt/rocm/hsa/include;/opt/rocm/hip/include" | ||
INTERFACE_LINK_LIBRARIES "${ROCBLAS_LIBRARY}") | ||
endif () | ||
|
||
set(ROCBLAS_LIBRARIES rocblas::rocblas) | ||
mark_as_advanced(ROCBLAS_INCLUDE_PATH) | ||
mark_as_advanced(ROCBLAS_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.