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/hipblas] epel10: Reuse Archlinux smoke test
Date: Sat, 13 Jun 2026 22:12:19 GMT [thread overview]
Message-ID: <178138873902.1.12207589997391940879.rpms-hipblas-e5920e3c54e4@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/hipblas
Branch : epel10
Commit : e5920e3c54e4b8fbefd8b007d57f687ecca501a3
Author : Tom Rix <Tom.Rix@amd.com>
Date : 2026-02-24T13:51:55-08:00
Stats : +92/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/hipblas/c/e5920e3c54e4b8fbefd8b007d57f687ecca501a3?branch=epel10
Log:
Reuse Archlinux smoke test
Licensed as 0BSD
repo https://gitlab.archlinux.org/archlinux/packaging/packages/hipblas
commit fb354baca4df4a68ac380bbc10fd63a7d0ff6fc3
Signed-off-by: Tom Rix <Tom.Rix@amd.com>
---
diff --git a/hipblas.spec b/hipblas.spec
index a71ee33..6b81d58 100644
--- a/hipblas.spec
+++ b/hipblas.spec
@@ -87,7 +87,7 @@ Version: %{rocm_version}
Release: 3%{?dist}
%endif
Summary: ROCm BLAS marshaling library
-License: MIT
+License: MIT 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..f47a97f
--- /dev/null
+++ b/test.cpp
@@ -0,0 +1,82 @@
+#include <hipblas/hipblas.h>
+#include <hip/hip_runtime.h>
+#include <vector>
+#include <random>
+#include <algorithm>
+#include <cmath>
+#include <iostream>
+
+int main()
+{
+ size_t n = 64;
+ size_t m = 41;
+ 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 *ac;
+ int *ipiv;
+ float *x;
+ float *r;
+ hipMalloc((void**)&a, sizeof *a * size);
+ hipMalloc((void**)&ac, sizeof *ac * size);
+ hipMalloc((void**)&ipiv, sizeof *ipiv * n);
+ hipMalloc((void**)&x, sizeof *x * n * m);
+ hipMalloc((void**)&r, sizeof *r * n * m);
+
+ std::vector<float> ain(size);
+ std::vector<float> xin(n * m);
+ std::generate(ain.begin(), ain.end(), myrand);
+ std::generate(xin.begin(), xin.end(), myrand);
+
+ hipMemcpy(a, ain.data(), sizeof *a * size, hipMemcpyHostToDevice);
+ hipMemcpy(ac, ain.data(), sizeof *ac * size, hipMemcpyHostToDevice);
+ hipMemcpy(x, xin.data(), sizeof *x * n * m, hipMemcpyHostToDevice);
+ hipMemcpy(r, xin.data(), sizeof *x * n * m, hipMemcpyHostToDevice);
+
+ hipblasHandle_t handle;
+ hipblasCreate(&handle);
+
+ int *info;
+ hipMalloc((void**)&info, sizeof *info);
+
+ hipblasSgetrf(handle, n, a, n, ipiv, info);
+
+ int hinfo[1];
+ hipblasSgetrs(handle, HIPBLAS_OP_N, n, m, a, n,
+ ipiv, x, n, &hinfo[0]);
+
+ float alpha = 1.0;
+ float beta = -1.0;
+ hipblasSgemm(handle, HIPBLAS_OP_N, HIPBLAS_OP_N, n, m, n,
+ &alpha, ac, n, x, n, &beta, r, n);
+
+ std::vector<float> rout(n * m);
+ hipMemcpy(rout.data(), r, sizeof *r * n * m, hipMemcpyDeviceToHost);
+
+ float tol = 0.001f;
+ for(size_t i = 0; i < n; i++){
+ for(size_t j = 0; j < m; j++){
+ if(std::abs(rout[i]) > tol){
+ std::cout << "Missmatch at index " << i << "," << j << "\n"
+ << "Desired: 0" << "\n"
+ << "Actual : " << rout[i + j * n] << std::endl;
+ return 1;
+ }
+ }
+ }
+
+ std::cout << "TESTS PASSED!" << std::endl;
+
+ hipFree(a);
+ hipFree(ac);
+ hipFree(ipiv);
+ hipFree(x);
+ hipFree(r);
+ hipFree(info);
+ hipblasDestroy(handle);
+}
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..1382162
--- /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} -lhipblas -lrocsolver -lrocblas -lamdhip64
+"$OUT"/test
reply other threads:[~2026-06-13 22:12 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=178138873902.1.12207589997391940879.rpms-hipblas-e5920e3c54e4@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