Date: Sunday, February 5, 2023 @ 15:38:08
  Author: tpkessler
Revision: 1392788

archrelease: copy trunk to community-testing-x86_64

Added:
  rocsparse/repos/community-testing-x86_64/PKGBUILD
    (from rev 1392787, rocsparse/trunk/PKGBUILD)
  rocsparse/repos/community-testing-x86_64/rocsparse-no-git.patch
    (from rev 1392787, rocsparse/trunk/rocsparse-no-git.patch)
  rocsparse/repos/community-testing-x86_64/test.cpp
    (from rev 1392787, rocsparse/trunk/test.cpp)
  rocsparse/repos/community-testing-x86_64/test.sh
    (from rev 1392787, rocsparse/trunk/test.sh)
Deleted:
  rocsparse/repos/community-testing-x86_64/PKGBUILD
  rocsparse/repos/community-testing-x86_64/rocsparse-no-git.patch
  rocsparse/repos/community-testing-x86_64/test.cpp
  rocsparse/repos/community-testing-x86_64/test.sh

------------------------+
 PKGBUILD               |   92 ++++++++++-----------
 rocsparse-no-git.patch |   24 ++---
 test.cpp               |  200 +++++++++++++++++++++++------------------------
 test.sh                |   10 +-
 4 files changed, 163 insertions(+), 163 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD    2023-02-05 15:37:52 UTC (rev 1392787)
+++ PKGBUILD    2023-02-05 15:38:08 UTC (rev 1392788)
@@ -1,46 +0,0 @@
-# Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
-# Contributor: Markus Näther <[email protected]>
-pkgname=rocsparse
-pkgver=5.4.2
-pkgrel=1
-pkgdesc='BLAS for sparse computation on top of ROCm'
-arch=('x86_64')
-url='https://rocsparse.readthedocs.io/en/master/'
-license=('MIT')
-depends=('hip' 'rocprim')
-makedepends=('rocm-cmake' 'gcc-fortran')
-_git='https://github.com/ROCmSoftwarePlatform/rocSPARSE'
-source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz"
-        "rocsparse-no-git.patch")
-sha256sums=('c1542b044ebebada040f7a57e20adb9c5ef31c7aaa2d48771a865124a3f6a5eb'
-            'bc3cda8fb3e3aad14a2130d9cde7a8c521c2c35448ed69f0873111571d654ad2')
-options=(!lto)
-_dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")"
-
-prepare() {
-    cd "$_dirname"
-    patch -Np1 -i "$srcdir/rocsparse-no-git.patch"
-}
-
-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 \
-    -B build \
-    -S "$_dirname" \
-    -DCMAKE_BUILD_TYPE=None \
-    -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \
-    -DCMAKE_INSTALL_PREFIX=/opt/rocm
-  cmake --build build
-}
-
-package() {
-  DESTDIR="$pkgdir" cmake --install build
-
-  echo '/opt/rocm/rocsparse/lib' > "$pkgname.conf"
-  install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
-
-  install -Dm644 "$_dirname/LICENSE.md" 
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}

Copied: rocsparse/repos/community-testing-x86_64/PKGBUILD (from rev 1392787, 
rocsparse/trunk/PKGBUILD)
===================================================================
--- PKGBUILD                            (rev 0)
+++ PKGBUILD    2023-02-05 15:38:08 UTC (rev 1392788)
@@ -0,0 +1,46 @@
+# Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
+# Contributor: Markus Näther <[email protected]>
+pkgname=rocsparse
+pkgver=5.4.2
+pkgrel=2
+pkgdesc='BLAS for sparse computation on top of ROCm'
+arch=('x86_64')
+url='https://rocsparse.readthedocs.io/en/master/'
+license=('MIT')
+depends=('hip' 'rocprim')
+makedepends=('rocm-cmake' 'gcc-fortran')
+_git='https://github.com/ROCmSoftwarePlatform/rocSPARSE'
+source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz"
+        "rocsparse-no-git.patch")
+sha256sums=('c1542b044ebebada040f7a57e20adb9c5ef31c7aaa2d48771a865124a3f6a5eb'
+            'bc3cda8fb3e3aad14a2130d9cde7a8c521c2c35448ed69f0873111571d654ad2')
+options=(!lto)
+_dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")"
+
+prepare() {
+    cd "$_dirname"
+    patch -Np1 -i "$srcdir/rocsparse-no-git.patch"
+}
+
+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 \
+    -B build \
+    -S "$_dirname" \
+    -DCMAKE_BUILD_TYPE=None \
+    -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc \
+    -DCMAKE_INSTALL_PREFIX=/opt/rocm
+  cmake --build build
+}
+
+package() {
+  DESTDIR="$pkgdir" cmake --install build
+
+  echo '/opt/rocm/rocsparse/lib' > "$pkgname.conf"
+  install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
+
+  install -Dm644 "$_dirname/LICENSE.md" 
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}

