aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-01-02 00:15:55 +0100
committerMichael Bien <[email protected]>2010-01-02 00:15:55 +0100
commita5efe050242d1d6a45e03fcac1763ff90877e322 (patch)
treeb8135791915083d1e36b383a182f2973927c8ead /resources
parent72203a5d1f8896463ded10d1b21ca116621d1900 (diff)
introduced CLGLContext, refactored dependencies, cleanup in opencl code.
Diffstat (limited to 'resources')
-rw-r--r--resources/cl-impl.cfg3
-rw-r--r--resources/clImplCustomCode.java11
-rw-r--r--resources/opencl.h2
3 files changed, 15 insertions, 1 deletions
diff --git a/resources/cl-impl.cfg b/resources/cl-impl.cfg
index 9dff59bc..c2af12cf 100644
--- a/resources/cl-impl.cfg
+++ b/resources/cl-impl.cfg
@@ -30,3 +30,6 @@ Ignore clEnqueueNativeKernel
#include custom code
IncludeAs CustomJavaCode CLImpl clImplCustomCode.java
IncludeAs CustomCCode clImplCustomCode.c
+
+#JavaEpilogue clCreateKernelsInProgram if(kernels!=null && CPU.is32Bit() && kernels.lenght > 1) { convert32To64(kernels); }
+
diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java
index 91b1fb48..cffe9a72 100644
--- a/resources/clImplCustomCode.java
+++ b/resources/clImplCustomCode.java
@@ -51,3 +51,14 @@
/** Entry point to C language function: <code> int32_t clBuildProgram(cl_program, uint32_t, cl_device_id * , const char * , void * ); </code> */
private native int clBuildProgram1(long program, int devices, Object deviceList, String options, BuildProgramCallback cb, Object userData);
+
+ private final static void convert32To64(long[] values) {
+ if(values.length%2 == 1) {
+ values[values.length-1] = values[values.length/2]>>>32;
+ }
+ for (int i = values.length - 1 - values.length%2; i >= 0; i-=2) {
+ long temp = values[i/2];
+ values[i-1] = temp>>>32;
+ values[i ] = temp & 0x00000000FFFFFFFFL;
+ }
+ }
diff --git a/resources/opencl.h b/resources/opencl.h
index 8e46611c..d1b0c795 100644
--- a/resources/opencl.h
+++ b/resources/opencl.h
@@ -1,7 +1,7 @@
#include <CL/cl_platform.h>
#include <CL/cl.h>
-//#include <CL/cl_ext.h>
+#include <CL/cl_ext.h>
#ifdef _WIN32
#include <windows.h>