[Pkg-opencl-devel] [beignet] 08/47: Imported Debian patch 0.1+git20130418+0546d2e-2
Andreas Beckmann
anbe at moszumanska.debian.org
Fri Oct 31 21:45:47 UTC 2014
This is an automated email from the git hooks/post-receive script.
anbe pushed a commit to branch master
in repository beignet.
commit 88906d939aaf2bbfc8f8c9c4df4a0e3038977089
Author: Simon Richter <sjr at debian.org>
Date: Fri Apr 19 09:53:23 2013 +0200
Imported Debian patch 0.1+git20130418+0546d2e-2
---
debian/changelog | 7 +++
debian/patches/clang-3.0 | 20 ++++++++
debian/patches/gmoi | 117 +++++++++++++++++++++++++++++++++++++++++++++++
debian/patches/pitch2d | 30 ++++++++++++
debian/patches/series | 3 ++
5 files changed, 177 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 11993c3..3b2ac76 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+beignet (0.1+git20130418+0546d2e-2) experimental; urgency=low
+
+ * Add functionality patches
+ * Use clang 3.0 command line syntax
+
+ -- Simon Richter <sjr at debian.org> Fri, 19 Apr 2013 09:53:23 +0200
+
beignet (0.1+git20130418+0546d2e-1) experimental; urgency=low
* New upstream release
diff --git a/debian/patches/clang-3.0 b/debian/patches/clang-3.0
new file mode 100644
index 0000000..393b379
--- /dev/null
+++ b/debian/patches/clang-3.0
@@ -0,0 +1,20 @@
+Description: Use clang 3.0 command line
+Author: Simon Richter <sjr at debian.org>
+Last-Update: 2013-04-19
+
+Index: beignet-0.1+git20130418+0546d2e/backend/src/backend/program.cpp
+===================================================================
+--- beignet-0.1+git20130418+0546d2e.orig/backend/src/backend/program.cpp 2013-04-19 10:03:28.000000000 +0200
++++ beignet-0.1+git20130418+0546d2e/backend/src/backend/program.cpp 2013-04-19 10:04:09.867084078 +0200
+@@ -118,11 +118,7 @@
+ fclose(clFile);
+
+ // Now compile the code to llvm using clang
+-#if LLVM_VERSION_MINOR <= 1
+ std::string compileCmd = "clang -x cl -fno-color-diagnostics -emit-llvm -O3 -ccc-host-triple ptx32 -c ";
+-#else
+- std::string compileCmd = "clang -ffp-contract=off -emit-llvm -O3 -target nvptx -x cl -c ";
+-#endif /* LLVM_VERSION_MINOR <= 1 */
+ compileCmd += clName;
+ compileCmd += " ";
+ if(options)
diff --git a/debian/patches/gmoi b/debian/patches/gmoi
new file mode 100644
index 0000000..7d29528
--- /dev/null
+++ b/debian/patches/gmoi
@@ -0,0 +1,117 @@
+commit c60c0bfa3347aa4f89877743cbeeb1ae998ebb12
+Author: Simon Richter <Simon.Richter at hogyros.de>
+Date: Thu Apr 18 20:01:35 2013 +0200
+
+ Implement clGetMemObjectInfo
+
+ Currently, only the properties
+
+ - CL_MEM_TYPE
+ - CL_MEM_FLAGS
+ - CL_MEM_SIZE
+
+ are implemented.
+
+Index: beignet-0.1+git20130418+0546d2e/src/cl_api.c
+===================================================================
+--- beignet-0.1+git20130418+0546d2e.orig/src/cl_api.c 2013-04-19 10:04:52.127082193 +0200
++++ beignet-0.1+git20130418+0546d2e/src/cl_api.c 2013-04-19 10:04:56.359082005 +0200
+@@ -386,8 +386,11 @@
+ void * param_value,
+ size_t * param_value_size_ret)
+ {
+- NOT_IMPLEMENTED;
+- return 0;
++ return cl_get_mem_object_info(memobj,
++ param_name,
++ param_value_size,
++ param_value,
++ param_value_size_ret);
+ }
+
+ cl_int
+Index: beignet-0.1+git20130418+0546d2e/src/cl_mem.c
+===================================================================
+--- beignet-0.1+git20130418+0546d2e.orig/src/cl_mem.c 2013-04-19 10:04:52.127082193 +0200
++++ beignet-0.1+git20130418+0546d2e/src/cl_mem.c 2013-04-19 10:04:56.359082005 +0200
+@@ -31,6 +31,66 @@
+ #include <assert.h>
+ #include <stdio.h>
+
++#define FIELD_SIZE(CASE,TYPE) \
++ case JOIN(CL_,CASE): \
++ if(param_value_size_ret) \
++ *param_value_size_ret = sizeof(TYPE); \
++ if(!param_value) \
++ return CL_SUCCESS; \
++ if(param_value_size < sizeof(TYPE)) \
++ return CL_INVALID_VALUE; \
++ break;
++
++LOCAL cl_int
++cl_get_mem_object_info(cl_mem mem,
++ cl_mem_info param_name,
++ size_t param_value_size,
++ void *param_value,
++ size_t *param_value_size_ret)
++{
++ switch(param_name)
++ {
++ FIELD_SIZE(MEM_TYPE, cl_mem_object_type);
++ FIELD_SIZE(MEM_FLAGS, cl_mem_flags);
++ FIELD_SIZE(MEM_SIZE, size_t);
++ FIELD_SIZE(MEM_HOST_PTR, void *);
++ FIELD_SIZE(MEM_MAP_COUNT, cl_uint);
++ FIELD_SIZE(MEM_REFERENCE_COUNT, cl_uint);
++ FIELD_SIZE(MEM_CONTEXT, cl_context);
++ default:
++ return CL_INVALID_VALUE;
++ }
++
++ switch(param_name)
++ {
++ case CL_MEM_TYPE:
++ *((cl_mem_object_type *)param_value) = mem->type;
++ break;
++ case CL_MEM_FLAGS:
++ *((cl_mem_flags *)param_value) = mem->flags;
++ break;
++ case CL_MEM_SIZE:
++ *((size_t *)param_value) = cl_buffer_get_size(mem->bo);
++ break;
++ case CL_MEM_HOST_PTR:
++ NOT_IMPLEMENTED;
++ break;
++ case CL_MEM_MAP_COUNT:
++ NOT_IMPLEMENTED;
++ break;
++ case CL_MEM_REFERENCE_COUNT:
++ NOT_IMPLEMENTED;
++ break;
++ case CL_MEM_CONTEXT:
++ NOT_IMPLEMENTED;
++ break;
++ }
++
++ return CL_SUCCESS;
++}
++
++#undef FIELD_SIZE
++
+ static cl_mem
+ cl_mem_allocate(cl_context ctx,
+ cl_mem_flags flags,
+Index: beignet-0.1+git20130418+0546d2e/src/cl_mem.h
+===================================================================
+--- beignet-0.1+git20130418+0546d2e.orig/src/cl_mem.h 2013-04-19 10:04:52.127082193 +0200
++++ beignet-0.1+git20130418+0546d2e/src/cl_mem.h 2013-04-19 10:04:56.359082005 +0200
+@@ -48,6 +48,9 @@
+ cl_image_tiling_t tiling; /* only IVB+ supports TILE_[X,Y] (image only) */
+ };
+
++/* Query information about a memory object */
++extern cl_int cl_get_mem_object_info(cl_mem, cl_mem_info, size_t, void *, size_t *);
++
+ /* Create a new memory object and initialize it with possible user data */
+ extern cl_mem cl_mem_new(cl_context, cl_mem_flags, size_t, void*, cl_int*);
+
diff --git a/debian/patches/pitch2d b/debian/patches/pitch2d
new file mode 100644
index 0000000..82b563b
--- /dev/null
+++ b/debian/patches/pitch2d
@@ -0,0 +1,30 @@
+commit ab57856a5278c25748d8a2d261f31b8c29f146f9
+Author: Simon Richter <Simon.Richter at hogyros.de>
+Date: Thu Apr 18 17:50:05 2013 +0200
+
+ Fix pitch parameter in clCreateImage2D
+
+ If the host_ptr is NULL, the pitch parameter must be 0.
+
+ The pitch parameter gives the number of bytes per scanline. Specifying 0
+ selects the minimum possible.
+
+Index: beignet-0.1+git20130418+0546d2e/src/cl_mem.c
+===================================================================
+--- beignet-0.1+git20130418+0546d2e.orig/src/cl_mem.c 2013-04-18 05:21:35.000000000 +0200
++++ beignet-0.1+git20130418+0546d2e/src/cl_mem.c 2013-04-18 17:54:09.970688265 +0200
+@@ -284,9 +284,13 @@
+ if (UNLIKELY(h == 0)) DO_IMAGE_ERROR;
+
+ if (image_type == CL_MEM_OBJECT_IMAGE2D) {
++ size_t min_pitch = ((bpp * w) + 7) / 8;
++ if (pitch == 0)
++ pitch = min_pitch;
+ if (UNLIKELY(w > ctx->device->image2d_max_width)) DO_IMAGE_ERROR;
+ if (UNLIKELY(h > ctx->device->image2d_max_height)) DO_IMAGE_ERROR;
+- if (UNLIKELY(data && (bpp*w > pitch))) DO_IMAGE_ERROR;
++ if (UNLIKELY(data && min_pitch > pitch)) DO_IMAGE_ERROR;
++ if (UNLIKELY(!data && pitch != 0)) DO_IMAGE_ERROR;
+
+ /* Pick up tiling mode (we do only linear on SNB) */
+ if (cl_driver_get_ver(ctx->drv) != 6)
diff --git a/debian/patches/series b/debian/patches/series
index 110055d..edd4c1f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,6 @@ implement-gefa
missing-header
soname
respect-flags
+pitch2d
+gmoi
+clang-3.0
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git
More information about the Pkg-opencl-devel
mailing list