Deleted: rocsparse-no-git.patch
===================================================================
--- rocsparse-no-git.patch      2023-02-05 15:37:52 UTC (rev 1392787)
+++ rocsparse-no-git.patch      2023-02-05 15:38:08 UTC (rev 1392788)
@@ -1,12 +0,0 @@
---- rocSPARSE-rocm-5.4.0/cmake/Dependencies.cmake.bak  2022-12-08 
11:37:01.176015424 +0100
-+++ rocSPARSE-rocm-5.4.0/cmake/Dependencies.cmake      2022-12-08 
11:37:20.093958536 +0100
-@@ -23,9 +23,6 @@
- 
- # Dependencies
- 
--# Git
--find_package(Git REQUIRED)
--
- # Workaround until hcc & hip cmake modules fixes symlink logic in their 
config files.
- # (Thanks to rocBLAS devs for finding workaround for this problem!)
- list(APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/hip)

Copied: rocsparse/repos/community-testing-x86_64/rocsparse-no-git.patch (from 
rev 1392787, rocsparse/trunk/rocsparse-no-git.patch)
===================================================================
--- rocsparse-no-git.patch                              (rev 0)
+++ rocsparse-no-git.patch      2023-02-05 15:38:08 UTC (rev 1392788)
@@ -0,0 +1,12 @@
+--- rocSPARSE-rocm-5.4.0/cmake/Dependencies.cmake.bak  2022-12-08 
11:37:01.176015424 +0100
++++ rocSPARSE-rocm-5.4.0/cmake/Dependencies.cmake      2022-12-08 
11:37:20.093958536 +0100
+@@ -23,9 +23,6 @@
+ 
+ # Dependencies
+ 
+-# Git
+-find_package(Git REQUIRED)
+-
+ # Workaround until hcc & hip cmake modules fixes symlink logic in their 
config files.
+ # (Thanks to rocBLAS devs for finding workaround for this problem!)
+ list(APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/hip)

Deleted: test.cpp
===================================================================
--- test.cpp    2023-02-05 15:37:52 UTC (rev 1392787)
+++ test.cpp    2023-02-05 15:38:08 UTC (rev 1392788)
@@ -1,100 +0,0 @@
-#include <rocsparse/rocsparse.h>
-#include <hip/hip_runtime.h>
-#include <iostream>
-#include <vector>
-#include <random>
-#include <algorithm>
-
-int main()
-{
-    using rint = rocsparse_int;
-    rint n = 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);};
-
-    std::vector<float> xin(n);
-    std::generate(xin.begin(), xin.end(), myrand);
-
-    rocsparse_handle handle;
-    rocsparse_create_handle(&handle); 
-
-    std::vector<rint> row_ptr(n + 1);
-    std::vector<rint> col(3 * n);
-    std::vector<float> data(3 * n);
-    
-    //Second order finite differences matrix in 1D
-    row_ptr[0] = 0;
-    for(size_t i = 0; i < n; i++){
-        rint off = row_ptr[i];
-        if(i > 0){
-            col[off] = i - 1;
-            data[off++] = -1.0f;
-        }
-        col[off] = i;
-        data[off++] = 2.0f;
-        if(i < n - 1){
-            col[off] = i + 1;
-            data[off++] = -1.0f;
-        }
-        row_ptr[i + 1] = off;
-    }
-
-    rint *rp;
-    rint *c;
-    float *d;
-
-    float *x;
-    float *y;
-    hipMalloc((void **)&rp, sizeof *rp * (n + 1));
-    hipMalloc((void **)&c, sizeof *c * 3 * n);
-    hipMalloc((void **)&d, sizeof *d * 3 * n);
-
-    hipMalloc((void **)&x, sizeof *x * n);
-    hipMalloc((void **)&y, sizeof *y * n);
-
-    hipMemcpy(rp, row_ptr.data(), sizeof *rp * (n + 1), hipMemcpyHostToDevice);
-    hipMemcpy(c, col.data(), sizeof *c * 3 * n, hipMemcpyHostToDevice);
-    hipMemcpy(d, data.data(), sizeof *d * 3 * n, hipMemcpyHostToDevice);
-
-    hipMemcpy(x, xin.data(), sizeof *x * n, hipMemcpyHostToDevice);
-
-    float alpha = 14.124f;
-    float beta = 0.0f;
-
-    rocsparse_mat_descr descr;
-    rocsparse_create_mat_descr(&descr);
-
-    rocsparse_scsrmv(handle, rocsparse_operation_none,
-        n, n, 3 * n - 2, &alpha, descr, d, rp, c, nullptr,
-        x, &beta, y);
-
-    std::vector<float> yout(n);
-    hipMemcpy(yout.data(), y, sizeof *y * n, hipMemcpyDeviceToHost);
-
-    float tol = 0.0001f;
-    for(rint i = 0; i < n; i++){
-        for(rint jj = row_ptr[i]; jj < row_ptr[i + 1]; jj++){
-            rint j = col[jj];
-            yout[i] -= alpha * data[jj] * xin[j];
-        }
-        if(std::abs(yout[i]) > tol){
-            std::cout << "Entry " << i << " is not computed correctly.\n";
-            std::cout << "Expected 0 but got " <<  yout[i] << std::endl;
-            return 1;
-        }
-    }
-
-    std::cout << "TESTS PASSED!" << std::endl;
-
-    rocsparse_destroy_handle(handle);
-    rocsparse_destroy_mat_descr(descr);
-    hipFree(rp);
-    hipFree(c);
-    hipFree(d);
-    hipFree(x);
-    hipFree(y);
-}

