Skip to content

Commit

Permalink
Backup
Browse files Browse the repository at this point in the history
  • Loading branch information
eeprude committed Oct 14, 2023
1 parent 60db250 commit 209e433
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ jobs:
-DKokkosKernels_INST_OFFSET_SIZE_T=ON \
-DKokkosKernels_ENABLE_TPL_CUSPARSE=OFF \
-DKokkosKernels_ENABLE_TPL_CUBLAS=OFF \
-DKokkosKernels_ENABLE_TPL_CUSOLVER=OFF \
..
- name: build_kokkos_kernels
Expand Down
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ ELSE()
"ALL"
STRING
"A list of components to enable in testing and building"
VALID_ENTRIES BATCHED BLAS LAPACK GRAPH SPARSE ALL
VALID_ENTRIES BATCHED BLAS LAPACK CUSOLVER ROCSOLVER GRAPH SPARSE ALL
)

# ==================================================================
Expand Down Expand Up @@ -242,6 +242,8 @@ ELSE()
MESSAGE(" BATCHED: ${KokkosKernels_ENABLE_COMPONENT_BATCHED}")
MESSAGE(" BLAS: ${KokkosKernels_ENABLE_COMPONENT_BLAS}")
MESSAGE(" LAPACK: ${KokkosKernels_ENABLE_COMPONENT_LAPACK}")
MESSAGE(" CUSOLVER: ${KokkosKernels_ENABLE_COMPONENT_CUSOLVER}")
MESSAGE(" ROCSOLVER: ${KokkosKernels_ENABLE_COMPONENT_ROCSOLVER}")
MESSAGE(" GRAPH: ${KokkosKernels_ENABLE_COMPONENT_GRAPH}")
MESSAGE(" SPARSE: ${KokkosKernels_ENABLE_COMPONENT_SPARSE}")
MESSAGE(" ODE: ${KokkosKernels_ENABLE_COMPONENT_ODE}")
Expand Down Expand Up @@ -289,6 +291,12 @@ ELSE()
IF (KokkosKernels_ENABLE_COMPONENT_LAPACK)
INCLUDE(lapack/CMakeLists.txt)
ENDIF()
IF (KokkosKernels_ENABLE_COMPONENT_CUSOLVER)
INCLUDE(lapack/CMakeLists.txt)
ENDIF()
IF (KokkosKernels_ENABLE_COMPONENT_ROCSOLVER)
INCLUDE(lapack/CMakeLists.txt)
ENDIF()
IF (KokkosKernels_ENABLE_COMPONENT_GRAPH)
INCLUDE(graph/CMakeLists.txt)
ENDIF()
Expand Down Expand Up @@ -371,8 +379,10 @@ ELSE()
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CHOLMOD)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC MKL)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUBLAS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUSOLVER)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC CUSPARSE)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ROCBLAS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ROCSOLVER)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ROCSPARSE)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC METIS)
KOKKOSKERNELS_LINK_TPL(kokkoskernels PUBLIC ARMPL)
Expand Down Expand Up @@ -410,6 +420,12 @@ ELSE()
IF (KokkosKernels_ENABLE_COMPONENT_LAPACK)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(lapack/unit_test)
ENDIF()
IF (KokkosKernels_ENABLE_COMPONENT_CUSOLVER)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(lapack/unit_test)
ENDIF()
IF (KokkosKernels_ENABLE_COMPONENT_ROCSOLVER)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(lapack/unit_test)
ENDIF()
IF (KokkosKernels_ENABLE_COMPONENT_GRAPH)
KOKKOSKERNELS_ADD_TEST_DIRECTORIES(graph/unit_test)
ENDIF()
Expand Down
1 change: 1 addition & 0 deletions batched/KokkosBatched_Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// no experimental name space guard for trilinos
#define __KOKKOSBATCHED_PROMOTION__ 1

#include <iostream>
#include <iomanip>
#include <random>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#ifndef __KOKKOSBATCHED_HOSTLEVEL_GEMM_SERIAL_IMPL_HPP__
#define __KOKKOSBATCHED_HOSTLEVEL_GEMM_SERIAL_IMPL_HPP__
#include "KokkosBatched_Gemm_Decl.hpp"
#include <iostream>

