dev-lang/ispc: Add GPU support

Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2023-12-31 16:25:38 +01:00
parent 9b3e40bb2a
commit ce3d65e1b4
5 changed files with 26 additions and 1 deletions

View File

@@ -21,12 +21,13 @@ SRC_URI="
LICENSE="BSD BSD-2 UoI-NCSA"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
IUSE="examples openmp test"
IUSE="examples gpu openmp test"
RESTRICT="!test? ( test )"
DEPEND="
<sys-devel/clang-$((${LLVM_MAX_SLOT} + 1)):=
sys-libs/ncurses:=
gpu? ( dev-libs/level-zero:= )
!openmp? ( dev-cpp/tbb:= )
"
RDEPEND="
@@ -57,6 +58,14 @@ src_prepare() {
sed -i -e 's:set(target_arch "i686"):return():' cmake/GenerateBuiltins.cmake || die
fi
# do not require bundled gtest
mkdir -p ispcrt/tests/vendor/google/googletest || die
cat > ispcrt/tests/vendor/google/googletest/CMakeLists.txt <<-EOF || die
find_package(GTest)
EOF
# remove hacks that break unbundling
sed -i -e '/gmock/d' -e '/install/,$d' ispcrt/tests/CMakeLists.txt || die
cmake_src_prepare
}
@@ -67,6 +76,7 @@ src_configure() {
-DISPC_INCLUDE_EXAMPLES=OFF
-DISPC_INCLUDE_TESTS=$(usex test)
-DISPC_INCLUDE_UTILS=OFF
-DISPCRT_BUILD_GPU=$(usex gpu)
-DISPCRT_BUILD_TASK_MODEL=$(usex openmp OpenMP TBB)
)
cmake_src_configure

View File

@@ -9,6 +9,9 @@
<remote-id type="github">ispc/ispc</remote-id>
</upstream>
<use>
<flag name="gpu">
Enable Level0 GPU support in ispcrt.
</flag>
<flag name="openmp">
Build with OpenMP task model (otherwise, TBB task model is used).
</flag>

View File

@@ -17,6 +17,10 @@
#--- END OF EXAMPLES ---
# Michał Górny <mgorny@gentoo.org> (2023-12-31)
# Requires dev-libs/level-zero.
dev-lang/ispc -gpu
# Andrew Ammerlaan <andrewammerlaan@gentoo.org> (2023-12-18)
# Experimental and only available on a subset of architectures
sys-kernel/gentoo-kernel -generic-uki

View File

@@ -1,6 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Michał Górny <mgorny@gentoo.org> (2023-12-31)
# Requires dev-libs/level-zero.
dev-lang/ispc gpu
# Andrew Ammerlaan <andrewammerlaan@gentoo.org> (2023-12-18)
# Experimental and only available on a subset of architectures
sys-kernel/gentoo-kernel generic-uki

View File

@@ -1,6 +1,10 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Michał Górny <mgorny@gentoo.org> (2023-12-31)
# Requires dev-libs/level-zero.
dev-lang/ispc gpu
# Andrew Ammerlaan <andrewammerlaan@gentoo.org> (2023-12-18)
# Requires systemd
sys-kernel/gentoo-kernel generic-uki