diff options
Diffstat (limited to 'sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild')
-rw-r--r-- | sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild b/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild new file mode 100644 index 000000000000..8c096e29135a --- /dev/null +++ b/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild @@ -0,0 +1,82 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +ROCM_VERSION=${PV} + +inherit cmake flag-o-matic rocm + +GTEST_COMMIT="b85864c64758dec007208e56af933fc3f52044ee" +GTEST_FILE="gtest-1.14.0_p20220421.tar.gz" + +DESCRIPTION="High Performance Composable Kernel for AMD GPUs" +HOMEPAGE="https://github.com/ROCm/composable_kernel" +SRC_URI="https://github.com/ROCm/composable_kernel/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz + test? ( https://github.com/google/googletest/archive/${GTEST_COMMIT}.tar.gz -> ${GTEST_FILE} )" +S="${WORKDIR}/composable_kernel-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="debug test" +REQUIRED_USE="${ROCM_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-util/hip + >=dev-db/sqlite-3.17 + sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] + >=dev-libs/boost-1.72 + dev-cpp/nlohmann_json + dev-cpp/frugally-deep +" + +DEPEND="${RDEPEND}" + +BDEPEND=" + dev-build/rocm-cmake +" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-enable-examples.patch + "${FILESDIR}"/${PN}-6.1.1-fix-clang-17-no-offload-uniform-block.patch + "${FILESDIR}"/${PN}-6.1.1-no-git-no-hash.patch +) + +src_prepare() { + sed -e '/-Werror/d' -i cmake/EnableCompilerWarnings.cmake || die + cmake_src_prepare +} + +src_configure() { + if ! use debug; then + append-cflags "-DNDEBUG" + append-cxxflags "-DNDEBUG" + CMAKE_BUILD_TYPE="Release" + else + CMAKE_BUILD_TYPE="Debug" + fi + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DBUILD_DEV=OFF + -DGPU_TARGETS="$(get_amdgpu_flags)" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DBUILD_TESTING=$(usex test ON OFF) + ) + + if use test; then + mycmakeargs+=( + -DGOOGLETEST_DIR="${WORKDIR}/googletest-${GTEST_COMMIT}" + ) + fi + + CXX=hipcc cmake_src_configure +} + +src_test() { + check_amdgpu + LD_LIBRARY_PATH="${BUILD_DIR}"/lib cmake_src_test -j1 +} |