namespace KokkosBatched {
namespace Impl {
Expand Down Expand Up @@ -181,4 +182,4 @@ class BatchedSerialGemm {
};
} // namespace Impl
} // namespace KokkosBatched
#endif
#endif
16 changes: 15 additions & 1 deletion cm_generate_makefile.bash
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ get_kernels_tpls_list() {
KOKKOSKERNELS_USER_TPL_PATH_CMD=
KOKKOSKERNELS_USER_TPL_LIBNAME_CMD=
CUBLAS_DEFAULT=OFF
CUSOLVER_DEFAULT=OFF
CUSPARSE_DEFAULT=OFF
ROCBLAS_DEFAULT=OFF
ROCSOLVER_DEFAULT=OFF
ROCSPARSE_DEFAULT=OFF
PARSE_TPLS_LIST=$(echo $KOKKOSKERNELS_TPLS | tr "," "\n")
for TPLS_ in $PARSE_TPLS_LIST
Expand All @@ -188,12 +190,18 @@ get_kernels_tpls_list() {
if [ "$UC_TPLS" == "CUBLAS" ]; then
CUBLAS_DEFAULT=ON
fi
if [ "$UC_TPLS" == "CUSOLVER" ]; then
CUSOLVER_DEFAULT=ON
fi
if [ "$UC_TPLS" == "CUSPARSE" ]; then
CUSPARSE_DEFAULT=ON
fi
if [ "$UC_TPLS" == "ROCBLAS" ]; then
ROCBLAS_DEFAULT=ON
fi
if [ "$UC_TPLS" == "ROCSOLVER" ]; then
ROCSOLVER_DEFAULT=ON
fi
if [ "$UC_TPLS" == "ROCSPARSE" ]; then
ROCSPARSE_DEFAULT=ON
fi
Expand Down Expand Up @@ -221,12 +229,18 @@ get_kernels_tpls_list() {
if [ "$CUBLAS_DEFAULT" == "OFF" ]; then
KOKKOSKERNELS_TPLS_CMD="-DKokkosKernels_ENABLE_TPL_CUBLAS=OFF ${KOKKOSKERNELS_TPLS_CMD}"
fi
if [ "$CUSOLVER_DEFAULT" == "OFF" ]; then
KOKKOSKERNELS_TPLS_CMD="-DKokkosKernels_ENABLE_TPL_CUSOLVER=OFF ${KOKKOSKERNELS_TPLS_CMD}"
fi
if [ "$CUSPARSE_DEFAULT" == "OFF" ]; then
KOKKOSKERNELS_TPLS_CMD="-DKokkosKernels_ENABLE_TPL_CUSPARSE=OFF ${KOKKOSKERNELS_TPLS_CMD}"
fi
if [ "$ROCBLAS_DEFAULT" == "OFF" ]; then
KOKKOSKERNELS_TPLS_CMD="-DKokkosKernels_ENABLE_TPL_ROCBLAS=OFF ${KOKKOSKERNELS_TPLS_CMD}"
fi
if [ "$ROCSOLVER_DEFAULT" == "OFF" ]; then
KOKKOSKERNELS_TPLS_CMD="-DKokkosKernels_ENABLE_TPL_ROCSOLVER=OFF ${KOKKOSKERNELS_TPLS_CMD}"
fi
if [ "$ROCSPARSE_DEFAULT" == "OFF" ]; then
KOKKOSKERNELS_TPLS_CMD="-DKokkosKernels_ENABLE_TPL_ROCSPARSE=OFF ${KOKKOSKERNELS_TPLS_CMD}"
fi
Expand Down Expand Up @@ -345,7 +359,7 @@ display_help_text() {
echo "--with-tpls=[TPLS]: Set tpls to be instantiated (Proper support requies that appropriate compiler and device must be enabled)."
echo " This may require providing paths and the library name if using custom installs not on a default path"
echo " that CMake searches"
echo " Options: blas, mkl, cublas, cusparse, magma, armpl, rocblas, rocsparse"
echo " Options: blas, mkl, cublas, cusolver, cusparse, magma, armpl, rocblas, rocsolver, rocsparse"
echo "--user-blas-path=[PATH]: Set path to location of user-specified BLAS library."
echo "--user-blas-lib=[LIB]: Library name of desired BLAS install."
echo " Example: For the typical \"libblas.a\" provide \"blas\""
Expand Down
4 changes: 4 additions & 0 deletions cmake/KokkosKernels_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_CUSPARSE
/* CUBLAS */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_CUBLAS
/* CUSOLVER */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_CUSOLVER
/* MAGMA */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_MAGMA
/* SuperLU */
Expand All @@ -135,6 +137,8 @@
#cmakedefine ARMPL_BUILD @ARMPL_BUILD@
/* ROCBLAS */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_ROCBLAS
/* ROCSOLVER */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_ROCSOLVER
/* ROCSPARSE */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_ROCSPARSE

Expand Down
18 changes: 18 additions & 0 deletions cmake/Modules/FindTPLCUSOLVER.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FIND_PACKAGE(CUDA)

INCLUDE(FindPackageHandleStandardArgs)
IF (NOT CUDA_FOUND)
#Important note here: this find Module is named TPLCUSOLVER
#The eventual target is named CUSOLVER. To avoid naming conflicts
#the find module is called TPLCUSOLVER. This call will cause
#the find_package call to fail in a "standard" CMake way
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TPLCUSOLVER REQUIRED_VARS CUDA_FOUND)
ELSE()
#The libraries might be empty - OR they might explicitly be not found
IF("${CUDA_CUSOLVER_LIBRARIES}" MATCHES "NOTFOUND")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TPLCUSOLVER REQUIRED_VARS CUDA_CUSOLVER_LIBRARIES)
ELSE()
KOKKOSKERNELS_CREATE_IMPORTED_TPL(CUSOLVER INTERFACE
LINK_LIBRARIES "${CUDA_CUSOLVER_LIBRARIES}")
ENDIF()
ENDIF()
12 changes: 12 additions & 0 deletions cmake/Modules/FindTPLROCSOLVER.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FIND_PACKAGE(ROCSOLVER)
if(TARGET roc::rocsolver)
## MPL: 12/29/2022: Variable TPL_ROCSOLVER_IMPORTED_NAME follows the requested convention
## of KokkosKernel (method kokkoskernels_import_tpl of kokkoskernels_tpls.cmake)
SET(TPL_ROCSOLVER_IMPORTED_NAME roc::rocsolver)
SET(TPL_IMPORTED_NAME roc::rocsolver)
## MPL: 12/29/2022: A target comming from a TPL must follows the requested convention
## of KokkosKernel (method kokkoskernels_link_tpl of kokkoskernels_tpls.cmake)
ADD_LIBRARY(KokkosKernels::ROCSOLVER ALIAS roc::rocsolver)
ELSE()
MESSAGE(FATAL_ERROR "Package ROCSOLVER requested but not found")
ENDIF()
10 changes: 10 additions & 0 deletions cmake/kokkoskernels_tpls.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -456,27 +456,35 @@ ENDIF()

KOKKOSKERNELS_ADD_OPTION(NO_DEFAULT_CUDA_TPLS OFF BOOL "Whether CUDA TPLs should be enabled by default. Default: OFF")
SET(CUBLAS_DEFAULT ${KOKKOS_ENABLE_CUDA})
SET(CUSOLVER_DEFAULT ${KOKKOS_ENABLE_CUDA})
SET(CUSPARSE_DEFAULT ${KOKKOS_ENABLE_CUDA})
IF(KOKKOSKERNELS_NO_DEFAULT_CUDA_TPLS)
SET(CUBLAS_DEFAULT OFF)
SET(CUSOLVER_DEFAULT OFF)
SET(CUSPARSE_DEFAULT OFF)
ENDIF()
KOKKOSKERNELS_ADD_TPL_OPTION(CUBLAS ${CUBLAS_DEFAULT} "Whether to enable CUBLAS"
DEFAULT_DOCSTRING "ON if CUDA-enabled Kokkos, otherwise OFF")
KOKKOSKERNELS_ADD_TPL_OPTION(CUSOLVER ${CUSOLVER_DEFAULT} "Whether to enable CUSOLVER"
DEFAULT_DOCSTRING "ON if CUDA-enabled Kokkos, otherwise OFF")
KOKKOSKERNELS_ADD_TPL_OPTION(CUSPARSE ${CUSPARSE_DEFAULT} "Whether to enable CUSPARSE"
DEFAULT_DOCSTRING "ON if CUDA-enabled Kokkos, otherwise OFF")

KOKKOSKERNELS_ADD_OPTION(NO_DEFAULT_ROCM_TPLS OFF BOOL "Whether ROCM TPLs should be enabled by default. Default: OFF")
# Unlike CUDA, ROCm does not automatically install these TPLs
SET(ROCBLAS_DEFAULT OFF)
SET(ROCSOLVER_DEFAULT OFF)
SET(ROCSPARSE_DEFAULT OFF)
# Since the default is OFF we do not really need this piece of logic here.
# IF(KOKKOSKERNELS_NO_DEFAULT_ROCM_TPLS)
# SET(ROCBLAS_DEFAULT OFF)
# SET(ROCSOLVER_DEFAULT OFF)
# SET(ROCSPARSE_DEFAULT OFF)
# ENDIF()
KOKKOSKERNELS_ADD_TPL_OPTION(ROCBLAS ${ROCBLAS_DEFAULT} "Whether to enable ROCBLAS"
DEFAULT_DOCSTRING "ON if HIP-enabled Kokkos, otherwise OFF")
KOKKOSKERNELS_ADD_TPL_OPTION(ROCSOLVER ${ROCSOLVER_DEFAULT} "Whether to enable ROCSOLVER"
DEFAULT_DOCSTRING "ON if HIP-enabled Kokkos, otherwise OFF")
KOKKOSKERNELS_ADD_TPL_OPTION(ROCSPARSE ${ROCSPARSE_DEFAULT} "Whether to enable ROCSPARSE"
DEFAULT_DOCSTRING "ON if HIP-enabled Kokkos, otherwise OFF")

Expand Down Expand Up @@ -508,6 +516,7 @@ IF (NOT KOKKOSKERNELS_HAS_TRILINOS)
KOKKOSKERNELS_IMPORT_TPL(LAPACK)
KOKKOSKERNELS_IMPORT_TPL(MKL)
KOKKOSKERNELS_IMPORT_TPL(CUBLAS)
KOKKOSKERNELS_IMPORT_TPL(CUSOLVER)
KOKKOSKERNELS_IMPORT_TPL(CUSPARSE)
KOKKOSKERNELS_IMPORT_TPL(CBLAS)
KOKKOSKERNELS_IMPORT_TPL(LAPACKE)
Expand All @@ -517,6 +526,7 @@ IF (NOT KOKKOSKERNELS_HAS_TRILINOS)
KOKKOSKERNELS_IMPORT_TPL(ARMPL)
KOKKOSKERNELS_IMPORT_TPL(MAGMA)
KOKKOSKERNELS_IMPORT_TPL(ROCBLAS)
KOKKOSKERNELS_IMPORT_TPL(ROCSOLVER)
KOKKOSKERNELS_IMPORT_TPL(ROCSPARSE)
ELSE ()
IF (Trilinos_ENABLE_SuperLU5_API)
Expand Down
2 changes: 1 addition & 1 deletion example/half/xpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ int main(int argc, char **argv) {
do_xpy<Kokkos::Experimental::bhalf_t, DeviceType, LayoutType>(n, time_only);
Kokkos::finalize();
return 0;
}
}
12 changes: 6 additions & 6 deletions lapack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ LIST(APPEND KK_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/lapack/tpls)
KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/lapack)
KOKKOSKERNELS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/lapack)

