public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Tom Rix <Tom.Rix@amd.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rocsolver] epel10: Reuse Archlinux smoke test
Date: Fri, 12 Jun 2026 17:20:50 GMT	[thread overview]
Message-ID: <178128485000.1.12302898512123012818.rpms-rocsolver-d9f341f6b9be@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rocsolver
            Branch : epel10
            Commit : d9f341f6b9be497b0a6875e27374636ac620b419
            Author : Tom Rix <Tom.Rix@amd.com>
            Date   : 2026-02-11T09:22:49-08:00
            Stats  : +78/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/rocsolver/c/d9f341f6b9be497b0a6875e27374636ac620b419?branch=epel10

            Log:
            Reuse Archlinux smoke test

Licensed as 0BSD
repo https://gitlab.archlinux.org/archlinux/packaging/packages/rocfft.git
commit aa6e8e4c63540707601c6ef338c5b04dfd4d6f4a

Signed-off-by: Tom Rix <Tom.Rix@amd.com>

---
diff --git a/rocsolver.spec b/rocsolver.spec
index 93da727..bbf71f0 100644
--- a/rocsolver.spec
+++ b/rocsolver.spec
@@ -127,7 +127,7 @@ Summary:        Next generation LAPACK implementation for ROCm platform
 # License check reports BSD 2-Clause
 # But reviewing LICENSE.md, this is only for AMD
 # Later in the file are BSD 3-Clause for LAPACK and MAGMA
-License:        BSD-3-Clause AND BSD-2-Clause
+License:        BSD-3-Clause AND BSD-2-Clause AND 0BSD
 URL:            https://github.com/ROCm/rocm-libraries
 
 %if %{with gitcommit}

diff --git a/test.cpp b/test.cpp
new file mode 100644
index 0000000..e7968fa
--- /dev/null
+++ b/test.cpp
@@ -0,0 +1,68 @@
+#include <rocsolver/rocsolver.h>
+#include <hip/hip_runtime.h>
+#include <vector>
+#include <random>
+#include <algorithm>
+#include <cmath>
+#include <iostream>
+
+int main()
+{
+    size_t n = 128;
+    size_t size = n * n;
+
+    std::random_device rd;
+    std::mt19937 gen(rd());
+    std::uniform_real_distribution<float> dist(-1.0, 1.0);
+    auto myrand = [&](){return dist(gen);};
+
+    float *a;
+    float *x;
+    hipMalloc((void**)&a, sizeof *a * size);
+    hipMalloc((void**)&x, sizeof *x * n);
+
+    std::vector<float> ain(size);
+    std::vector<float> xin(n);
+    std::generate(ain.begin(), ain.end(), myrand);
+    std::generate(xin.begin(), xin.end(), myrand);
+
+    hipMemcpy(a, ain.data(), sizeof *a * size, hipMemcpyHostToDevice);
+    hipMemcpy(x, xin.data(), sizeof *x * n, hipMemcpyHostToDevice);
+
+    rocblas_handle handle;
+    rocblas_create_handle(&handle);
+
+    rocblas_int *info;
+    hipMalloc((void**)&info, sizeof *info);
+    rocsolver_sgels(handle, rocblas_operation_none,
+        n, n, 1, a, n, x, n, info);
+
+    std::vector<float> xout(n);
+    hipMemcpy(xout.data(), x, sizeof *x * n, hipMemcpyDeviceToHost);
+    rocblas_int hinfo;
+    hipMemcpy(&hinfo, info, sizeof *info, hipMemcpyDeviceToHost);
+
+    if(hinfo != 0){
+        std::cout << "Matrix is rank deficient!\n";
+        return 1;
+    }
+
+    float tol = 0.001f;
+    for(size_t i = 0; i < n; i++){
+        for(size_t j = 0; j < n; j++){
+            xin[i] -= ain[i + j * n] * xout[j];
+        }
+        if(std::abs(xin[i]) > tol){
+            std::cout << "Missmatch at index " << i << "\n"
+                << "Desired: 0" << "\n"
+                << "Actual : " << xin[i] << std::endl;
+            return 1;
+        }
+    }
+
+    std::cout << "TESTS PASSED!" << std::endl;
+
+    hipFree(a);
+    hipFree(x);
+    rocblas_destroy_handle(handle);
+}

diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..95843af
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,9 @@
+#! /usr/bin/env sh
+
+BPATH=/usr/bin
+IPATH=/usr/include
+LPATH=/usr/lib64
+
+OUT=$(mktemp -d)
+${BPATH}/hipcc -o "$OUT"/test test.cpp -I${IPATH} -L${LPATH} -lrocsolver -lrocblas -lamdhip64
+"$OUT"/test

                 reply	other threads:[~2026-06-12 17:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178128485000.1.12302898512123012818.rpms-rocsolver-d9f341f6b9be@fedoraproject.org \
    --to=tom.rix@amd.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox