Date: Wednesday, December 28, 2022 @ 15:44:02 Author: tpkessler Revision: 1371494
Migrate rocthrust from AUR to community Added: rocthrust/ rocthrust/repos/ rocthrust/trunk/ rocthrust/trunk/PKGBUILD rocthrust/trunk/test.cpp rocthrust/trunk/test.sh ----------+ PKGBUILD | 34 ++++++++++++++++++++++++++++++++++ test.cpp | 39 +++++++++++++++++++++++++++++++++++++++ test.sh | 6 ++++++ 3 files changed, 79 insertions(+) Added: rocthrust/trunk/PKGBUILD =================================================================== --- rocthrust/trunk/PKGBUILD (rev 0) +++ rocthrust/trunk/PKGBUILD 2022-12-28 15:44:02 UTC (rev 1371494) @@ -0,0 +1,34 @@ +# Maintainer: Torsten Keßler <tpkessler at archlinux dot org> +# Contributor: Markus Näther <[email protected]> +pkgname=rocthrust +pkgver=5.4.1 +pkgrel=2 +pkgdesc='Port of the Thrust parallel algorithm library atop HIP/ROCm' +arch=('x86_64') +url='https://docs.amd.com/bundle/rocTHRUST_API_Guide/page/index.html' +license=('Apache') +depends=('hip' 'rocprim') +makedepends=('rocm-cmake') +_git='https://github.com/ROCmSoftwarePlatform/rocThrust' +source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz") +sha256sums=('8d71e6e51785dbd354d35135879fb040ed3113c3f2698090b2e5d9ec01d6ce98') +_dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")" + +build() { + # -fcf-protection is not supported by HIP, see + # https://docs.amd.com/bundle/ROCm-Compiler-Reference-Guide-v5.4/page/Appendix_A.html + CXXFLAGS="${CXXFLAGS} -fcf-protection=none" \ + cmake \ + -Wno-dev \ + -S "$_dirname" \ + -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \ + -DCMAKE_INSTALL_PREFIX=/opt/rocm \ + -Damd_comgr_DIR=/opt/rocm/lib/cmake/amd_comgr + cmake --build build +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} Added: rocthrust/trunk/test.cpp =================================================================== --- rocthrust/trunk/test.cpp (rev 0) +++ rocthrust/trunk/test.cpp 2022-12-28 15:44:02 UTC (rev 1371494) @@ -0,0 +1,39 @@ +#include <thrust/copy.h> +#include <thrust/host_vector.h> +#include <thrust/device_vector.h> +#include <thrust/sort.h> +#include <iostream> +#include <vector> +#include <algorithm> +#include <random> + +int main(int argc, char *argv[]) +{ + size_t size = 1024; + + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_real_distribution<float> dist(-1.0, 1.0); + + auto myrand = [&]() -> float {return dist(gen);}; + + thrust::host_vector<float> xin(size); + std::generate(xin.begin(), xin.end(), myrand); + + thrust::device_vector<float> x(size); + x = xin; + + thrust::sort(x.begin(), x.end()); + thrust::copy(x.begin(), x.end(), xin.begin()); + + for(size_t i = 1; i < size; i++){ + if(xin[i - 1] > xin[i]){ + std::cout << "Elements " << i - 1 << " and " << i + << "are not sorted:\n"; + std::cout << xin[i - 1] << " " << xin[i] << std::endl; + return 1; + } + } + + std::cout << "TESTS PASSED!" << std::endl; +} Added: rocthrust/trunk/test.sh =================================================================== --- rocthrust/trunk/test.sh (rev 0) +++ rocthrust/trunk/test.sh 2022-12-28 15:44:02 UTC (rev 1371494) @@ -0,0 +1,6 @@ +#! /usr/bin/env sh + +OUT=$(mktemp -d) +# rocTHRUST uses C++14 extensions but hipcc uses C++11 by default +/opt/rocm/bin/hipcc -std=gnu++14 -o "$OUT"/test test.cpp +"$OUT"/test Property changes on: rocthrust/trunk/test.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property
