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/rocprim] epel10: Reuse Archlinux smoke test
Date: Thu, 11 Jun 2026 12:46:47 GMT	[thread overview]
Message-ID: <178118200746.1.2048510312303616655.rpms-rocprim-cad0756d5980@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rocprim
            Branch : epel10
            Commit : cad0756d598036a9183aa237c2029d85402773b9
            Author : Tom Rix <Tom.Rix@amd.com>
            Date   : 2026-02-11T06:07:24-08:00
            Stats  : +72/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/rocprim/c/cad0756d598036a9183aa237c2029d85402773b9?branch=epel10

            Log:
            Reuse Archlinux smoke test

Licensed as 0BSD
repo https://gitlab.archlinux.org/archlinux/packaging/packages/rocprim.git
commit 6e8a06bf949a69e49bb2700c1a04edf9fc5cdd79

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

---
diff --git a/rocprim.spec b/rocprim.spec
index cfc9be0..897bfc8 100644
--- a/rocprim.spec
+++ b/rocprim.spec
@@ -84,7 +84,7 @@ Release:        1%{?dist}
 %endif
 Summary:        ROCm parallel primatives
 
-License:        MIT AND BSD-3-Clause
+License:        MIT AND BSD-3-Clause AND 0BSD
 URL:            https://github.com/ROCm/rocm-libraries
 %if %{with gitcommit}
 Source0:        %{url}/archive/%{commit0}/rocm-libraries-%{shortcommit0}.tar.gz

diff --git a/test.cpp b/test.cpp
new file mode 100644
index 0000000..07482e4
--- /dev/null
+++ b/test.cpp
@@ -0,0 +1,62 @@
+// HACK rocprim complains about a missing host implementation of memset.
+// We provide it by first including string.h from the C standard library
+#include <cstring>
+#include <rocprim/rocprim.hpp>
+#include <vector>
+#include <iostream>
+#include <random>
+#include <algorithm>
+#include <cmath>
+
+int main()
+{
+    auto xpy = [] __device__(float x, float y) -> float{
+        return x + y;
+    };
+
+    size_t size = 1024;
+    std::vector<float> xin(size);
+    std::vector<float> yin(size);
+
+    std::random_device rd;
+    std::mt19937 gen(rd());
+    std::uniform_real_distribution<float> dist(-1.0, 1.0);
+
+    auto myrand = [&]() -> float {return dist(gen);};
+
+    std::generate(xin.begin(), xin.end(), myrand);
+    std::generate(yin.begin(), yin.end(), myrand);
+
+    std::vector<float> zref(size);
+    for(size_t i = 0; i < size; i++){
+        zref[i] = xin[i] + yin[i];
+    }
+
+    float *x;
+    float *y;
+    float *z;
+    hipMalloc((void**)&x, sizeof *x * size);
+    hipMalloc((void**)&y, sizeof *y * size);
+    hipMalloc((void**)&z, sizeof *z * size);
+
+    hipMemcpy(x, xin.data(), sizeof *x * size, hipMemcpyHostToDevice);
+    hipMemcpy(y, yin.data(), sizeof *y * size, hipMemcpyHostToDevice);
+
+    rocprim::transform(x, y, z, size, xpy);
+
+    std::vector<float> zout(size);
+    hipMemcpy(zout.data(), z, sizeof *z * size, hipMemcpyDeviceToHost);
+
+    for(size_t i = 0; i < size; i++){
+        if(std::abs(zout[i] - zref[i]) > 0.001f){
+            std::cout << "Element mismatch at index " << i << "\n";
+            std::cout << "Got " << zout[i] << " but expected " << zref[i] << "\n";
+            return 1;
+        }
+    }
+    std::cout << "TESTS PASSED!" << std::endl;
+
+    hipFree(x);
+    hipFree(y);
+    hipFree(z);
+}

diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..4cdf5fc
--- /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} -lamdhip64
+"$OUT"/test

                 reply	other threads:[~2026-06-11 12:46 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=178118200746.1.2048510312303616655.rpms-rocprim-cad0756d5980@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