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

Kokkos sync-up #1249

Merged
merged 5 commits into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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)
dalg24 marked this conversation as resolved.
Show resolved Hide resolved
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
12 changes: 6 additions & 6 deletions src/batched/dense/impl/KokkosBatched_Axpy_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ KOKKOS_INLINE_FUNCTION int SerialAxpy::invoke(const alphaViewType& alpha,

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::axpy: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::axpy: First dimension of X and alpha do not match: X: "
"%d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
Expand Down Expand Up @@ -270,14 +270,14 @@ KOKKOS_INLINE_FUNCTION int TeamAxpy<MemberType>::invoke(

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::axpy: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::axpy: First dimension of X and alpha do not match: X: "
"%d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
Expand Down Expand Up @@ -318,14 +318,14 @@ KOKKOS_INLINE_FUNCTION int TeamVectorAxpy<MemberType>::invoke(

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::axpy: Dimensions of X and Y do not match: X: %d x %d, "
"Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0), (int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::axpy: First dimension of X and alpha do not match: X: "
"%d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
Expand Down
4 changes: 2 additions & 2 deletions src/batched/sparse/KokkosBatched_JacobiPrec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class JacobiPrec {
}

if (tooSmall > 0)
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::JacobiPrec: %d entrie(s) has/have a too small "
"magnitude and have been replaced by one, \n",
(int)tooSmall);
Expand All @@ -153,4 +153,4 @@ class JacobiPrec {

} // namespace KokkosBatched

#endif
#endif
12 changes: 6 additions & 6 deletions src/batched/sparse/impl/KokkosBatched_Spmv_Serial_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,37 +179,37 @@ struct SerialSpmv<Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimensions of X and Y do not match: X: %d x "
"%d, Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and alpha do not match: "
"X: %d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
return 1;
}
if (X.extent(0) != beta.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and beta do not match: X: "
"%d x %d, beta: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)beta.extent(0));
return 1;
}
if (X.extent(0) != values.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and the first dimension "
"of values do not match: X: %d x %d, values: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)values.extent(0),
(int)values.extent(1));
return 1;
}
if (colIndices.extent(0) != values.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimension of colIndices and the second "
"dimension of values do not match: colIndices: %d , values: %d x "
"%d\n",
Expand All @@ -218,7 +218,7 @@ struct SerialSpmv<Trans::NoTranspose> {
return 1;
}
if (row_ptr.extent(0) - 1 != X.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimension of row_ptr and the second dimension "
"of X do not match: colIndices (-1): %d , values: %d x %d\n",
(int)row_ptr.extent(0) - 1, (int)X.extent(0), (int)X.extent(1));
Expand Down
12 changes: 6 additions & 6 deletions src/batched/sparse/impl/KokkosBatched_Spmv_TeamVector_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,37 +221,37 @@ struct TeamVectorSpmv<MemberType, Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimensions of X and Y do not match: X: %d x "
"%d, Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and alpha do not match: "
"X: %d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
return 1;
}
if (X.extent(0) != beta.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and beta do not match: X: "
"%d x %d, beta: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)beta.extent(0));
return 1;
}
if (X.extent(0) != values.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and the first dimension "
"of values do not match: X: %d x %d, values: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)values.extent(0),
(int)values.extent(1));
return 1;
}
if (colIndices.extent(0) != values.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimension of colIndices and the second "
"dimension of values do not match: colIndices: %d , values: %d x "
"%d\n",
Expand All @@ -260,7 +260,7 @@ struct TeamVectorSpmv<MemberType, Trans::NoTranspose> {
return 1;
}
if (row_ptr.extent(0) - 1 != X.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimension of row_ptr and the second dimension "
"of X do not match: colIndices (-1): %d , values: %d x %d\n",
(int)row_ptr.extent(0) - 1, (int)X.extent(0), (int)X.extent(1));
Expand Down
12 changes: 6 additions & 6 deletions src/batched/sparse/impl/KokkosBatched_Spmv_Team_Impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,37 +217,37 @@ struct TeamSpmv<MemberType, Trans::NoTranspose> {

// Check compatibility of dimensions at run time.
if (X.extent(0) != Y.extent(0) || X.extent(1) != Y.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimensions of X and Y do not match: X: %d x "
"%d, Y: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)Y.extent(0),
(int)Y.extent(1));
return 1;
}
if (X.extent(0) != alpha.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and alpha do not match: "
"X: %d x %d, alpha: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)alpha.extent(0));
return 1;
}
if (X.extent(0) != beta.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and beta do not match: X: "
"%d x %d, beta: %d\n",
(int)X.extent(0), (int)X.extent(1), (int)beta.extent(0));
return 1;
}
if (X.extent(0) != values.extent(0)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: First dimension of X and the first dimension "
"of values do not match: X: %d x %d, values: %d x %d\n",
(int)X.extent(0), (int)X.extent(1), (int)values.extent(0),
(int)values.extent(1));
return 1;
}
if (colIndices.extent(0) != values.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimension of colIndices and the second "
"dimension of values do not match: colIndices: %d , values: %d x "
"%d\n",
Expand All @@ -256,7 +256,7 @@ struct TeamSpmv<MemberType, Trans::NoTranspose> {
return 1;
}
if (row_ptr.extent(0) - 1 != X.extent(1)) {
KOKKOS_IMPL_DO_NOT_USE_PRINTF(
printf(
"KokkosBatched::spmv: Dimension of row_ptr and the second dimension "
"of X do not match: colIndices (-1): %d , values: %d x %d\n",
(int)row_ptr.extent(0) - 1, (int)X.extent(0), (int)X.extent(1));
Expand Down
2 changes: 1 addition & 1 deletion unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ IF (KOKKOS_ENABLE_SERIAL)
)
ENDIF ()

IF (KOKKOS_ENABLE_PTHREAD)
IF (KOKKOS_ENABLE_THREADS)
KOKKOSKERNELS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/threads)
KOKKOSKERNELS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/threads)

Expand Down
Loading