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

Add BsrMatrix spmv and a BlockCrsMatrix spmv. #1240

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5623619
BuildSystem: update PTHREAD to THREADS
ndellingwood Dec 17, 2021
531d7e2
Add BsrMatrix spmv and a naive BlockCrsMatrix spmv.
uhetmaniuk Dec 21, 2021
dcbaa10
Improve the Mat-Vec without transpose for BlockCrsMatrix.
uhetmaniuk Dec 21, 2021
2f3a63d
Improve Mat-MultiVec for BlockCrsMatrix withoout Transpose
uhetmaniuk Dec 21, 2021
946b8d6
Improve BlockCrsMatrix product with transpose
uhetmaniuk Dec 22, 2021
da5d369
Remove cout statements.
uhetmaniuk Dec 29, 2021
3fa7a01
Reformating
uhetmaniuk Dec 29, 2021
2ccada1
Adjust size parameters for hierarchical parallelism.
uhetmaniuk Dec 30, 2021
d275b95
Fix compilation issues.
uhetmaniuk Jan 5, 2022
5a6267e
Fix unused parameter
uhetmaniuk Jan 5, 2022
3dafa52
Update cmake/kokkos_backends.cmake
lucbv Jan 5, 2022
0eb5824
Fix typos with MKL
uhetmaniuk Jan 6, 2022
eda2cc4
Kokkos synch up: update build system and remove macro usage
lucbv Jan 6, 2022
c5e66ab
Applying clang-format to modified source files
lucbv Jan 6, 2022
5b03d8c
Run clang-format 10 instead of clang-format 13...
lucbv Jan 6, 2022
2375c88
Fix switching issues.
uhetmaniuk Jan 6, 2022
af0b051
Fix typo
uhetmaniuk Jan 6, 2022
056443b
Merge pull request #1249 from lucbv/CI_fixing
lucbv Jan 6, 2022
a0ac0db
Add BsrMatrix spmv and a naive BlockCrsMatrix spmv.
uhetmaniuk Dec 21, 2021
a62e63d
Improve the Mat-Vec without transpose for BlockCrsMatrix.
uhetmaniuk Dec 21, 2021
0175b87
Improve Mat-MultiVec for BlockCrsMatrix withoout Transpose
uhetmaniuk Dec 21, 2021
d30e65b
Improve BlockCrsMatrix product with transpose
uhetmaniuk Dec 22, 2021
285f1d2
Remove cout statements.
uhetmaniuk Dec 29, 2021
dc5810a
Reformating
uhetmaniuk Dec 29, 2021
f787b96
Adjust size parameters for hierarchical parallelism.
uhetmaniuk Dec 30, 2021
3455365
Fix compilation issues.
uhetmaniuk Jan 5, 2022
67edf7e
Fix unused parameter
uhetmaniuk Jan 5, 2022
b67eed5
Fix typos with MKL
uhetmaniuk Jan 6, 2022
3b0fe4e
Fix switching issues.
uhetmaniuk Jan 6, 2022
4fb9d75
Fix typo
uhetmaniuk Jan 6, 2022
8b06dd8
Merge branch 'rebased_spmv_bsr' of github.com:NexGenAnalytics/kokkos-…
uhetmaniuk Jan 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion cmake/kokkos_backends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ MACRO(CHECK_KOKKOS_BACKEND BE)
ENDMACRO(CHECK_KOKKOS_BACKEND)

CHECK_KOKKOS_BACKEND(SERIAL)
CHECK_KOKKOS_BACKEND(PTHREAD)
CHECK_KOKKOS_BACKEND(THREADS)
CHECK_KOKKOS_BACKEND(OPENMP)
CHECK_KOKKOS_BACKEND(OPENMPTARGET)
CHECK_KOKKOS_BACKEND(CUDA)
CHECK_KOKKOS_BACKEND(HIP)
CHECK_KOKKOS_BACKEND(SYCL)

