Date: Wednesday, February 8, 2023 @ 19:20:50
Author: tpkessler
Revision: 1396527
archrelease: copy trunk to community-testing-x86_64
Added:
rocm-opencl-runtime/repos/community-testing-x86_64/PKGBUILD
(from rev 1396526, rocm-opencl-runtime/trunk/PKGBUILD)
rocm-opencl-runtime/repos/community-testing-x86_64/test.c
(from rev 1396526, rocm-opencl-runtime/trunk/test.c)
rocm-opencl-runtime/repos/community-testing-x86_64/test.sh
(from rev 1396526, rocm-opencl-runtime/trunk/test.sh)
Deleted:
rocm-opencl-runtime/repos/community-testing-x86_64/PKGBUILD
rocm-opencl-runtime/repos/community-testing-x86_64/test.c
rocm-opencl-runtime/repos/community-testing-x86_64/test.sh
----------+
PKGBUILD | 108 ++++++++++++------------
test.c | 272 ++++++++++++++++++++++++++++++-------------------------------
test.sh | 14 +--
3 files changed, 197 insertions(+), 197 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2023-02-08 19:20:40 UTC (rev 1396526)
+++ PKGBUILD 2023-02-08 19:20:50 UTC (rev 1396527)
@@ -1,54 +0,0 @@
-# Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
-# Contributor: Ranieri Althoff <ranisalt+aur at gmail dot com>
-# Contributor: acxz <akashpatel2008 at yahoo dot com>
-
-pkgname=rocm-opencl-runtime
-pkgver=5.4.2
-pkgrel=2
-pkgdesc='OpenCL implementation for AMD'
-arch=('x86_64')
-url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime'
-license=('MIT')
-depends=('hsakmt-roct' 'hsa-rocr' 'comgr' 'mesa' 'opencl-icd-loader')
-makedepends=('rocm-cmake')
-provides=('opencl-driver')
-_rocclr='https://github.com/ROCm-Developer-Tools/ROCclr'
-source=("$pkgname-$pkgver.tar.gz::$url/archive/rocm-$pkgver.tar.gz"
- "$pkgname-rocclr-$pkgver.tar.gz::$_rocclr/archive/rocm-$pkgver.tar.gz")
-sha256sums=('6b8b507fe71a6ebc3334296a3564ae325e5a9abc707c737c9d8e761e0182b1f1'
- '0eab4f21e864f061de969760811fb3806833f8f918ee9c294bc6d29f8230fefe')
-_dirname="$(basename "$url")-$(basename "${source[0]}" .tar.gz)"
-_rocclr_dir="$(basename "$_rocclr")-$(basename "${source[1]}" .tar.gz)"
-
-build() {
- cmake \
- -Wno-dev \
- -B build-rocclr \
- -S "$_rocclr_dir" \
- -DCMAKE_BUILD_TYPE=None \
- -DAMD_OPENCL_PATH="$srcdir/$_dirname"
- cmake --build build-rocclr
-
- cmake \
- -Wno-dev \
- -B build \
- -S "$_dirname" \
- -DCMAKE_BUILD_TYPE=None \
- -DCMAKE_INSTALL_PREFIX=/opt/rocm \
- -DROCM_PATH=/opt/rocm \
- -DCMAKE_PREFIX_PATH="$srcdir/$_rocclr_dir;/opt/rocm" \
- -DAMD_OPENCL_PATH="$srcdir/$_dirname"
- cmake --build build
-}
-
-package() {
- DESTDIR="$pkgdir" cmake --install build
-
- install -Dm644 "$_dirname/LICENSE.txt"
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-
- echo '/opt/rocm/lib' > "$pkgname.conf"
- install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
-
- echo '/opt/rocm/lib/libamdocl64.so' > 'amdocl64.icd'
- install -Dm644 'amdocl64.icd' "$pkgdir/etc/OpenCL/vendors/amdocl64.icd"
-}
Copied: rocm-opencl-runtime/repos/community-testing-x86_64/PKGBUILD (from rev
1396526, rocm-opencl-runtime/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2023-02-08 19:20:50 UTC (rev 1396527)
@@ -0,0 +1,54 @@
+# Maintainer: Torsten Keßler <tpkessler at archlinux dot org>
+# Contributor: Ranieri Althoff <ranisalt+aur at gmail dot com>
+# Contributor: acxz <akashpatel2008 at yahoo dot com>
+
+pkgname=rocm-opencl-runtime
+pkgver=5.4.3
+pkgrel=1
+pkgdesc='OpenCL implementation for AMD'
+arch=('x86_64')
+url='https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime'
+license=('MIT')
+depends=('hsakmt-roct' 'hsa-rocr' 'comgr' 'mesa' 'opencl-icd-loader')
+makedepends=('rocm-cmake')
+provides=('opencl-driver')
+_rocclr='https://github.com/ROCm-Developer-Tools/ROCclr'
+source=("$pkgname-$pkgver.tar.gz::$url/archive/rocm-$pkgver.tar.gz"
+ "$pkgname-rocclr-$pkgver.tar.gz::$_rocclr/archive/rocm-$pkgver.tar.gz")
+sha256sums=('b0f8339c844a2e62773bd85cd1e7c5ecddfe71d7c8e8d604e1a1d60900c30873'
+ '71d9668619ab57ec8a4564d11860438c5aad5bd161a3e58fbc49555fbd59182d')
+_dirname="$(basename "$url")-$(basename "${source[0]}" .tar.gz)"
+_rocclr_dir="$(basename "$_rocclr")-$(basename "${source[1]}" .tar.gz)"
+
+build() {
+ cmake \
+ -Wno-dev \
+ -B build-rocclr \
+ -S "$_rocclr_dir" \
+ -DCMAKE_BUILD_TYPE=None \
+ -DAMD_OPENCL_PATH="$srcdir/$_dirname"
+ cmake --build build-rocclr
+
+ cmake \
+ -Wno-dev \
+ -B build \
+ -S "$_dirname" \
+ -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_INSTALL_PREFIX=/opt/rocm \
+ -DROCM_PATH=/opt/rocm \
+ -DCMAKE_PREFIX_PATH="$srcdir/$_rocclr_dir;/opt/rocm" \
+ -DAMD_OPENCL_PATH="$srcdir/$_dirname"
+ cmake --build build
+}
+
+package() {
+ DESTDIR="$pkgdir" cmake --install build
+
+ install -Dm644 "$_dirname/LICENSE.txt"
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+ echo '/opt/rocm/lib' > "$pkgname.conf"
+ install -Dm644 "$pkgname.conf" "$pkgdir/etc/ld.so.conf.d/$pkgname.conf"
+
+ echo '/opt/rocm/lib/libamdocl64.so' > 'amdocl64.icd'
+ install -Dm644 'amdocl64.icd' "$pkgdir/etc/OpenCL/vendors/amdocl64.icd"
+}
Deleted: test.c
===================================================================
--- test.c 2023-02-08 19:20:40 UTC (rev 1396526)
+++ test.c 2023-02-08 19:20:50 UTC (rev 1396527)
@@ -1,136 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#define CL_TARGET_OPENCL_VERSION 300
-#include <CL/cl.h>
-#include <math.h>
-
-static const char *kernel_source="\n"
-"__kernel\n"
-"void square(__global float *input, __global float *output, uint n)\n"
-"{\n"
-" uint id = get_global_id(0);\n"
-" if(id < n){\n"
-" output[id] = input[id]*input[id];\n"
-" }\n"
-"}\n";
-
-int main(int argc, char *argv[])
-{
- size_t n = 1024;
-
- float *xin = malloc(sizeof *xin * n);
- for(size_t i = 0; i < n; i++){
- xin[i] = -1.0f + 2.0f * i / n;
- }
-
- cl_platform_id platform_id;
- cl_uint n_platforms;
- cl_int err = clGetPlatformIDs(1,&platform_id, &n_platforms);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Unable to get platforms\n");
- return 1;
- }
-
- cl_device_id device_id;
- cl_uint n_devs;
- err = clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, 1, &device_id,
&n_devs);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Unable to get device id\n");
- return 1;
- }
-
- cl_context_properties properties[3];
- properties[0] = CL_CONTEXT_PLATFORM;
- properties[1] = (cl_context_properties) platform_id;
- properties[2] = 0;
-
- cl_context context = clCreateContext(properties, 1, &device_id, NULL,
NULL, &err);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Creating context failed with error %d\n", err);
- return 1;
- }
-
- cl_command_queue command_queue =
clCreateCommandQueueWithProperties(context, device_id, NULL, &err);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Creating command queue failed with error %d\n", err);
- return 1;
- }
-
- cl_program program = clCreateProgramWithSource(context, 1,
&kernel_source, NULL, &err);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Creating program from source failed with error %d\n",
err);
- return 1;
- }
-
- err = clBuildProgram(program, 0, NULL, NULL, NULL, NULL);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Compiling program failed with error %d\n", err);
- return 1;
- }
-
- cl_kernel kernel = clCreateKernel(program, "square", &err);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Creating kernel failed with error %d\n", err);
- return 1;
- }
-
- cl_mem x = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof *xin * n,
NULL, &err);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Allocating read-only memory failed with error code
%d\n", err);
- return 1;
- }
- cl_mem y = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof *xin * n,
NULL, &err);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Allocating write-only memory failed with error code
%d\n", err);
- return 1;
- }
-
- err = clEnqueueWriteBuffer(command_queue, x, CL_TRUE, 0, sizeof *xin *
n, xin, 0, NULL, NULL);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Command queue finished with error code: %d\n", err);
- return 1;
- }
-
- cl_uint dim = n;
- clSetKernelArg(kernel, 0, sizeof x, &x);
- clSetKernelArg(kernel, 1, sizeof y, &y);
- clSetKernelArg(kernel, 2, sizeof dim, &dim);
-
- err = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, &n, NULL,
0, NULL, NULL);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Cannot queue kernel for execution. Error code: %d\n",
err);
- return 1;
- }
- err = clFinish(command_queue);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Command queue finished with error code: %d\n", err);
- return 1;
- }
-
- float *yout = malloc(sizeof *yout * n);
- err = clEnqueueReadBuffer(command_queue, y, CL_TRUE, 0, sizeof *yout *
n, yout, 0, NULL, NULL);
- if(err != CL_SUCCESS){
- fprintf(stderr, "Could not copy memory from device: %d\n", err);
- return 1;
- }
-
- float tol = 0.001f;
- for(size_t i = 0; i < n; i++){
- if(fabsf(yout[i] - xin[i] * xin[i]) > tol){
- printf("Mismatch at index %zu:\n", i);
- printf("Desired: %f\n", xin[i] * xin[i]);
- printf("Actual : %f\n", yout[i]);
- return 1;
- }
- }
- printf("TESTS PASSED!\n");
-
- free(xin);
- free(yout);
- clReleaseMemObject(x);
- clReleaseMemObject(y);
- clReleaseProgram(program);
- clReleaseKernel(kernel);
- clReleaseCommandQueue(command_queue);
- clReleaseContext(context);
-}
Copied: rocm-opencl-runtime/repos/community-testing-x86_64/test.c (from rev
1396526, rocm-opencl-runtime/trunk/test.c)
===================================================================
--- test.c (rev 0)
+++ test.c 2023-02-08 19:20:50 UTC (rev 1396527)
@@ -0,0 +1,136 @@
+#include <stdio.h>
+#include <stdlib.h>
+#define CL_TARGET_OPENCL_VERSION 300
+#include <CL/cl.h>
+#include <math.h>
+
+static const char *kernel_source="\n"
+"__kernel\n"
+"void square(__global float *input, __global float *output, uint n)\n"
+"{\n"
+" uint id = get_global_id(0);\n"
+" if(id < n){\n"
+" output[id] = input[id]*input[id];\n"
+" }\n"
+"}\n";
+
+int main(int argc, char *argv[])
+{
+ size_t n = 1024;
+
+ float *xin = malloc(sizeof *xin * n);
+ for(size_t i = 0; i < n; i++){
+ xin[i] = -1.0f + 2.0f * i / n;
+ }
+
+ cl_platform_id platform_id;
+ cl_uint n_platforms;
+ cl_int err = clGetPlatformIDs(1,&platform_id, &n_platforms);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Unable to get platforms\n");
+ return 1;
+ }
+
+ cl_device_id device_id;
+ cl_uint n_devs;
+ err = clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU, 1, &device_id,
&n_devs);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Unable to get device id\n");
+ return 1;
+ }
+
+ cl_context_properties properties[3];
+ properties[0] = CL_CONTEXT_PLATFORM;
+ properties[1] = (cl_context_properties) platform_id;
+ properties[2] = 0;
+
+ cl_context context = clCreateContext(properties, 1, &device_id, NULL,
NULL, &err);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Creating context failed with error %d\n", err);
+ return 1;
+ }
+
+ cl_command_queue command_queue =
clCreateCommandQueueWithProperties(context, device_id, NULL, &err);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Creating command queue failed with error %d\n", err);
+ return 1;
+ }
+
+ cl_program program = clCreateProgramWithSource(context, 1,
&kernel_source, NULL, &err);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Creating program from source failed with error %d\n",
err);
+ return 1;
+ }
+
+ err = clBuildProgram(program, 0, NULL, NULL, NULL, NULL);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Compiling program failed with error %d\n", err);
+ return 1;
+ }
+
+ cl_kernel kernel = clCreateKernel(program, "square", &err);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Creating kernel failed with error %d\n", err);
+ return 1;
+ }
+
+ cl_mem x = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof *xin * n,
NULL, &err);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Allocating read-only memory failed with error code
%d\n", err);
+ return 1;
+ }
+ cl_mem y = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof *xin * n,
NULL, &err);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Allocating write-only memory failed with error code
%d\n", err);
+ return 1;
+ }
+
+ err = clEnqueueWriteBuffer(command_queue, x, CL_TRUE, 0, sizeof *xin *
n, xin, 0, NULL, NULL);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Command queue finished with error code: %d\n", err);
+ return 1;
+ }
+
+ cl_uint dim = n;
+ clSetKernelArg(kernel, 0, sizeof x, &x);
+ clSetKernelArg(kernel, 1, sizeof y, &y);
+ clSetKernelArg(kernel, 2, sizeof dim, &dim);
+
+ err = clEnqueueNDRangeKernel(command_queue, kernel, 1, NULL, &n, NULL,
0, NULL, NULL);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Cannot queue kernel for execution. Error code: %d\n",
err);
+ return 1;
+ }
+ err = clFinish(command_queue);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Command queue finished with error code: %d\n", err);
+ return 1;
+ }
+
+ float *yout = malloc(sizeof *yout * n);
+ err = clEnqueueReadBuffer(command_queue, y, CL_TRUE, 0, sizeof *yout *
n, yout, 0, NULL, NULL);
+ if(err != CL_SUCCESS){
+ fprintf(stderr, "Could not copy memory from device: %d\n", err);
+ return 1;
+ }
+
+ float tol = 0.001f;
+ for(size_t i = 0; i < n; i++){
+ if(fabsf(yout[i] - xin[i] * xin[i]) > tol){
+ printf("Mismatch at index %zu:\n", i);
+ printf("Desired: %f\n", xin[i] * xin[i]);
+ printf("Actual : %f\n", yout[i]);
+ return 1;
+ }
+ }
+ printf("TESTS PASSED!\n");
+
+ free(xin);
+ free(yout);
+ clReleaseMemObject(x);
+ clReleaseMemObject(y);
+ clReleaseProgram(program);
+ clReleaseKernel(kernel);
+ clReleaseCommandQueue(command_queue);
+ clReleaseContext(context);
+}
Deleted: test.sh
===================================================================
--- test.sh 2023-02-08 19:20:40 UTC (rev 1396526)
+++ test.sh 2023-02-08 19:20:50 UTC (rev 1396527)
@@ -1,7 +0,0 @@
-#!/usr/bin/env sh
-
-OUT=$(mktemp -d)
-CC=/usr/bin/gcc
-
-$CC -o "$OUT/test" test.c -L/opt/rocm/lib -lOpenCL -lm
-"$OUT"/test
Copied: rocm-opencl-runtime/repos/community-testing-x86_64/test.sh (from rev
1396526, rocm-opencl-runtime/trunk/test.sh)
===================================================================
--- test.sh (rev 0)
+++ test.sh 2023-02-08 19:20:50 UTC (rev 1396527)
@@ -0,0 +1,7 @@
+#!/usr/bin/env sh
+
+OUT=$(mktemp -d)
+CC=/usr/bin/gcc
+
+$CC -o "$OUT/test" test.c -L/opt/rocm/lib -lOpenCL -lm
+"$OUT"/test