public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rocsolver] epel10: Reuse Archlinux smoke test
@ 2026-06-12 17:20 Tom Rix
0 siblings, 0 replies; only message in thread
From: Tom Rix @ 2026-06-12 17:20 UTC (permalink / raw)
To: git-commits
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-12 17:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-12 17:20 [rpms/rocsolver] epel10: Reuse Archlinux smoke test Tom Rix
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox