public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rocblas] epel10: Reuse Archlinux smoke test
@ 2026-06-11 14:33 Tom Rix
0 siblings, 0 replies; only message in thread
From: Tom Rix @ 2026-06-11 14:33 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rocblas
Branch : epel10
Commit : 0c10f594477be9ee8f5e5ac4244164a347b9a5dd
Author : Tom Rix <Tom.Rix@amd.com>
Date : 2026-02-11T05:34:18-08:00
Stats : +80/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/rocblas/c/0c10f594477be9ee8f5e5ac4244164a347b9a5dd?branch=epel10
Log:
Reuse Archlinux smoke test
Licensed as 0BSD
repo https://gitlab.archlinux.org/archlinux/packaging/packages/rocblas.git
commit a288b68c0235b7dcf3815aaa843be537622162d5
Signed-off-by: Tom Rix <Tom.Rix@amd.com>
---
diff --git a/rocblas.spec b/rocblas.spec
index c316f63..f7335f5 100644
--- a/rocblas.spec
+++ b/rocblas.spec
@@ -155,7 +155,7 @@
Name: rocblas%{pkg_suffix}
Summary: BLAS implementation for ROCm
-License: MIT AND BSD-3-Clause
+License: MIT AND BSD-3-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..5870f60
--- /dev/null
+++ b/test.cpp
@@ -0,0 +1,70 @@
+#include <rocblas/rocblas.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 *x;
+ float *y;
+ float *z;
+ hipMalloc((void**)&x, sizeof *x * size);
+ hipMalloc((void**)&y, sizeof *y * size);
+ hipMalloc((void**)&z, sizeof *z * size);
+
+ std::vector<float> xin(size);
+ std::vector<float> yin(size);
+
+ std::generate(xin.begin(), xin.end(), myrand);
+ std::generate(yin.begin(), yin.end(), myrand);
+
+ hipMemcpy(x, xin.data(), sizeof *x * size, hipMemcpyHostToDevice);
+ hipMemcpy(y, yin.data(), sizeof *x * size, hipMemcpyHostToDevice);
+
+ rocblas_handle handle;
+ rocblas_create_handle(&handle);
+
+ float alpha = 15.412f;
+ float beta = 0.0f;
+ rocblas_sgemm(handle, rocblas_operation_none, rocblas_operation_none,
+ n, n, n, &alpha, x, n, y, n, &beta, z, n);
+
+ std::vector<float> zout(size);
+ hipMemcpy(zout.data(), z, sizeof *z * size, hipMemcpyDeviceToHost);
+
+ for(size_t j = 0; j < n; j++){
+ for(size_t i = 0; i < n; i++){
+ for(size_t k = 0; k < n; k++){
+ zout[i + j * n] -= alpha * xin[i + k * n] * yin[k + j * n];
+ }
+ }
+ }
+
+ float tol = 0.001f;
+ for(size_t i = 0; i < size; i++){
+ if(std::abs(zout[i]) > tol){
+ std::cout << "Element mismatch at index " << i << "\n";
+ std::cout << "Expected: 0\n";
+ std::cout << "Actual : " << zout[i] << "\n";
+ return 1;
+ }
+ }
+
+ std::cout << "TESTS PASSED!" << std::endl;
+
+ hipFree(x);
+ hipFree(y);
+ hipFree(z);
+ rocblas_destroy_handle(handle);
+}
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..92fbdb1
--- /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} -lrocblas -lamdhip64
+"$OUT"/test
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-11 14:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-11 14:33 [rpms/rocblas] 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