summaryrefslogtreecommitdiff
path: root/dev-cpp/kokkos
diff options
context:
space:
mode:
Diffstat (limited to 'dev-cpp/kokkos')
-rw-r--r--dev-cpp/kokkos/Manifest5
-rw-r--r--dev-cpp/kokkos/kokkos-4.3.1-r1.ebuild56
-rw-r--r--dev-cpp/kokkos/kokkos-4.6.2-r2.ebuild114
-rw-r--r--dev-cpp/kokkos/kokkos-4.7.4.ebuild114
-rw-r--r--dev-cpp/kokkos/kokkos-5.0.2.ebuild112
-rw-r--r--dev-cpp/kokkos/kokkos-5.1.1.ebuild112
-rw-r--r--dev-cpp/kokkos/kokkos-9999.ebuild114
-rw-r--r--dev-cpp/kokkos/metadata.xml13
8 files changed, 640 insertions, 0 deletions
diff --git a/dev-cpp/kokkos/Manifest b/dev-cpp/kokkos/Manifest
new file mode 100644
index 000000000000..553a36ae68a0
--- /dev/null
+++ b/dev-cpp/kokkos/Manifest
@@ -0,0 +1,5 @@
+DIST kokkos-4.3.1.tar.gz 2431142 BLAKE2B 158ceea3c62449f386613b17e996e4d11e9b95c38a92f69fb3c487b90cf5f07dffdafb6ee0a37eff5299e7d1db50efaed4b26b9baebeeea9d675d0d98dd420e4 SHA512 8180ecdec2f0a6167a85dd1eb268996b0310e82098f2329eccf658aff90118a7c85c2f7607984602de2ca48dc45c1dbf30a4843b35c42590e58d4b03beff474a
+DIST kokkos-4.6.2.tar.gz 2477557 BLAKE2B 3d8a93ca8e27bc0a3a5542680b0a2daf7ca862826a1a45973012f09a6f0a39938628efdb532bb2d013cb669b912785eac12bcf1b17712cb3e098106e858f3fe3 SHA512 bef5afc0009d6e3ac555dbaebc471fe0823ac1d1add79dcacbed82bee4d2a9a34cf4342fbef8fd00beefc6bd0a2f569e9f0cbe987ec60d087fde803479eff426
+DIST kokkos-4.7.4.tar.gz 2526399 BLAKE2B 9cd84be3fd606b05a0afd2a64f14f27f7f2a7397587aa12562a151d85e3541edb31e82d3562b7e4935116349cfc07e17a0e3f6c78327a5bfb47c2d569a98137a SHA512 34825f2d0f202f49fecc24050a4790cb721f3a4cca21381fd0eb0c302bbafe90f997dc96130c2b2479c4344d11dbb062d4b41f2aaab11e49f5bd1da2c9e5d929
+DIST kokkos-5.0.2.tar.gz 1787648 BLAKE2B c951a2fdae309a61c1cdc042a12aa27636e58fd39a3ef4426bca9f659d6f8056774298e56ccc7c94d0b356319e3b913e9637dd0c3850313a77470dc8abe5e1c5 SHA512 d0c622aad2333cc5f944d82f633cf24201323d1b9787c730aaaee3e80805caf1c39bec36cabd5fd46d8104aaf95c68ffe478d8ff8cd4b864c47298f2aa929ecd
+DIST kokkos-5.1.1.tar.gz 1792643 BLAKE2B bea2355e39d3b29ab855d3b5f44180ada432a7043dbc92ee7b8b1a9925fec3733e524a676c010b263d53e050a0bb2e93b78703cd9b6d1496ff1cf01f1f2616a8 SHA512 7da365dc4be6ca6ed9efcd3b260a003e068ec274dc3af7761359f9f60748902908167698b824487951f21412a5a5bece7fbcb32ab558a406f7e8beb0e44c1698
diff --git a/dev-cpp/kokkos/kokkos-4.3.1-r1.ebuild b/dev-cpp/kokkos/kokkos-4.3.1-r1.ebuild
new file mode 100644
index 000000000000..a0af3b2e9bb1
--- /dev/null
+++ b/dev-cpp/kokkos/kokkos-4.3.1-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake toolchain-funcs
+
+DESCRIPTION="C++ Performance Portability Programming EcoSystem"
+HOMEPAGE="https://github.com/kokkos"
+MY_PV="$(ver_cut 1-2).0$(ver_cut 3)"
+SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+KEYWORDS="amd64 -x86"
+IUSE="+openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sys-apps/hwloc:="
+RDEPEND="${DEPEND}"
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_INCLUDEDIR=include/kokkos
+ -DKokkos_ENABLE_TESTS=$(usex test)
+ -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON
+ -DKokkos_ENABLE_SERIAL=ON
+ -DKokkos_ENABLE_HWLOC=ON
+ -DKokkos_HWLOC_DIR="${EPREFIX}/usr"
+ -DKokkos_ENABLE_OPENMP=$(usex openmp)
+ -DBUILD_SHARED_LIBS=ON
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # Contains "death tests" which are known/expected(?) to fail
+ # https://github.com/kokkos/kokkos/issues/3033
+ # bug #791514
+ -E "(KokkosCore_UnitTest_OpenMP|KokkosCore_UnitTest_Serial)"
+ )
+
+ cmake_src_test
+}
diff --git a/dev-cpp/kokkos/kokkos-4.6.2-r2.ebuild b/dev-cpp/kokkos/kokkos-4.6.2-r2.ebuild
new file mode 100644
index 000000000000..3d19e6ac9a4e
--- /dev/null
+++ b/dev-cpp/kokkos/kokkos-4.6.2-r2.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake cuda toolchain-funcs
+
+DESCRIPTION="C++ Performance Portability Programming EcoSystem"
+HOMEPAGE="https://github.com/kokkos"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/kokkos/kokkos.git"
+else
+ MY_PV="$(ver_cut 1-2).0$(ver_cut 3)"
+ SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+ KEYWORDS="amd64 ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cuda +openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sys-apps/hwloc:="
+RDEPEND="${DEPEND}"
+
+#
+# Try to translate the "${CUDAARCHS}" number coming from __nvcc_device_query
+# into an option string that Kokkos' CMake configuration understands:
+#
+kokkos_arch_option() {
+ case "${1}" in
+ 3[0257]) echo "-DKokkos_ARCH_KEPLER${1}=ON" ;;
+ 5[023]) echo "-DKokkos_ARCH_MAXWELL${1}=ON" ;;
+ 6[01]) echo "-DKokkos_ARCH_PASCAL${1}=ON" ;;
+ 7[02]) echo "-DKokkos_ARCH_VOLTA${1}=ON" ;;
+ 75) echo "-DKokkos_ARCH_TURING${1}=ON" ;;
+ 8[06]) echo "-DKokkos_ARCH_AMPERE${1}=ON" ;;
+ 89) echo "-DKokkos_ARCH_ADA${1}=ON" ;;
+ 90) echo "-DKokkos_ARCH_HOPPER${1}=ON" ;;
+ 1[02]0) echo "-DKokkos_ARCH_BLACKWELL${1}=ON" ;;
+ *) die "Unknown CUDA architecture »${1}«" ;;
+ esac
+}
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_INCLUDEDIR=include/kokkos
+ -DKokkos_ENABLE_TESTS="$(usex test)"
+ -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON
+ -DKokkos_ENABLE_SERIAL=ON
+ -DKokkos_ENABLE_HWLOC=ON
+ -DKokkos_ENABLE_CUDA="$(usex cuda)"
+ -DKokkos_ENABLE_CUDA_CONSTEXPR="$(usex cuda)"
+ -DKokkos_HWLOC_DIR="${EPREFIX}/usr"
+ -DKokkos_ENABLE_OPENMP="$(usex openmp)"
+ -DBUILD_SHARED_LIBS=ON
+ )
+
+ if use cuda; then
+ cuda_add_sandbox -w
+
+ if [[ ! -n "${CUDAARCHS}" ]]; then
+ if ! SANDBOX_WRITE=/dev/nvidiactl test -w /dev/nvidiactl ; then
+ eerror
+ eerror "Can not access the GPU at /dev/nvidiactl."
+ eerror "User $(id -nu) is not in the group \"video\"."
+ eerror
+ ewarn
+ ewarn "Can not query the native device. You will need to set one of the"
+ ewarn "supported Kokkos_ARCH_{..} CMake variables, or the CUDAARCHS"
+ ewarn "environment variable to the appropriate architecture by hand..."
+ ewarn
+ else
+ local CUDAARCHS
+ CUDAARCHS="$(__nvcc_device_query || eerror "failed to query the native device")"
+ fi
+ fi
+
+ if [[ -n "${CUDAARCHS}" ]]; then
+ einfo "Building with CUDAARCHS=${CUDAARCHS}"
+ mycmakeargs+=(
+ $(kokkos_arch_option "${CUDAARCHS}")
+ )
+ fi
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # Contains "death tests" which are known/expected(?) to fail
+ # https://github.com/kokkos/kokkos/issues/3033
+ # bug #791514
+ -E "(KokkosCore_UnitTest_OpenMP|KokkosCore_UnitTest_Serial)"
+ )
+
+ cmake_src_test
+}
diff --git a/dev-cpp/kokkos/kokkos-4.7.4.ebuild b/dev-cpp/kokkos/kokkos-4.7.4.ebuild
new file mode 100644
index 000000000000..54f9147dab3f
--- /dev/null
+++ b/dev-cpp/kokkos/kokkos-4.7.4.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake cuda toolchain-funcs
+
+DESCRIPTION="C++ Performance Portability Programming EcoSystem"
+HOMEPAGE="https://github.com/kokkos"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/kokkos/kokkos.git"
+else
+ MY_PV="$(ver_cut 1-2).0$(ver_cut 3)"
+ SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+ KEYWORDS="amd64 ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cuda +openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sys-apps/hwloc:="
+RDEPEND="${DEPEND}"
+
+#
+# Try to translate the "${CUDAARCHS}" number coming from __nvcc_device_query
+# into an option string that Kokkos' CMake configuration understands:
+#
+kokkos_arch_option() {
+ case "${1}" in
+ 3[0257]) echo "-DKokkos_ARCH_KEPLER${1}=ON" ;;
+ 5[023]) echo "-DKokkos_ARCH_MAXWELL${1}=ON" ;;
+ 6[01]) echo "-DKokkos_ARCH_PASCAL${1}=ON" ;;
+ 7[02]) echo "-DKokkos_ARCH_VOLTA${1}=ON" ;;
+ 75) echo "-DKokkos_ARCH_TURING${1}=ON" ;;
+ 8[06]) echo "-DKokkos_ARCH_AMPERE${1}=ON" ;;
+ 89) echo "-DKokkos_ARCH_ADA${1}=ON" ;;
+ 90) echo "-DKokkos_ARCH_HOPPER${1}=ON" ;;
+ 1[02]0) echo "-DKokkos_ARCH_BLACKWELL${1}=ON" ;;
+ *) die "Unknown CUDA architecture »${1}«" ;;
+ esac
+}
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_INCLUDEDIR=include/kokkos
+ -DKokkos_ENABLE_TESTS="$(usex test)"
+ -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON
+ -DKokkos_ENABLE_SERIAL=ON
+ -DKokkos_ENABLE_HWLOC=ON
+ -DKokkos_ENABLE_CUDA="$(usex cuda)"
+ -DKokkos_ENABLE_CUDA_CONSTEXPR="$(usex cuda)"
+ -DKokkos_HWLOC_DIR="${EPREFIX}/usr"
+ -DKokkos_ENABLE_OPENMP="$(usex openmp)"
+ -DBUILD_SHARED_LIBS=ON
+ )
+
+ if use cuda; then
+ cuda_add_sandbox -w
+
+ if [[ ! -n "${CUDAARCHS}" ]]; then
+ if ! SANDBOX_WRITE=/dev/nvidiactl test -w /dev/nvidiactl ; then
+ eerror
+ eerror "Can not access the GPU at /dev/nvidiactl."
+ eerror "User $(id -nu) is not in the group \"video\"."
+ eerror
+ ewarn
+ ewarn "Can not query the native device. You will need to set one of the"
+ ewarn "supported Kokkos_ARCH_{..} CMake variables, or the CUDAARCHS"
+ ewarn "environment variable to the appropriate architecture by hand..."
+ ewarn
+ else
+ local CUDAARCHS
+ CUDAARCHS="$(__nvcc_device_query || eerror "failed to query the native device")"
+ fi
+ fi
+
+ if [[ -n "${CUDAARCHS}" ]]; then
+ einfo "Building with CUDAARCHS=${CUDAARCHS}"
+ mycmakeargs+=(
+ $(kokkos_arch_option "${CUDAARCHS}")
+ )
+ fi
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # Contains "death tests" which are known/expected(?) to fail
+ # https://github.com/kokkos/kokkos/issues/3033
+ # bug #791514
+ -E "(KokkosCore_UnitTest_OpenMP|KokkosCore_UnitTest_Serial)"
+ )
+
+ cmake_src_test
+}
diff --git a/dev-cpp/kokkos/kokkos-5.0.2.ebuild b/dev-cpp/kokkos/kokkos-5.0.2.ebuild
new file mode 100644
index 000000000000..3879a12dbe94
--- /dev/null
+++ b/dev-cpp/kokkos/kokkos-5.0.2.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake cuda toolchain-funcs
+
+DESCRIPTION="C++ Performance Portability Programming EcoSystem"
+HOMEPAGE="https://github.com/kokkos"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/kokkos/kokkos.git"
+else
+ SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cuda +openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sys-apps/hwloc:="
+RDEPEND="${DEPEND}"
+
+#
+# Try to translate the "${CUDAARCHS}" number coming from __nvcc_device_query
+# into an option string that Kokkos' CMake configuration understands:
+#
+kokkos_arch_option() {
+ case "${1}" in
+ 3[0257]) echo "-DKokkos_ARCH_KEPLER${1}=ON" ;;
+ 5[023]) echo "-DKokkos_ARCH_MAXWELL${1}=ON" ;;
+ 6[01]) echo "-DKokkos_ARCH_PASCAL${1}=ON" ;;
+ 7[02]) echo "-DKokkos_ARCH_VOLTA${1}=ON" ;;
+ 75) echo "-DKokkos_ARCH_TURING${1}=ON" ;;
+ 8[06]) echo "-DKokkos_ARCH_AMPERE${1}=ON" ;;
+ 89) echo "-DKokkos_ARCH_ADA${1}=ON" ;;
+ 90) echo "-DKokkos_ARCH_HOPPER${1}=ON" ;;
+ 1[02]0) echo "-DKokkos_ARCH_BLACKWELL${1}=ON" ;;
+ *) die "Unknown CUDA architecture »${1}«" ;;
+ esac
+}
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_INCLUDEDIR=include/kokkos
+ -DKokkos_ENABLE_TESTS="$(usex test)"
+ -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON
+ -DKokkos_ENABLE_SERIAL=ON
+ -DKokkos_ENABLE_HWLOC=ON
+ -DKokkos_ENABLE_CUDA="$(usex cuda)"
+ -DKokkos_ENABLE_CUDA_CONSTEXPR="$(usex cuda)"
+ -DKokkos_HWLOC_DIR="${EPREFIX}/usr"
+ -DKokkos_ENABLE_OPENMP="$(usex openmp)"
+ -DBUILD_SHARED_LIBS=ON
+ )
+
+ if use cuda; then
+ cuda_add_sandbox -w
+
+ if [[ ! -n "${CUDAARCHS}" ]]; then
+ if ! SANDBOX_WRITE=/dev/nvidiactl test -w /dev/nvidiactl ; then
+ eerror
+ eerror "Can not access the GPU at /dev/nvidiactl."
+ eerror "User $(id -nu) is not in the group \"video\"."
+ eerror
+ ewarn
+ ewarn "Can not query the native device. You will need to set one of the"
+ ewarn "supported Kokkos_ARCH_{..} CMake variables, or the CUDAARCHS"
+ ewarn "environment variable to the appropriate architecture by hand..."
+ ewarn
+ else
+ local CUDAARCHS
+ CUDAARCHS="$(__nvcc_device_query || eerror "failed to query the native device")"
+ fi
+ fi
+
+ if [[ -n "${CUDAARCHS}" ]]; then
+ einfo "Building with CUDAARCHS=${CUDAARCHS}"
+ mycmakeargs+=(
+ $(kokkos_arch_option "${CUDAARCHS}")
+ )
+ fi
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # Contains "death tests" which are known/expected(?) to fail
+ # https://github.com/kokkos/kokkos/issues/3033
+ # bug #791514
+ -E "(KokkosCore_UnitTest_OpenMP|KokkosCore_UnitTest_Serial)"
+ )
+
+ cmake_src_test
+}
diff --git a/dev-cpp/kokkos/kokkos-5.1.1.ebuild b/dev-cpp/kokkos/kokkos-5.1.1.ebuild
new file mode 100644
index 000000000000..3879a12dbe94
--- /dev/null
+++ b/dev-cpp/kokkos/kokkos-5.1.1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake cuda toolchain-funcs
+
+DESCRIPTION="C++ Performance Portability Programming EcoSystem"
+HOMEPAGE="https://github.com/kokkos"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/kokkos/kokkos.git"
+else
+ SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cuda +openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sys-apps/hwloc:="
+RDEPEND="${DEPEND}"
+
+#
+# Try to translate the "${CUDAARCHS}" number coming from __nvcc_device_query
+# into an option string that Kokkos' CMake configuration understands:
+#
+kokkos_arch_option() {
+ case "${1}" in
+ 3[0257]) echo "-DKokkos_ARCH_KEPLER${1}=ON" ;;
+ 5[023]) echo "-DKokkos_ARCH_MAXWELL${1}=ON" ;;
+ 6[01]) echo "-DKokkos_ARCH_PASCAL${1}=ON" ;;
+ 7[02]) echo "-DKokkos_ARCH_VOLTA${1}=ON" ;;
+ 75) echo "-DKokkos_ARCH_TURING${1}=ON" ;;
+ 8[06]) echo "-DKokkos_ARCH_AMPERE${1}=ON" ;;
+ 89) echo "-DKokkos_ARCH_ADA${1}=ON" ;;
+ 90) echo "-DKokkos_ARCH_HOPPER${1}=ON" ;;
+ 1[02]0) echo "-DKokkos_ARCH_BLACKWELL${1}=ON" ;;
+ *) die "Unknown CUDA architecture »${1}«" ;;
+ esac
+}
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_INCLUDEDIR=include/kokkos
+ -DKokkos_ENABLE_TESTS="$(usex test)"
+ -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON
+ -DKokkos_ENABLE_SERIAL=ON
+ -DKokkos_ENABLE_HWLOC=ON
+ -DKokkos_ENABLE_CUDA="$(usex cuda)"
+ -DKokkos_ENABLE_CUDA_CONSTEXPR="$(usex cuda)"
+ -DKokkos_HWLOC_DIR="${EPREFIX}/usr"
+ -DKokkos_ENABLE_OPENMP="$(usex openmp)"
+ -DBUILD_SHARED_LIBS=ON
+ )
+
+ if use cuda; then
+ cuda_add_sandbox -w
+
+ if [[ ! -n "${CUDAARCHS}" ]]; then
+ if ! SANDBOX_WRITE=/dev/nvidiactl test -w /dev/nvidiactl ; then
+ eerror
+ eerror "Can not access the GPU at /dev/nvidiactl."
+ eerror "User $(id -nu) is not in the group \"video\"."
+ eerror
+ ewarn
+ ewarn "Can not query the native device. You will need to set one of the"
+ ewarn "supported Kokkos_ARCH_{..} CMake variables, or the CUDAARCHS"
+ ewarn "environment variable to the appropriate architecture by hand..."
+ ewarn
+ else
+ local CUDAARCHS
+ CUDAARCHS="$(__nvcc_device_query || eerror "failed to query the native device")"
+ fi
+ fi
+
+ if [[ -n "${CUDAARCHS}" ]]; then
+ einfo "Building with CUDAARCHS=${CUDAARCHS}"
+ mycmakeargs+=(
+ $(kokkos_arch_option "${CUDAARCHS}")
+ )
+ fi
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # Contains "death tests" which are known/expected(?) to fail
+ # https://github.com/kokkos/kokkos/issues/3033
+ # bug #791514
+ -E "(KokkosCore_UnitTest_OpenMP|KokkosCore_UnitTest_Serial)"
+ )
+
+ cmake_src_test
+}
diff --git a/dev-cpp/kokkos/kokkos-9999.ebuild b/dev-cpp/kokkos/kokkos-9999.ebuild
new file mode 100644
index 000000000000..401c5258f64e
--- /dev/null
+++ b/dev-cpp/kokkos/kokkos-9999.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake cuda toolchain-funcs
+
+DESCRIPTION="C++ Performance Portability Programming EcoSystem"
+HOMEPAGE="https://github.com/kokkos"
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/kokkos/kokkos.git"
+else
+ MY_PV="$(ver_cut 1-2).0$(ver_cut 3)"
+ SRC_URI="https://github.com/${PN}/${PN}/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="cuda +openmp test"
+RESTRICT="!test? ( test )"
+
+DEPEND="sys-apps/hwloc:="
+RDEPEND="${DEPEND}"
+
+#
+# Try to translate the "${CUDAARCHS}" number coming from __nvcc_device_query
+# into an option string that Kokkos' CMake configuration understands:
+#
+kokkos_arch_option() {
+ case "${1}" in
+ 3[0257]) echo "-DKokkos_ARCH_KEPLER${1}=ON" ;;
+ 5[023]) echo "-DKokkos_ARCH_MAXWELL${1}=ON" ;;
+ 6[01]) echo "-DKokkos_ARCH_PASCAL${1}=ON" ;;
+ 7[02]) echo "-DKokkos_ARCH_VOLTA${1}=ON" ;;
+ 75) echo "-DKokkos_ARCH_TURING${1}=ON" ;;
+ 8[06]) echo "-DKokkos_ARCH_AMPERE${1}=ON" ;;
+ 89) echo "-DKokkos_ARCH_ADA${1}=ON" ;;
+ 90) echo "-DKokkos_ARCH_HOPPER${1}=ON" ;;
+ 1[02]0) echo "-DKokkos_ARCH_BLACKWELL${1}=ON" ;;
+ *) die "Unknown CUDA architecture »${1}«" ;;
+ esac
+}
+
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_INCLUDEDIR=include/kokkos
+ -DKokkos_ENABLE_TESTS="$(usex test)"
+ -DKokkos_ENABLE_AGGRESSIVE_VECTORIZATION=ON
+ -DKokkos_ENABLE_SERIAL=ON
+ -DKokkos_ENABLE_HWLOC=ON
+ -DKokkos_ENABLE_CUDA="$(usex cuda)"
+ -DKokkos_ENABLE_CUDA_CONSTEXPR="$(usex cuda)"
+ -DKokkos_HWLOC_DIR="${EPREFIX}/usr"
+ -DKokkos_ENABLE_OPENMP="$(usex openmp)"
+ -DBUILD_SHARED_LIBS=ON
+ )
+
+ if use cuda; then
+ cuda_add_sandbox -w
+
+ if [[ ! -n "${CUDAARCHS}" ]]; then
+ if ! SANDBOX_WRITE=/dev/nvidiactl test -w /dev/nvidiactl ; then
+ eerror
+ eerror "Can not access the GPU at /dev/nvidiactl."
+ eerror "User $(id -nu) is not in the group \"video\"."
+ eerror
+ ewarn
+ ewarn "Can not query the native device. You will need to set one of the"
+ ewarn "supported Kokkos_ARCH_{..} CMake variables, or the CUDAARCHS"
+ ewarn "environment variable to the appropriate architecture by hand..."
+ ewarn
+ else
+ local CUDAARCHS
+ CUDAARCHS="$(__nvcc_device_query || eerror "failed to query the native device")"
+ fi
+ fi
+
+ if [[ -n "${CUDAARCHS}" ]]; then
+ einfo "Building with CUDAARCHS=${CUDAARCHS}"
+ mycmakeargs+=(
+ $(kokkos_arch_option "${CUDAARCHS}")
+ )
+ fi
+ fi
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # Contains "death tests" which are known/expected(?) to fail
+ # https://github.com/kokkos/kokkos/issues/3033
+ # bug #791514
+ -E "(KokkosCore_UnitTest_OpenMP|KokkosCore_UnitTest_Serial)"
+ )
+
+ cmake_src_test
+}
diff --git a/dev-cpp/kokkos/metadata.xml b/dev-cpp/kokkos/metadata.xml
new file mode 100644
index 000000000000..93c94712ed27
--- /dev/null
+++ b/dev-cpp/kokkos/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>tamiko@gentoo.org</email>
+ <name>Matthias Maier</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>