From a5efe050242d1d6a45e03fcac1763ff90877e322 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sat, 2 Jan 2010 00:15:55 +0100 Subject: introduced CLGLContext, refactored dependencies, cleanup in opencl code. --- resources/cl-impl.cfg | 3 +++ resources/clImplCustomCode.java | 11 +++++++++++ resources/opencl.h | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'resources') 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: int32_t clBuildProgram(cl_program, uint32_t, cl_device_id * , const char * , void * ); */ 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 #include -//#include +#include #ifdef _WIN32 #include -- cgit v1.2.3