# for backward compatibility. can be dropped when requiring Kokkos 3.6
IF (Kokkos_ENABLE_PTHREAD)
SET(KOKKOS_ENABLE_THREADS ON)
SET(KOKKOSKERNELS_INST_EXECSPACE_THREADS_DEFAULT ON)
ENDIF()
18 changes: 9 additions & 9 deletions cmake/kokkoskernels_eti_devices.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ SET(EXEC_SPACES
EXECSPACE_SYCL
EXECSPACE_OPENMPTARGET
EXECSPACE_OPENMP
EXECSPACE_PTHREAD
EXECSPACE_THREADS
EXECSPACE_SERIAL
)
SET(EXECSPACE_CUDA_CPP_TYPE Kokkos::Cuda)
SET(EXECSPACE_HIP_CPP_TYPE Kokkos::Experimental::HIP)
SET(EXECSPACE_SYCL_CPP_TYPE Kokkos::Experimental::SYCL)
SET(EXECSPACE_OPENMPTARGET_CPP_TYPE Kokkos::Experimental::OpenMPTarget)
SET(EXECSPACE_OPENMP_CPP_TYPE Kokkos::OpenMP)
SET(EXECSPACE_PTHREAD_CPP_TYPE Kokkos::Threads)
SET(EXECSPACE_THREADS_CPP_TYPE Kokkos::Threads)
SET(EXECSPACE_SERIAL_CPP_TYPE Kokkos::Serial)

SET(MEM_SPACES
Expand Down Expand Up @@ -174,17 +174,17 @@ ENDIF()

KOKKOSKERNELS_ADD_OPTION(
INST_EXECSPACE_THREADS
${KOKKOSKERNELS_INST_EXECSPACE_PTHREAD_DEFAULT}
${KOKKOSKERNELS_INST_EXECSPACE_THREADS_DEFAULT}
BOOL
"Whether to build kernels for the execution space Kokkos::Threads. If explicit template instantiation (ETI) is enabled in Trilinos, disabling this when Kokkos_ENABLE_PTHREAD is enabled may increase build times. Default: ON if Kokkos is Threads-enabled, OFF otherwise."
"Whether to build kernels for the execution space Kokkos::Threads. If explicit template instantiation (ETI) is enabled in Trilinos, disabling this when Kokkos_ENABLE_THREADS is enabled may increase build times. Default: ON if Kokkos is Threads-enabled, OFF otherwise."
)
#There continues to be name ambiguity with threads vs pthreads
SET(KOKKOSKERNELS_INST_EXECSPACE_PTHREAD ${KOKKOSKERNELS_INST_EXECSPACE_THREADS})
SET(KOKKOSKERNELS_INST_EXECSPACE_THREADS ${KOKKOSKERNELS_INST_EXECSPACE_THREADS})

IF(KOKKOSKERNELS_INST_EXECSPACE_PTHREAD AND KOKKOSKERNELS_INST_MEMSPACE_HOSTSPACE)
IF(KOKKOSKERNELS_INST_EXECSPACE_THREADS AND KOKKOSKERNELS_INST_MEMSPACE_HOSTSPACE)
LIST(APPEND DEVICE_LIST "<Threads,HostSpace>")
IF(NOT KOKKOS_ENABLE_PTHREAD)
MESSAGE(FATAL_ERROR "Set ETI on for PTHREAD, but Kokkos was not configured with the PTHREAD backend")
IF(NOT KOKKOS_ENABLE_THREADS)
MESSAGE(FATAL_ERROR "Set ETI on for THREADS, but Kokkos was not configured with the THREADS backend")
ENDIF()
ENDIF()

Expand All @@ -201,7 +201,7 @@ SET(EXECSPACE_SYCL_VALID_MEM_SPACES SYCLSPACE SYCLSHAREDSPACE)
SET(EXECSPACE_OPENMPTARGET_VALID_MEM_SPACES OPENMPTARGETSPACE)
SET(EXECSPACE_SERIAL_VALID_MEM_SPACES HBWSPACE HOSTSPACE)
SET(EXECSPACE_OPENMP_VALID_MEM_SPACES HBWSPACE HOSTSPACE)
SET(EXECSPACE_PTHREAD_VALID_MEM_SPACES HBWSPACE HOSTSPACE)
SET(EXECSPACE_THREADS_VALID_MEM_SPACES HBWSPACE HOSTSPACE)
SET(DEVICES)
FOREACH(EXEC ${EXEC_SPACES})
IF (KOKKOSKERNELS_INST_${EXEC})
Expand Down
132 changes: 71 additions & 61 deletions perf_test/sparse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,98 +2,108 @@ KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_pcg
SOURCES KokkosSparse_pcg.cpp
)
sparse_pcg
SOURCES KokkosSparse_pcg.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_block_pcg
SOURCES KokkosSparse_block_pcg.cpp
)
sparse_block_pcg
SOURCES KokkosSparse_block_pcg.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spgemm
SOURCES KokkosSparse_spgemm.cpp
)
sparse_spgemm
SOURCES KokkosSparse_spgemm.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spgemm_jacobi
SOURCES KokkosSparse_spgemm_jacobi.cpp
)
sparse_spgemm_jacobi
SOURCES KokkosSparse_spgemm_jacobi.cpp
)

KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/spmv)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spadd
SOURCES KokkosSparse_spadd.cpp
)
sparse_spadd
SOURCES KokkosSparse_spadd.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spmv_struct
SOURCES KokkosSparse_spmv_struct.cpp
)
sparse_spmv_struct
SOURCES KokkosSparse_spmv_struct.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spmv_struct_tuning
SOURCES KokkosSparse_spmv_struct_tuning.cpp
)
sparse_spmv_struct_tuning
SOURCES KokkosSparse_spmv_struct_tuning.cpp
)


set(utilities_list)

IF(KokkosKernels_ENABLE_TESTS_AND_PERFSUITE)
LIST(APPEND utilities_list ../PerfTestUtilities.cpp)
ENDIF()
IF (KokkosKernels_ENABLE_TESTS_AND_PERFSUITE)
LIST(APPEND utilities_list ../PerfTestUtilities.cpp)
ENDIF ()

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spmv
SOURCES KokkosSparse_spmv.cpp KokkosSparse_spmv_test.cpp spmv/OpenMPSmartStatic_SPMV.cpp
${utilities_list}
)
sparse_spmv
SOURCES KokkosSparse_spmv.cpp KokkosSparse_spmv_test.cpp spmv/OpenMPSmartStatic_SPMV.cpp
${utilities_list}
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_kk_spmv
SOURCES KokkosSparse_kk_spmv.cpp
)

IF(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE)
KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spmv_merge
SOURCES KokkosSparse_spmv_merge.cpp
sparse_kk_spmv
SOURCES KokkosSparse_kk_spmv.cpp
)

IF (KOKKOSKERNELS_ENABLE_TPL_CUSPARSE)
KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spmv_merge
SOURCES KokkosSparse_spmv_merge.cpp
)
ENDIF()
ENDIF ()

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_sptrsv
SOURCES KokkosSparse_sptrsv.cpp
)
sparse_spmv_blockcrs
SOURCES KokkosSparse_spmv_blockcrs.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_sptrsv_cholmod
SOURCES KokkosSparse_sptrsv_cholmod.cpp
)
sparse_spmv_bsr
SOURCES KokkosSparse_spmv_bsr.cpp
)

IF(NOT ${KOKKOS_HAS_TRILINOS})
# Disable this perf test with Trilinos builds to workaround
# -Werror issues error: declaration of xyz with C language linkage
KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_sptrsv_superlu
SOURCES KokkosSparse_sptrsv_superlu.cpp
)
ENDIF()
sparse_sptrsv
SOURCES KokkosSparse_sptrsv.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_sptrsv_cholmod
SOURCES KokkosSparse_sptrsv_cholmod.cpp
)

IF (NOT ${KOKKOS_HAS_TRILINOS})
# Disable this perf test with Trilinos builds to workaround
# -Werror issues error: declaration of xyz with C language linkage
KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_sptrsv_superlu
SOURCES KokkosSparse_sptrsv_superlu.cpp
)
ENDIF ()

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_sptrsv_supernode
SOURCES KokkosSparse_sptrsv_supernode.cpp
)
sparse_sptrsv_supernode
SOURCES KokkosSparse_sptrsv_supernode.cpp
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_gs
SOURCES KokkosSparse_gs.cpp
TESTONLYLIBS kokkoskernelsperf_gtest
)
sparse_gs
SOURCES KokkosSparse_gs.cpp
TESTONLYLIBS kokkoskernelsperf_gtest
)

KOKKOSKERNELS_ADD_EXECUTABLE(
sparse_spiluk
SOURCES KokkosSparse_spiluk.cpp
)
sparse_spiluk
SOURCES KokkosSparse_spiluk.cpp
)
Loading