Date: Sunday, February 5, 2023 @ 15:43:05
  Author: tpkessler
Revision: 1392790

archrelease: copy trunk to community-testing-x86_64

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

------------------------+
 PKGBUILD               |   98 +++++++++++------------
 hipsparse-no-git.patch |   46 +++++-----
 test.cpp               |  198 +++++++++++++++++++++++------------------------
 test.sh                |   10 +-
 4 files changed, 176 insertions(+), 176 deletions(-)

Deleted: PKGBUILD
===================================================================
--- PKGBUILD    2023-02-05 15:42:50 UTC (rev 1392789)
+++ PKGBUILD    2023-02-05 15:43:05 UTC (rev 1392790)
@@ -1,49 +0,0 @@
-# Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
-# Contributor: Markus Näther <[email protected]>
-# Contributor: acxz <akashpatel2008 at yahoo dot com>
-
-pkgname=hipsparse
-pkgver=5.4.2
-pkgrel=1
-pkgdesc='rocSPARSE marshalling library.'
-arch=('x86_64')
-url='https://hipsparse.readthedocs.io/en/latest/'
-license=('MIT')
-depends=('hip' 'rocsparse')
-makedepends=('rocm-cmake' 'gcc-fortran')
-_git='https://github.com/ROCmSoftwarePlatform/hipSPARSE'
-source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz"
-        "hipsparse-no-git.patch")
-sha256sums=('403c85d1f4622495168182b33723492bf94516bff23b7669e59728f0fb802e30'
-            '0f4ca37b246e9908ebb3a80818abb28b4c6996036b65f8f89be9affc854efa7f')
-options=(!lto)
-_dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")"
-
-prepare() {
-    cd "$_dirname"
-    patch -Np1 -i "$srcdir/hipsparse-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" \
-  HIP_PATH=/opt/rocm \
-  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/$pkgname/lib" > "$pkgname.conf"
-  install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
-
-  install -Dm644 "$srcdir/$_dirname/LICENSE.md" 
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}

Copied: hipsparse/repos/community-testing-x86_64/PKGBUILD (from rev 1392789, 
hipsparse/trunk/PKGBUILD)
===================================================================
--- PKGBUILD                            (rev 0)
+++ PKGBUILD    2023-02-05 15:43:05 UTC (rev 1392790)
@@ -0,0 +1,49 @@
+# Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
+# Contributor: Markus Näther <[email protected]>
+# Contributor: acxz <akashpatel2008 at yahoo dot com>
+
+pkgname=hipsparse
+pkgver=5.4.2
+pkgrel=2
+pkgdesc='rocSPARSE marshalling library.'
+arch=('x86_64')
+url='https://hipsparse.readthedocs.io/en/latest/'
+license=('MIT')
+depends=('hip' 'rocsparse')
+makedepends=('rocm-cmake' 'gcc-fortran')
+_git='https://github.com/ROCmSoftwarePlatform/hipSPARSE'
+source=("$pkgname-$pkgver.tar.gz::$_git/archive/rocm-$pkgver.tar.gz"
+        "hipsparse-no-git.patch")
+sha256sums=('403c85d1f4622495168182b33723492bf94516bff23b7669e59728f0fb802e30'
+            '0f4ca37b246e9908ebb3a80818abb28b4c6996036b65f8f89be9affc854efa7f')
+options=(!lto)
+_dirname="$(basename "$_git")-$(basename "${source[0]}" ".tar.gz")"
+
+prepare() {
+    cd "$_dirname"
+    patch -Np1 -i "$srcdir/hipsparse-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" \
+  HIP_PATH=/opt/rocm \
+  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/$pkgname/lib" > "$pkgname.conf"
+  install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
+
+  install -Dm644 "$srcdir/$_dirname/LICENSE.md" 
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}

