Skip to content

Commit

Permalink
KokkosKernels: restore size_t as default offset in Tribits builds
Browse files Browse the repository at this point in the history
Partially revert the change in 4.4.0 release that made int the default offset
type instead of size_t. This restores size_t as the default for
Trilinos/Tribits builds only.

This is the same patch as KK 2313.
  • Loading branch information
brian-kelley committed Aug 20, 2024
1 parent ada2829 commit ab7159b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/kokkos-kernels/cmake/kokkoskernels_eti_offsets.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
SET(KOKKOSKERNELS_INST_OFFSET_SIZE_T_DEFAULT OFF)
SET(KOKKOSKERNELS_INST_OFFSET_INT_DEFAULT ${KOKKOSKERNELS_ADD_DEFAULT_ETI})
IF(KOKKOSKERNELS_HAS_TRILINOS)
# In a Trilinos build, size_t is the default offset because this is what Tpetra uses
# TODO: update this when Tpetra can use different offsets
SET(KOKKOSKERNELS_INST_OFFSET_SIZE_T_DEFAULT ${KOKKOSKERNELS_ADD_DEFAULT_ETI})
SET(KOKKOSKERNELS_INST_OFFSET_INT_DEFAULT OFF)
ELSE()
# But in a standalone KokkosKernels build, int is the default offset type
# This provides the maximum TPL compatibility
SET(KOKKOSKERNELS_INST_OFFSET_SIZE_T_DEFAULT OFF)
SET(KOKKOSKERNELS_INST_OFFSET_INT_DEFAULT ${KOKKOSKERNELS_ADD_DEFAULT_ETI})
ENDIF()

SET(OFFSETS
OFFSET_INT
OFFSET_SIZE_T
Expand All @@ -12,14 +22,14 @@ KOKKOSKERNELS_ADD_OPTION(
INST_OFFSET_INT
${KOKKOSKERNELS_INST_OFFSET_INT_DEFAULT}
BOOL
"Whether to pre instantiate kernels for the offset type int. This option is KokkosKernels_INST_OFFSET_INT=OFF by default. Default: OFF"
"Whether to pre instantiate kernels for the offset type int. This option is KokkosKernels_INST_OFFSET_INT=OFF by default. Default: ${KOKKOSKERNELS_INST_OFFSET_INT_DEFAULT}"
)

KOKKOSKERNELS_ADD_OPTION(
INST_OFFSET_SIZE_T
${KOKKOSKERNELS_INST_OFFSET_SIZE_T_DEFAULT}
BOOL
"Whether to pre instantiate kernels for the offset type size_t. This option is KokkosKernels_INST_OFFSET_SIZE_T=ON by default. Default: ON"
"Whether to pre instantiate kernels for the offset type size_t. This option is KokkosKernels_INST_OFFSET_SIZE_T=ON by default. Default: ${KOKKOSKERNELS_INST_OFFSET_SIZE_T_DEFAULT}"
)

IF (KOKKOSKERNELS_INST_OFFSET_INT)
Expand Down

0 comments on commit ab7159b

Please sign in to comment.