pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/parallel/ocl-icd add parallel/ocl-icd



details:   https://anonhg.NetBSD.org/pkgsrc/rev/31e088f7eef8
branches:  trunk
changeset: 454350:31e088f7eef8
user:      nia <nia%pkgsrc.org@localhost>
date:      Thu Jun 10 05:55:42 2021 +0000

description:
add parallel/ocl-icd

This package aims at creating an Open Source alternative to vendor specific
OpenCL ICD loaders.

The main difficulties to create such software is that the order of function
pointers in a structure is not publicy available.

This software maintains a YAML database of all known and guessed entries.

diffstat:

 parallel/ocl-icd/DESCR                                                                 |    7 +
 parallel/ocl-icd/Makefile                                                              |   29 +
 parallel/ocl-icd/PLIST                                                                 |    9 +
 parallel/ocl-icd/buildlink3.mk                                                         |   14 +
 parallel/ocl-icd/distinfo                                                              |   22 +
 parallel/ocl-icd/patches/patch-icd__generator.rb                                       |   26 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl.h                                 |  112 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__d3d10.h                          |   58 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__d3d11.h                          |   58 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__dx9__media__sharing.h            |  121 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__egl.h                            |   44 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__ext.h                            |  574 +++++
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__gl.h                             |   66 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__gl__ext.h                        |   44 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__icd.h                            |  997 ++++++++++
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__layer.h                          |   26 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__platform.h                       |  181 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__va__api__media__sharing__intel.h |   84 +
 parallel/ocl-icd/patches/patch-khronos-headers_CL_opencl.h                             |   23 +
 parallel/ocl-icd/patches/patch-ocl__interface.yaml                                     |   40 +
 parallel/ocl-icd/patches/patch-run__dummy__icd.c                                       |   16 +
 21 files changed, 2551 insertions(+), 0 deletions(-)

diffs (truncated from 2635 to 300 lines):

diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/DESCR    Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,7 @@
+This package aims at creating an Open Source alternative to vendor specific
+OpenCL ICD loaders.
+
+The main difficulties to create such software is that the order of function
+pointers in a structure is not publicy available.
+
+This software maintains a YAML database of all known and guessed entries.
diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/Makefile Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,29 @@
+# $NetBSD: Makefile,v 1.1 2021/06/10 05:55:42 nia Exp $
+
+DISTNAME=      ocl-icd-2.3.0
+CATEGORIES=    parallel
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=OCL-dev/}
+GITHUB_TAG=    v${PKGVERSION_NOREV}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/OCL-dev/ocl-icd
+COMMENT=       OpenCL ICD Loader
+LICENSE=       2-clause-bsd
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL=   yes
+
+USE_TOOLS+=    autoconf autoreconf automake
+USE_TOOLS+=    gmake
+
+TOOL_DEPENDS+= asciidoc-[0-9]*:../../textproc/asciidoc
+TOOL_DEPENDS+= xmlto-[0-9]*:../../textproc/xmlto
+
+PKGCONFIG_OVERRIDE+=   OpenCL.pc.in
+PKGCONFIG_OVERRIDE+=   ocl-icd.pc.in
+
+pre-configure:
+       cd ${WRKSRC} && autoreconf -fi
+
+.include "../../parallel/opencl-headers/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/PLIST    Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,9 @@
+@comment $NetBSD: PLIST,v 1.1 2021/06/10 05:55:42 nia Exp $
+include/ocl_icd.h
+lib/libOpenCL.la
+lib/pkgconfig/OpenCL.pc
+lib/pkgconfig/ocl-icd.pc
+man/man7/libOpenCL.7
+man/man7/libOpenCL.so.7
+share/doc/ocl-icd/examples/ocl_icd_bindings.c
+share/doc/ocl-icd/html/libOpenCL.html
diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/buildlink3.mk    Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/06/10 05:55:42 nia Exp $
+
+BUILDLINK_TREE+=       ocl-icd
+
+.if !defined(OCL_ICD_BUILDLINK3_MK)
+OCL_ICD_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.ocl-icd+=        ocl-icd>=2.3.0
+BUILDLINK_PKGSRCDIR.ocl-icd?=  ../../parallel/ocl-icd
+
+.include "../../parallel/opencl-headers/buildlink3.mk"
+.endif # OCL_ICD_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -ocl-icd
diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/distinfo Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,22 @@
+$NetBSD: distinfo,v 1.1 2021/06/10 05:55:42 nia Exp $
+
+SHA1 (ocl-icd-2.3.0.tar.gz) = 4ccf5706c8cf09c63dd56fef57c2bf9c70a5288f
+RMD160 (ocl-icd-2.3.0.tar.gz) = d72a75a2ff12c9cf30f8b91c65782473947ee633
+SHA512 (ocl-icd-2.3.0.tar.gz) = 003f3661b7086a7364e79d1058591f12a7095aa2c3decfc4b496f00a0863a91cd81080f33b9308e3948045f8aca5856868ed2725f478654230e51a60d654e613
+Size (ocl-icd-2.3.0.tar.gz) = 100848 bytes
+SHA1 (patch-icd__generator.rb) = d4522e8b264a3eb944f019e7139598e3ac6dc371
+SHA1 (patch-khronos-headers_CL_cl.h) = 016b3e07fc529b104530d29826b1375e8b0c4745
+SHA1 (patch-khronos-headers_CL_cl__d3d10.h) = efbd00d2ffae3e24a2d5671835d474f7c813da20
+SHA1 (patch-khronos-headers_CL_cl__d3d11.h) = 8865f5e4fafbf7216a212fc91e372a0f76772025
+SHA1 (patch-khronos-headers_CL_cl__dx9__media__sharing.h) = c70eec07f90db0b034c4c8e8761051a6967606c3
+SHA1 (patch-khronos-headers_CL_cl__egl.h) = 2426e022486e39f5e418d7d509fb7fe98c3c8697
+SHA1 (patch-khronos-headers_CL_cl__ext.h) = aa19f68954d390348dc4c85058d8b78e91d943c3
+SHA1 (patch-khronos-headers_CL_cl__gl.h) = 21707229aea5e2268af6ff49e5fc9ac834f7579b
+SHA1 (patch-khronos-headers_CL_cl__gl__ext.h) = 6daced51363b5157f66025c119ec9a08d68bfb2d
+SHA1 (patch-khronos-headers_CL_cl__icd.h) = ed0a46b8c1260b43f1578e07e34e0a5dbe53b5e6
+SHA1 (patch-khronos-headers_CL_cl__layer.h) = d1b0ae935c4eed12076d7e4da956626e38e93841
+SHA1 (patch-khronos-headers_CL_cl__platform.h) = 4010d874b9c25a8701c52460c8de822cf579c8c2
+SHA1 (patch-khronos-headers_CL_cl__va__api__media__sharing__intel.h) = 98a6605f15a7e583eacae59fd522f94ca01a51e6
+SHA1 (patch-khronos-headers_CL_opencl.h) = 2aa2d9b484252906f0ed82d176a95bb86614c617
+SHA1 (patch-ocl__interface.yaml) = 41a400fdb541220de5a296e099bb646b00f189a3
+SHA1 (patch-run__dummy__icd.c) = b60c3b48730402ed8434dd2434e013dd1c26388e
diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/patches/patch-icd__generator.rb
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/patches/patch-icd__generator.rb  Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,26 @@
+$NetBSD: patch-icd__generator.rb,v 1.1 2021/06/10 05:55:42 nia Exp $
+
+[PATCH] Updated to support latest Khronos headers.
+
+Signed-off-by: Laurent Carlier <lordheavym%gmail.com@localhost>
+
+--- icd_generator.rb.orig      2021-03-30 16:10:38.000000000 +0000
++++ icd_generator.rb
+@@ -57,7 +57,7 @@ module IcdGenerator
+                          "clGetGLContextInfoKHR", "clUnloadCompiler",
+     "clCreateContext", "clCreateContextFromType", "clWaitForEvents"]
+   $header_files = ["/usr/include/CL/cl.h", "/usr/include/CL/cl_gl.h", "/usr/include/CL/cl_egl.h",
+-    "/usr/include/CL/cl_ext.h", "/usr/include/CL/cl_gl_ext.h"]
++    "/usr/include/CL/cl_ext.h"]
+   $windows_header_files = ["/usr/include/CL/cl_dx9_media_sharing.h", "/usr/include/CL/cl_d3d11.h", "/usr/include/CL/cl_d3d10.h"]
+   $cl_data_type_error = { "cl_platform_id"   => "CL_INVALID_PLATFORM",
+                           "cl_device_id"     => "CL_INVALID_DEVICE",
+@@ -246,7 +246,7 @@ EOF
+     run_dummy_icd += "\n\n"
+     $api_entries.each_key { |func_name|
+        next if $forbidden_funcs.include?(func_name)
+-       run_dummy_icd += $api_entries[func_name]+";\n"
++       run_dummy_icd += $api_entries[func_name]+"\n"
+     }
+     run_dummy_icd += "\n\n"
+     run_dummy_icd += "void call_all_OpenCL_functions(cl_platform_id chosen_platform) {\n"
diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/patches/patch-khronos-headers_CL_cl.h    Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,112 @@
+$NetBSD: patch-khronos-headers_CL_cl.h,v 1.1 2021/06/10 05:55:42 nia Exp $
+
+[PATCH] Updated to support latest Khronos headers.
+
+Signed-off-by: Laurent Carlier <lordheavym%gmail.com@localhost>
+
+--- khronos-headers/CL/cl.h.orig       2021-03-30 16:10:38.000000000 +0000
++++ khronos-headers/CL/cl.h
+@@ -1311,11 +1311,11 @@ clLinkProgram(cl_context           conte
+ 
+ #ifdef CL_VERSION_2_2
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_2_2_DEPRECATED cl_int CL_API_CALL
+ clSetProgramReleaseCallback(cl_program          program,
+                             void (CL_CALLBACK * pfn_notify)(cl_program program,
+                                                             void * user_data),
+-                            void *              user_data) CL_EXT_SUFFIX__VERSION_2_2_DEPRECATED;
++                            void *              user_data) CL_API_SUFFIX__VERSION_2_2_DEPRECATED;
+ 
+ extern CL_API_ENTRY cl_int CL_API_CALL
+ clSetProgramSpecializationConstant(cl_program  program,
+@@ -1857,11 +1857,11 @@ clGetExtensionFunctionAddressForPlatform
+     clSetCommandQueueProperty(cl_command_queue              command_queue,
+                               cl_command_queue_properties   properties,
+                               cl_bool                       enable,
+-                              cl_command_queue_properties * old_properties) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED;
++                              cl_command_queue_properties * old_properties) CL_API_SUFFIX__VERSION_1_0_DEPRECATED;
+ #endif /* CL_USE_DEPRECATED_OPENCL_1_0_APIS */
+ 
+ /* Deprecated OpenCL 1.1 APIs */
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
+ clCreateImage2D(cl_context              context,
+                 cl_mem_flags            flags,
+                 const cl_image_format * image_format,
+@@ -1869,9 +1869,9 @@ clCreateImage2D(cl_context              
+                 size_t                  image_height,
+                 size_t                  image_row_pitch,
+                 void *                  host_ptr,
+-                cl_int *                errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++                cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_mem CL_API_CALL
+ clCreateImage3D(cl_context              context,
+                 cl_mem_flags            flags,
+                 const cl_image_format * image_format,
+@@ -1881,46 +1881,46 @@ clCreateImage3D(cl_context              
+                 size_t                  image_row_pitch,
+                 size_t                  image_slice_pitch,
+                 void *                  host_ptr,
+-                cl_int *                errcode_ret) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++                cl_int *                errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
+ clEnqueueMarker(cl_command_queue    command_queue,
+-                cl_event *          event) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++                cl_event *          event) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
+ clEnqueueWaitForEvents(cl_command_queue  command_queue,
+                         cl_uint          num_events,
+-                        const cl_event * event_list) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++                        const cl_event * event_list) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
+-clEnqueueBarrier(cl_command_queue command_queue) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++clEnqueueBarrier(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
+-clUnloadCompiler(void) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED cl_int CL_API_CALL
++clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
+-clGetExtensionFunctionAddress(const char * func_name) CL_EXT_SUFFIX__VERSION_1_1_DEPRECATED;
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_1_DEPRECATED void * CL_API_CALL
++clGetExtensionFunctionAddress(const char * func_name) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
+ 
+ /* Deprecated OpenCL 2.0 APIs */
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_command_queue CL_API_CALL
+ clCreateCommandQueue(cl_context                     context,
+                      cl_device_id                   device,
+                      cl_command_queue_properties    properties,
+-                     cl_int *                       errcode_ret) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
++                     cl_int *                       errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_sampler CL_API_CALL
+ clCreateSampler(cl_context          context,
+                 cl_bool             normalized_coords,
+                 cl_addressing_mode  addressing_mode,
+                 cl_filter_mode      filter_mode,
+-                cl_int *            errcode_ret) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
++                cl_int *            errcode_ret) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
+ 
+-extern CL_API_ENTRY CL_EXT_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL
++extern CL_API_ENTRY CL_API_PREFIX__VERSION_1_2_DEPRECATED cl_int CL_API_CALL
+ clEnqueueTask(cl_command_queue  command_queue,
+               cl_kernel         kernel,
+               cl_uint           num_events_in_wait_list,
+               const cl_event *  event_wait_list,
+-              cl_event *        event) CL_EXT_SUFFIX__VERSION_1_2_DEPRECATED;
++              cl_event *        event) CL_API_SUFFIX__VERSION_1_2_DEPRECATED;
+ 
+ #ifdef __cplusplus
+ }
diff -r ea944d42f82a -r 31e088f7eef8 parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__d3d10.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/parallel/ocl-icd/patches/patch-khronos-headers_CL_cl__d3d10.h     Thu Jun 10 05:55:42 2021 +0000
@@ -0,0 +1,58 @@
+$NetBSD: patch-khronos-headers_CL_cl__d3d10.h,v 1.1 2021/06/10 05:55:42 nia Exp $
+
+[PATCH] Updated to support latest Khronos headers.
+
+Signed-off-by: Laurent Carlier <lordheavym%gmail.com@localhost>
+
+--- khronos-headers/CL/cl_d3d10.h.orig 2021-03-30 16:10:38.000000000 +0000
++++ khronos-headers/CL/cl_d3d10.h
+@@ -75,7 +75,7 @@ typedef cl_uint cl_d3d10_device_set_khr;
+ 
+ /******************************************************************************/
+ 
+-typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
++typedef cl_int (CL_API_CALL *clGetDeviceIDsFromD3D10KHR_fn)(
+     cl_platform_id             platform,
+     cl_d3d10_device_source_khr d3d_device_source,
+     void *                     d3d_object,
+@@ -84,27 +84,27 @@ typedef CL_API_ENTRY cl_int (CL_API_CALL
+     cl_device_id *             devices,
+     cl_uint *                  num_devices) CL_API_SUFFIX__VERSION_1_0;
+ 
+-typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
++typedef cl_mem (CL_API_CALL *clCreateFromD3D10BufferKHR_fn)(
+     cl_context     context,
+     cl_mem_flags   flags,
+     ID3D10Buffer * resource,
+     cl_int *       errcode_ret) CL_API_SUFFIX__VERSION_1_0;
+ 
+-typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
++typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture2DKHR_fn)(
+     cl_context        context,
+     cl_mem_flags      flags,
+     ID3D10Texture2D * resource,
+     UINT              subresource,
+     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
+ 
+-typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
++typedef cl_mem (CL_API_CALL *clCreateFromD3D10Texture3DKHR_fn)(
+     cl_context        context,
+     cl_mem_flags      flags,
+     ID3D10Texture3D * resource,
+     UINT              subresource,
+     cl_int *          errcode_ret) CL_API_SUFFIX__VERSION_1_0;
+ 
+-typedef CL_API_ENTRY cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
++typedef cl_int (CL_API_CALL *clEnqueueAcquireD3D10ObjectsKHR_fn)(
+     cl_command_queue command_queue,
+     cl_uint          num_objects,
+     const cl_mem *   mem_objects,



Home | Main Index | Thread Index | Old Index