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

Restore size_t as default offset, in Tribits builds #2313

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all 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
18 changes: 14 additions & 4 deletions 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
Loading