Copied: rocsparse/repos/community-testing-x86_64/test.cpp (from rev 1392787, 
rocsparse/trunk/test.cpp)
===================================================================
--- test.cpp                            (rev 0)
+++ test.cpp    2023-02-05 15:38:08 UTC (rev 1392788)
@@ -0,0 +1,100 @@
+#include <rocsparse/rocsparse.h>
+#include <hip/hip_runtime.h>
+#include <iostream>
+#include <vector>
+#include <random>
+#include <algorithm>
+
+int main()
+{
+    using rint = rocsparse_int;
+    rint n = 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);};
+
+    std::vector<float> xin(n);
+    std::generate(xin.begin(), xin.end(), myrand);
+
+    rocsparse_handle handle;
+    rocsparse_create_handle(&handle); 
+
+    std::vector<rint> row_ptr(n + 1);
+    std::vector<rint> col(3 * n);
+    std::vector<float> data(3 * n);
+    
+    //Second order finite differences matrix in 1D
+    row_ptr[0] = 0;
+    for(size_t i = 0; i < n; i++){
+        rint off = row_ptr[i];
+        if(i > 0){
+            col[off] = i - 1;
+            data[off++] = -1.0f;
+        }
+        col[off] = i;
+        data[off++] = 2.0f;
+        if(i < n - 1){
+            col[off] = i + 1;
+            data[off++] = -1.0f;
+        }
+        row_ptr[i + 1] = off;
+    }
+
+    rint *rp;
+    rint *c;
+    float *d;
+
+    float *x;
+    float *y;
+    hipMalloc((void **)&rp, sizeof *rp * (n + 1));
+    hipMalloc((void **)&c, sizeof *c * 3 * n);
+    hipMalloc((void **)&d, sizeof *d * 3 * n);
+
+    hipMalloc((void **)&x, sizeof *x * n);
+    hipMalloc((void **)&y, sizeof *y * n);
+
+    hipMemcpy(rp, row_ptr.data(), sizeof *rp * (n + 1), hipMemcpyHostToDevice);
+    hipMemcpy(c, col.data(), sizeof *c * 3 * n, hipMemcpyHostToDevice);
+    hipMemcpy(d, data.data(), sizeof *d * 3 * n, hipMemcpyHostToDevice);
+
+    hipMemcpy(x, xin.data(), sizeof *x * n, hipMemcpyHostToDevice);
+
+    float alpha = 14.124f;
+    float beta = 0.0f;
+
+    rocsparse_mat_descr descr;
+    rocsparse_create_mat_descr(&descr);
+
+    rocsparse_scsrmv(handle, rocsparse_operation_none,
+        n, n, 3 * n - 2, &alpha, descr, d, rp, c, nullptr,
+        x, &beta, y);
+
+    std::vector<float> yout(n);
+    hipMemcpy(yout.data(), y, sizeof *y * n, hipMemcpyDeviceToHost);
+
+    float tol = 0.0001f;
+    for(rint i = 0; i < n; i++){
+        for(rint jj = row_ptr[i]; jj < row_ptr[i + 1]; jj++){
+            rint j = col[jj];
+            yout[i] -= alpha * data[jj] * xin[j];
+        }
+        if(std::abs(yout[i]) > tol){
+            std::cout << "Entry " << i << " is not computed correctly.\n";
+            std::cout << "Expected 0 but got " <<  yout[i] << std::endl;
+            return 1;
+        }
+    }
+
+    std::cout << "TESTS PASSED!" << std::endl;
+
+    rocsparse_destroy_handle(handle);
+    rocsparse_destroy_mat_descr(descr);
+    hipFree(rp);
+    hipFree(c);
+    hipFree(d);
+    hipFree(x);
+    hipFree(y);
+}

Deleted: test.sh
===================================================================
--- test.sh     2023-02-05 15:37:52 UTC (rev 1392787)
+++ test.sh     2023-02-05 15:38:08 UTC (rev 1392788)
@@ -1,5 +0,0 @@
-#! /usr/bin/env sh
-
-OUT=$(mktemp -d)
-/opt/rocm/bin/hipcc -o "$OUT"/test test.cpp -lrocsparse
-"$OUT"/test

Copied: rocsparse/repos/community-testing-x86_64/test.sh (from rev 1392787, 
rocsparse/trunk/test.sh)
===================================================================
--- test.sh                             (rev 0)
+++ test.sh     2023-02-05 15:38:08 UTC (rev 1392788)
@@ -0,0 +1,5 @@
+#! /usr/bin/env sh
+
+OUT=$(mktemp -d)
+/opt/rocm/bin/hipcc -o "$OUT"/test test.cpp -lrocsparse
+"$OUT"/test

Reply via email to