Deleted: hipsparse-no-git.patch
===================================================================
--- hipsparse-no-git.patch      2023-02-05 15:42:50 UTC (rev 1392789)
+++ hipsparse-no-git.patch      2023-02-05 15:43:05 UTC (rev 1392790)
@@ -1,23 +0,0 @@
-From 23704c1257747f325a1f3db4e9c35f2d6ba724ad Mon Sep 17 00:00:00 2001
-From: Cory Bloor <[email protected]>
-Date: Mon, 14 Nov 2022 02:38:03 -0700
-Subject: [PATCH] Remove Git from build requirements (#286)
-
----
- cmake/Dependencies.cmake | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
-index 5939a78d..51523b89 100644
---- a/cmake/Dependencies.cmake
-+++ b/cmake/Dependencies.cmake
-@@ -23,9 +23,6 @@
- 
- # Dependencies
- 
--# Git
--find_package(Git REQUIRED)
--
- if( NOT DEFINED ENV{HIP_PATH})
-     if(WIN32)
-         set( HIP_PATH "C:/hip" )

Copied: hipsparse/repos/community-testing-x86_64/hipsparse-no-git.patch (from 
rev 1392789, hipsparse/trunk/hipsparse-no-git.patch)
===================================================================
--- hipsparse-no-git.patch                              (rev 0)
+++ hipsparse-no-git.patch      2023-02-05 15:43:05 UTC (rev 1392790)
@@ -0,0 +1,23 @@
+From 23704c1257747f325a1f3db4e9c35f2d6ba724ad Mon Sep 17 00:00:00 2001
+From: Cory Bloor <[email protected]>
+Date: Mon, 14 Nov 2022 02:38:03 -0700
+Subject: [PATCH] Remove Git from build requirements (#286)
+
+---
+ cmake/Dependencies.cmake | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index 5939a78d..51523b89 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -23,9 +23,6 @@
+ 
+ # Dependencies
+ 
+-# Git
+-find_package(Git REQUIRED)
+-
+ if( NOT DEFINED ENV{HIP_PATH})
+     if(WIN32)
+         set( HIP_PATH "C:/hip" )

Deleted: test.cpp
===================================================================
--- test.cpp    2023-02-05 15:42:50 UTC (rev 1392789)
+++ test.cpp    2023-02-05 15:43:05 UTC (rev 1392790)
@@ -1,99 +0,0 @@
-#include <hipsparse/hipsparse.h>
-#include <hip/hip_runtime.h>
-#include <iostream>
-#include <vector>
-#include <random>
-#include <algorithm>
-
-int main()
-{
-    int 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);
-
-    hipsparseHandle_t handle;
-    hipsparseCreate(&handle);
-
-    std::vector<int> row_ptr(n + 1);
-    std::vector<int> 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++){
-        int 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;
-    }
-
-    int *rp;
-    int *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;
-
-    hipsparseMatDescr_t descr;
-    hipsparseCreateMatDescr(&descr);
-
-    hipsparseScsrmv(handle, HIPSPARSE_OPERATION_NON_TRANSPOSE,
-        n, n, 3 * n - 2, &alpha, descr, d, rp, c,
-        x, &beta, y);
-
-    std::vector<float> yout(n);
-    hipMemcpy(yout.data(), y, sizeof *y * n, hipMemcpyDeviceToHost);
-
-    float tol = 0.0001f;
-    for(int i = 0; i < n; i++){
-        for(int jj = row_ptr[i]; jj < row_ptr[i + 1]; jj++){
-            int 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;
-
-    hipsparseDestroy(handle);
-    hipsparseDestroyMatDescr(descr);
-    hipFree(rp);
-    hipFree(c);
-    hipFree(d);
-    hipFree(x);
-    hipFree(y);
-}

Copied: hipsparse/repos/community-testing-x86_64/test.cpp (from rev 1392789, 
hipsparse/trunk/test.cpp)
===================================================================
--- test.cpp                            (rev 0)
+++ test.cpp    2023-02-05 15:43:05 UTC (rev 1392790)
@@ -0,0 +1,99 @@
+#include <hipsparse/hipsparse.h>
+#include <hip/hip_runtime.h>
+#include <iostream>
+#include <vector>
+#include <random>
+#include <algorithm>
+
+int main()
+{
+    int 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);
+
+    hipsparseHandle_t handle;
+    hipsparseCreate(&handle);
+
+    std::vector<int> row_ptr(n + 1);
+    std::vector<int> 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++){
+        int 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;
+    }
+
+    int *rp;
+    int *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;
+
+    hipsparseMatDescr_t descr;
+    hipsparseCreateMatDescr(&descr);
+
+    hipsparseScsrmv(handle, HIPSPARSE_OPERATION_NON_TRANSPOSE,
+        n, n, 3 * n - 2, &alpha, descr, d, rp, c,
+        x, &beta, y);
+
+    std::vector<float> yout(n);
+    hipMemcpy(yout.data(), y, sizeof *y * n, hipMemcpyDeviceToHost);
+
+    float tol = 0.0001f;
+    for(int i = 0; i < n; i++){
+        for(int jj = row_ptr[i]; jj < row_ptr[i + 1]; jj++){
+            int 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;
+
+    hipsparseDestroy(handle);
+    hipsparseDestroyMatDescr(descr);
+    hipFree(rp);
+    hipFree(c);
+    hipFree(d);
+    hipFree(x);
+    hipFree(y);
+}

Deleted: test.sh
===================================================================
--- test.sh     2023-02-05 15:42:50 UTC (rev 1392789)
+++ test.sh     2023-02-05 15:43:05 UTC (rev 1392790)
@@ -1,5 +0,0 @@
-#! /usr/bin/env sh
-
-OUT=$(mktemp -d)
-/opt/rocm/bin/hipcc -o "$OUT"/test test.cpp -lhipsparse -lrocsparse
-"$OUT"/test

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

Reply via email to