#######################
# #
#########################
# #
# Logic for LAPACK TPLs #
# #
#######################
# #
#########################

#Include LAPACK, Lapack host wrapper
IF (KOKKOSKERNELS_ENABLE_TPL_LAPACK OR KOKKOSKERNELS_ENABLE_TPL_MKL OR KOKKOSKERNELS_ENABLE_TPL_ARMPL)
Expand All @@ -28,14 +28,14 @@ IF (KOKKOSKERNELS_ENABLE_TPL_LAPACK OR KOKKOSKERNELS_ENABLE_TPL_MKL OR KOKKOSKER
ENDIF()

# Include cuda lapack TPL source file
IF (KOKKOSKERNELS_ENABLE_TPL_CULAPACK)
IF (KOKKOSKERNELS_ENABLE_TPL_CUSOLVER)
LIST(APPEND SOURCES
lapack/tpls/KokkosLapack_Cuda_tpl.cpp
)
ENDIF()

# Include rocm lapack TPL source file
IF (KOKKOSKERNELS_ENABLE_TPL_ROCLAPACK)
IF (KOKKOSKERNELS_ENABLE_TPL_ROCSOLVER)
LIST(APPEND SOURCES
lapack/tpls/KokkosLapack_Rocm_tpl.cpp
)
Expand Down

0 comments on commit 209e433

Please sign in to comment.