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/rocrand] epel10: Reuse Archlinux smoke test
Date: Wed, 10 Jun 2026 23:51:56 GMT [thread overview]
Message-ID: <178113551638.1.63793643292747837.rpms-rocrand-f69f88bd5785@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/rocrand
Branch : epel10
Commit : f69f88bd578552a79798916b1dc0809023219c38
Author : Tom Rix <Tom.Rix@amd.com>
Date : 2026-02-09T08:22:16-08:00
Stats : +47/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/rocrand/c/f69f88bd578552a79798916b1dc0809023219c38?branch=epel10
Log:
Reuse Archlinux smoke test
Licensed as 0BSD
repo https://gitlab.archlinux.org/archlinux/packaging/packages/rocrand.git
commit 24bcc79a1155f3649abf937f9f96b70f0afa2f5d
Signed-off-by: Tom Rix <Tom.Rix@amd.com>
---
diff --git a/rocrand.spec b/rocrand.spec
index 27b830e..c6e84a7 100644
--- a/rocrand.spec
+++ b/rocrand.spec
@@ -128,7 +128,7 @@ Release: 1%{?dist}
Summary: ROCm random number generator
URL: https://github.com/ROCm/rocm-libraries
-License: MIT AND BSD-3-Clause
+License: MIT AND BSD-3-Clause AND 0BSD
%if %{with gitcommit}
Source0: %{url}/archive/%{commit0}/rocm-libraries-%{shortcommit0}.tar.gz
%else
diff --git a/test.cpp b/test.cpp
new file mode 100644
index 0000000..28db5d5
--- /dev/null
+++ b/test.cpp
@@ -0,0 +1,37 @@
+#include <hip/hip_runtime.h>
+#include <rocrand/rocrand.hpp>
+#include <vector>
+#include <numeric>
+#include <cmath>
+#include <iostream>
+
+int main()
+{
+ size_t size = 1024 * 1024;
+ float mean = -1.24f;
+ float std = 0.43f;
+ rocrand_generator gen;
+ rocrand_create_generator(&gen, ROCRAND_RNG_PSEUDO_XORWOW);
+
+ float *x;
+ hipMalloc((void**)&x, sizeof *x * size);
+ rocrand_generate_normal(gen, x, size, mean, std);
+
+ std::vector<float> x_d(size);
+ hipMemcpy(x_d.data(), x, sizeof *x * size, hipMemcpyDeviceToHost);
+
+ float mean_hat = std::accumulate(x_d.begin(), x_d.end(), 0.0f) / size;
+
+ // Tolerance set so that test may at most fail in 1 of 10,000 runs
+ float tol = 3e-1;
+ if(std::abs(mean - mean_hat) > tol){
+ std::cout << "Tolerance in mean not reached:\n"
+ << mean_hat << " differs more than " << tol
+ << " from " << mean << std::endl;
+ return 1;
+ }
+ std::cout << "TESTS PASSED!" << std::endl;
+
+ rocrand_destroy_generator(gen);
+ hipFree(x);
+}
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..225cc44
--- /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} -lrocrand -lamdhip64
+"$OUT"/test
reply other threads:[~2026-06-10 23:51 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=178113551638.1.63793643292747837.rpms-rocrand-f69f88bd5785@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