aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.classpath8
-rw-r--r--.externalToolBuilders/jocl-ant.launch15
-rw-r--r--.project22
-rw-r--r--doc/HowToBuild.html19
-rw-r--r--resources/cl-context-if.cfg4
-rw-r--r--resources/cl-program-if.cfg2
-rw-r--r--resources/clImplCustomCode.c2
-rw-r--r--src/com/jogamp/opencl/CLBuffer.java4
-rw-r--r--src/com/jogamp/opencl/CLCommandQueue.java110
-rw-r--r--src/com/jogamp/opencl/CLContext.java23
-rw-r--r--src/com/jogamp/opencl/CLDevice.java2
-rw-r--r--src/com/jogamp/opencl/CLEvent.java6
-rw-r--r--src/com/jogamp/opencl/CLEventList.java24
-rw-r--r--src/com/jogamp/opencl/CLImage.java6
-rw-r--r--src/com/jogamp/opencl/CLKernel.java4
-rw-r--r--src/com/jogamp/opencl/CLMemory.java8
-rw-r--r--src/com/jogamp/opencl/CLPlatform.java6
-rw-r--r--src/com/jogamp/opencl/CLProgram.java29
-rw-r--r--src/com/jogamp/opencl/CLSampler.java6
-rw-r--r--src/com/jogamp/opencl/gl/CLGLContext.java18
-rw-r--r--src/com/jogamp/opencl/impl/CLTLAccessorFactory.java8
-rw-r--r--src/com/jogamp/opencl/impl/CLTLInfoAccessor.java16
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLImpl.java40
-rw-r--r--src/com/jogamp/opencl/util/CLBuildListener.java2
-rw-r--r--test/com/jogamp/opencl/LowLevelBindingTest.java28
25 files changed, 224 insertions, 188 deletions
diff --git a/.classpath b/.classpath
new file mode 100644
index 0000000..49ad63b
--- /dev/null
+++ b/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="test"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jogamp"/>
+ <classpathentry kind="output" path="build"/>
+</classpath>
diff --git a/.externalToolBuilders/jocl-ant.launch b/.externalToolBuilders/jocl-ant.launch
new file mode 100644
index 0000000..f6b6cd6
--- /dev/null
+++ b/.externalToolBuilders/jocl-ant.launch
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="clean,"/>
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="jar,"/>
+<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jocl"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/jocl/build.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/jocl}"/>
+</launchConfiguration>
diff --git a/.project b/.project
new file mode 100644
index 0000000..7059a17
--- /dev/null
+++ b/.project
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jocl</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>LaunchConfigHandle</key>
+ <value>&lt;project&gt;/.externalToolBuilders/jocl-ant.launch</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/doc/HowToBuild.html b/doc/HowToBuild.html
index 04e3e4d..95c2bfa 100644
--- a/doc/HowToBuild.html
+++ b/doc/HowToBuild.html
@@ -34,8 +34,8 @@
<li><a href="../../deployment/autobuilds/master/">Download JOCL</a></li>
<li><a href="../../deployment/webstart-next/javadoc/jocl/javadoc/">JOCL JavaDoc</a></li>
<li><a href="../../wiki/index.php/JOCL_FAQ#Getting_Started">JOCL Hello World</a></li>
- <li><a href="http://github.com/mbien/jocl">Code Repository</a></li>
- <li><a href="http://github.com/mbien/jocl-demos">Demos Repository</a></li>
+ <li><a href="http://jogamp.org/git/?p=jocl.git">Code Repository</a></li>
+ <li><a href="http://jogamp.org/git/?p=jocl-demos.git">Demos Code Repository</a></li>
</ul>
<h3>External References</h3>
<ul>
@@ -96,19 +96,19 @@
<ol>
<li><b>Optain the source code</b> using git:
<ul>
- <li><a href="http://github.com/mbien/jocl">JOCL Dev GIT Repo</a></li>
+ <li><a href="http://jogamp.org/git/?p=jocl.git">JOCL Dev GIT Repo</a></li>
</ul>
It is important that you checkout the source project side by side to its dependencies:
<pre>
- /home/dude/projects/jogamp> git clone git://github.com/mbien/jocl.git jocl
+ /home/dude/projects/jogamp> git clone git://jogamp.com/srv/scm/jocl.git jocl
</pre>
Now you should have following directory structure:
<pre>
/home/dude/projects/jogamp
/home/dude/projects/jogamp/gluegen
- /home/dude/projects/jogamp/jocl
/home/dude/projects/jogamp/jogl
+ /home/dude/projects/jogamp/jocl
</pre>
you can now open the projects with NetBeans or proceed with:
</li>
@@ -116,12 +116,9 @@
<li> <b>Build the source tree:</b> <br/>
Open a command shell in the "jocl" directory of the source tree and type <code>"ant jar"</code>.
</li>
- <li> <b>Test your build:</b> <br/>
- <code>"ant test"</code>
- </li>
-
- <li> <b>Build Javadoc:</b> <br/>
- <code>"ant javadoc"</code>
+ <li> <b>Test your build:</b> <br/> Stay in your command shell in the "jocl" directory of the source tree and type <code>"ant test"</code>.</li>
+ <li> <b>Build Javadoc:</b> <br/> Stay in your command shell in the "jocl" directory of the source tree and type "<code>ant javadoc"</code>.
+ This will produce the end-user documentation for JOCL.
</li>
</ol>
diff --git a/resources/cl-context-if.cfg b/resources/cl-context-if.cfg
index 6095b85..c1609a7 100644
--- a/resources/cl-context-if.cfg
+++ b/resources/cl-context-if.cfg
@@ -16,8 +16,8 @@ IgnoreNot clGetSupportedImageFormats.*|.*GetContextInfo.*|.*RetainContext.*|.*Re
#custom implementations
CustomJavaCode CLContextBinding
CustomJavaCode CLContextBinding /** Interface to C language function: <br> <code> cl_context {@native clCreateContext}(intptr_t * , uint32_t, cl_device_id * , void (*pfn_notify)(const char *, const void *, size_t, void *), void *, int32_t * ); </code> */
-CustomJavaCode CLContextBinding public long clCreateContext(NativeSizeBuffer properties, NativeSizeBuffer devices, CLErrorHandler pfn_notify, IntBuffer errcode_ret);
+CustomJavaCode CLContextBinding public long clCreateContext(PointerBuffer properties, PointerBuffer devices, CLErrorHandler pfn_notify, IntBuffer errcode_ret);
CustomJavaCode CLContextBinding
CustomJavaCode CLContextBinding /** Interface to C language function: <br> <code> cl_context {@native clCreateContextFromType}(cl_context_properties *properties, cl_device_type device_type, void (*pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data), void *user_data, cl_int *errcode_ret) ; </code> */
-CustomJavaCode CLContextBinding public long clCreateContextFromType(NativeSizeBuffer properties, long device_type, CLErrorHandler pfn_notify, IntBuffer errcode_ret);
+CustomJavaCode CLContextBinding public long clCreateContextFromType(PointerBuffer properties, long device_type, CLErrorHandler pfn_notify, IntBuffer errcode_ret);
diff --git a/resources/cl-program-if.cfg b/resources/cl-program-if.cfg
index afa593a..251ade7 100644
--- a/resources/cl-program-if.cfg
+++ b/resources/cl-program-if.cfg
@@ -15,4 +15,4 @@ IgnoreNot .*CreateProgramWith.*|.*Program.*Info.*|.*RetainProgram.*|.*ReleasePro
#custom implementations
CustomJavaCode CLProgramBinding
CustomJavaCode CLProgramBinding /** Interface to C language function: <br> <code> int32_t {@native clBuildProgram}(cl_program, uint32_t, cl_device_id * , const char * , void (*pfn_notify)(cl_program, void *user_data), void * ); </code> */
-CustomJavaCode CLProgramBinding public int clBuildProgram(long program, int deviceCount, NativeSizeBuffer devices, String options, BuildProgramCallback cb);
+CustomJavaCode CLProgramBinding public int clBuildProgram(long program, int deviceCount, PointerBuffer devices, String options, BuildProgramCallback cb);
diff --git a/resources/clImplCustomCode.c b/resources/clImplCustomCode.c
index fba3cb3..4a43ae3 100644
--- a/resources/clImplCustomCode.c
+++ b/resources/clImplCustomCode.c
@@ -299,7 +299,7 @@ Java_com_jogamp_opencl_llb_impl_CLImpl_clBuildProgram0(JNIEnv *env, jobject _unu
/* Java->C glue code:
* Java package: com.jogamp.opencl.impl.CLImpl
- * Java method: java.nio.ByteBuffer clEnqueueMapImage(long command_queue, long image, int blocking_map, long map_flags, com.jogamp.gluegen.common.nio.NativeSizeBuffer origin, com.jogamp.gluegen.common.nio.NativeSizeBuffer range, com.jogamp.gluegen.common.nio.NativeSizeBuffer image_row_pitch, com.jogamp.gluegen.common.nio.NativeSizeBuffer image_slice_pitch, int num_events_in_wait_list, com.jogamp.gluegen.common.nio.NativeSizeBuffer event_wait_list, com.jogamp.gluegen.common.nio.NativeSizeBuffer event, java.nio.IntBuffer errcode_ret)
+ * Java method: java.nio.ByteBuffer clEnqueueMapImage(long command_queue, long image, int blocking_map, long map_flags, com.jogamp.gluegen.common.nio.PointerBuffer origin, com.jogamp.gluegen.common.nio.PointerBuffer range, com.jogamp.gluegen.common.nio.PointerBuffer image_row_pitch, com.jogamp.gluegen.common.nio.PointerBuffer image_slice_pitch, int num_events_in_wait_list, com.jogamp.gluegen.common.nio.PointerBuffer event_wait_list, com.jogamp.gluegen.common.nio.PointerBuffer event, java.nio.IntBuffer errcode_ret)
* C function: void * clEnqueueMapImage(cl_command_queue command_queue, cl_mem image, uint32_t blocking_map, uint64_t map_flags, const size_t * , const size_t * , size_t * image_row_pitch, size_t * image_slice_pitch, uint32_t num_events_in_wait_list, cl_event * event_wait_list, cl_event * event, int32_t * errcode_ret);
*/
JNIEXPORT jobject JNICALL
diff --git a/src/com/jogamp/opencl/CLBuffer.java b/src/com/jogamp/opencl/CLBuffer.java
index 03e0747..9972141 100644
--- a/src/com/jogamp/opencl/CLBuffer.java
+++ b/src/com/jogamp/opencl/CLBuffer.java
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
import com.jogamp.common.nio.Buffers;
import java.util.List;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.CLMemory.Mem;
import com.jogamp.opencl.llb.CL;
import com.jogamp.opencl.llb.CLBufferBinding;
@@ -109,7 +109,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
size *= elemSize;
}
- NativeSizeBuffer info = NativeSizeBuffer.allocateDirect(2);
+ PointerBuffer info = PointerBuffer.allocateDirect(2);
info.put(offset).put(size).rewind();
int bitset = Mem.flagsToInt(flags);
diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java
index b1644cf..eedb0bd 100644
--- a/src/com/jogamp/opencl/CLCommandQueue.java
+++ b/src/com/jogamp/opencl/CLCommandQueue.java
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
import com.jogamp.common.nio.CachedBufferFactory;
import com.jogamp.opencl.llb.gl.CLGL;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.gl.CLGLObject;
import com.jogamp.opencl.llb.CLCommandQueueBinding;
import java.nio.Buffer;
@@ -68,9 +68,9 @@ public class CLCommandQueue extends CLObjectResource {
* Those direct memory buffers are used to move data between the JVM and OpenCL.
*/
private final IntBuffer pbA;
- private final NativeSizeBuffer ibA;
- private final NativeSizeBuffer ibB;
- private final NativeSizeBuffer ibC;
+ private final PointerBuffer ibA;
+ private final PointerBuffer ibB;
+ private final PointerBuffer ibC;
private CLCommandQueue(CLContext context, long id, CLDevice device, long properties) {
super(context, id);
@@ -79,13 +79,13 @@ public class CLCommandQueue extends CLObjectResource {
this.properties = properties;
this.cl = context.getPlatform().getCommandQueueBinding();
- int pbsize = NativeSizeBuffer.elementSize();
+ int pbsize = PointerBuffer.ELEMENT_SIZE;
CachedBufferFactory factory = CachedBufferFactory.create(9*pbsize + 4, true);
-
- this.ibA = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
- this.ibB = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
- this.ibC = NativeSizeBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
-
+
+ this.ibA = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+ this.ibB = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+ this.ibC = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+
this.pbA = factory.newDirectIntBuffer(1);
}
@@ -121,7 +121,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putWriteBuffer(CLBuffer<?> writeBuffer, boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -165,7 +165,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putReadBuffer(CLBuffer<?> readBuffer, boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -214,7 +214,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putCopyBuffer(CLBuffer<?> src, CLBuffer<?> dest, int srcOffset, int destOffset, long bytesToCopy, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -284,7 +284,7 @@ public class CLCommandQueue extends CLObjectResource {
long rowPitch, long slicePitch, long hostRowPitch, long hostSlicePitch,
boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -362,7 +362,7 @@ public class CLCommandQueue extends CLObjectResource {
long rowPitch, long slicePitch, long hostRowPitch, long hostSlicePitch,
boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -443,7 +443,7 @@ public class CLCommandQueue extends CLObjectResource {
long srcRowPitch, long srcSlicePitch, long destRowPitch, long destSlicePitch,
CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -511,7 +511,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putWriteImage(CLImage2d<?> writeImage, int inputRowPitch,
int originX, int originY, int rangeX, int rangeY, boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -573,7 +573,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putWriteImage(CLImage3d<?> writeImage, int inputRowPitch, int inputSlicePitch,
int originX, int originY, int originZ, int rangeX, int rangeY, int rangeZ, boolean blockingWrite, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -634,7 +634,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putReadImage(CLImage2d<?> readImage, int inputRowPitch,
int originX, int originY, int rangeX, int rangeY, boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -696,7 +696,7 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue putReadImage(CLImage3d<?> readImage, int inputRowPitch, int inputSlicePitch,
int originX, int originY, int originZ, int rangeX, int rangeY, int rangeZ, boolean blockingRead, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -760,7 +760,7 @@ public class CLCommandQueue extends CLObjectResource {
int dstOriginX, int dstOriginY,
int rangeX, int rangeY, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -829,7 +829,7 @@ public class CLCommandQueue extends CLObjectResource {
int dstOriginX, int dstOriginY, int dstOriginZ,
int rangeX, int rangeY, int rangeZ, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -893,7 +893,7 @@ public class CLCommandQueue extends CLObjectResource {
long srcOffset, int dstOriginX, int dstOriginY,
int rangeX, int rangeY, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -960,7 +960,7 @@ public class CLCommandQueue extends CLObjectResource {
long srcOffset, int dstOriginX, int dstOriginY, int dstOriginZ,
int rangeX, int rangeY, int rangeZ, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1024,7 +1024,7 @@ public class CLCommandQueue extends CLObjectResource {
int srcOriginX, int srcOriginY,
int rangeX, int rangeY, long dstOffset, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1091,7 +1091,7 @@ public class CLCommandQueue extends CLObjectResource {
int srcOriginX, int srcOriginY, int srcOriginZ,
int rangeX, int rangeY, int rangeZ, long dstOffset, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1149,7 +1149,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public ByteBuffer putMapBuffer(CLBuffer<?> buffer, CLMemory.Map flag, long offset, long length, boolean blockingMap, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1209,7 +1209,7 @@ public class CLCommandQueue extends CLObjectResource {
int offsetX, int offsetY,
int rangeX, int rangeY, boolean blockingMap, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1275,7 +1275,7 @@ public class CLCommandQueue extends CLObjectResource {
int offsetX, int offsetY, int offsetZ,
int rangeX, int rangeY, int rangeZ, boolean blockingMap, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1319,7 +1319,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putUnmapMemory(CLMemory<?> memory, Buffer mapped, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1357,8 +1357,8 @@ public class CLCommandQueue extends CLObjectResource {
if(blockingWait) {
list.waitForEvent(index);
- }else{
- NativeSizeBuffer ids = list.getEventBuffer(index);
+ } else {
+ PointerBuffer ids = list.getEventBuffer(index);
int ret = cl.clEnqueueWaitForEvents(ID, 1, ids);
if(ret != CL_SUCCESS) {
throw newException(ret, "can not "+ (blockingWait?"blocking": "") +" wait for event #" + index+ " in "+list);
@@ -1418,7 +1418,7 @@ public class CLCommandQueue extends CLObjectResource {
*/
public CLCommandQueue putTask(CLKernel kernel, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1455,9 +1455,9 @@ public class CLCommandQueue extends CLObjectResource {
* Calls {@native clEnqueueNDRangeKernel}.
*/
public CLCommandQueue put1DRangeKernel(CLKernel kernel, long globalWorkOffset, long globalWorkSize, long localWorkSize, CLEventList condition, CLEventList events) {
- NativeSizeBuffer globWO = null;
- NativeSizeBuffer globWS = null;
- NativeSizeBuffer locWS = null;
+ PointerBuffer globWO = null;
+ PointerBuffer globWS = null;
+ PointerBuffer locWS = null;
if(globalWorkOffset != 0) {
globWO = copy2NIO(ibA, globalWorkOffset);
@@ -1506,9 +1506,9 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue put2DRangeKernel(CLKernel kernel, long globalWorkOffsetX, long globalWorkOffsetY,
long globalWorkSizeX, long globalWorkSizeY,
long localWorkSizeX, long localWorkSizeY, CLEventList condition, CLEventList events) {
- NativeSizeBuffer globalWorkOffset = null;
- NativeSizeBuffer globalWorkSize = null;
- NativeSizeBuffer localWorkSize = null;
+ PointerBuffer globalWorkOffset = null;
+ PointerBuffer globalWorkSize = null;
+ PointerBuffer localWorkSize = null;
if(globalWorkOffsetX != 0 || globalWorkOffsetY != 0) {
globalWorkOffset = copy2NIO(ibA, globalWorkOffsetX, globalWorkOffsetY);
@@ -1556,9 +1556,9 @@ public class CLCommandQueue extends CLObjectResource {
public CLCommandQueue put3DRangeKernel(CLKernel kernel, long globalWorkOffsetX, long globalWorkOffsetY, long globalWorkOffsetZ,
long globalWorkSizeX, long globalWorkSizeY, long globalWorkSizeZ,
long localWorkSizeX, long localWorkSizeY, long localWorkSizeZ, CLEventList condition, CLEventList events) {
- NativeSizeBuffer globalWorkOffset = null;
- NativeSizeBuffer globalWorkSize = null;
- NativeSizeBuffer localWorkSize = null;
+ PointerBuffer globalWorkOffset = null;
+ PointerBuffer globalWorkSize = null;
+ PointerBuffer localWorkSize = null;
if(globalWorkOffsetX != 0 || globalWorkOffsetY != 0 || globalWorkOffsetZ != 0) {
globalWorkOffset = copy2NIO(ibA, globalWorkOffsetX, globalWorkOffsetY, globalWorkOffsetZ);
@@ -1576,7 +1576,7 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueNDRangeKernel}.
*/
- public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, NativeSizeBuffer globalWorkOffset, NativeSizeBuffer globalWorkSize, NativeSizeBuffer localWorkSize) {
+ public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, PointerBuffer globalWorkOffset, PointerBuffer globalWorkSize, PointerBuffer localWorkSize) {
this.putNDRangeKernel(kernel, workDimension, globalWorkOffset, globalWorkSize, localWorkSize, null, null);
return this;
}
@@ -1584,7 +1584,7 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueNDRangeKernel}.
*/
- public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, NativeSizeBuffer globalWorkOffset, NativeSizeBuffer globalWorkSize, NativeSizeBuffer localWorkSize, CLEventList events) {
+ public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, PointerBuffer globalWorkOffset, PointerBuffer globalWorkSize, PointerBuffer localWorkSize, CLEventList events) {
this.putNDRangeKernel(kernel, workDimension, globalWorkOffset, globalWorkSize, localWorkSize, null, events);
return this;
}
@@ -1592,10 +1592,10 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueNDRangeKernel}.
*/
- public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, NativeSizeBuffer globalWorkOffset,
- NativeSizeBuffer globalWorkSize, NativeSizeBuffer localWorkSize, CLEventList condition, CLEventList events) {
+ public CLCommandQueue putNDRangeKernel(CLKernel kernel, int workDimension, PointerBuffer globalWorkOffset,
+ PointerBuffer globalWorkSize, PointerBuffer localWorkSize, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1668,9 +1668,9 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueAcquireGLObjects}.
*/
- public CLCommandQueue putAcquireGLObjects(NativeSizeBuffer glObjectIDs, CLEventList condition, CLEventList events) {
+ public CLCommandQueue putAcquireGLObjects(PointerBuffer glObjectIDs, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1737,9 +1737,9 @@ public class CLCommandQueue extends CLObjectResource {
/**
* Calls {@native clEnqueueReleaseGLObjects}.
*/
- public CLCommandQueue putReleaseGLObjects(NativeSizeBuffer glObjectIDs, CLEventList condition, CLEventList events) {
+ public CLCommandQueue putReleaseGLObjects(PointerBuffer glObjectIDs, CLEventList condition, CLEventList events) {
- NativeSizeBuffer conditionIDs = null;
+ PointerBuffer conditionIDs = null;
int conditions = 0;
if(condition != null) {
conditionIDs = condition.IDsView;
@@ -1805,19 +1805,19 @@ public class CLCommandQueue extends CLObjectResource {
}
}
- private static NativeSizeBuffer copy2NIO(NativeSizeBuffer buffer, long a) {
+ private static PointerBuffer copy2NIO(PointerBuffer buffer, long a) {
return buffer.put(2, a).position(2);
}
- private static NativeSizeBuffer copy2NIO(NativeSizeBuffer buffer, long a, long b) {
+ private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b) {
return buffer.position(1).put(a).put(b).position(1);
}
- private static NativeSizeBuffer copy2NIO(NativeSizeBuffer buffer, long a, long b, long c) {
+ private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b, long c) {
return buffer.rewind().put(a).put(b).put(c).rewind();
}
- private static String toStr(NativeSizeBuffer buffer) {
+ private static String toStr(PointerBuffer buffer) {
if(buffer == null) {
return null;
}
diff --git a/src/com/jogamp/opencl/CLContext.java b/src/com/jogamp/opencl/CLContext.java
index a901de4..7073e5d 100644
--- a/src/com/jogamp/opencl/CLContext.java
+++ b/src/com/jogamp/opencl/CLContext.java
@@ -33,7 +33,7 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.opencl.CLDevice.Type;
import com.jogamp.opencl.CLSampler.AddressingMode;
import com.jogamp.opencl.CLSampler.FilteringMode;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.CLContextBinding;
import com.jogamp.opencl.llb.impl.CLImageFormatImpl;
import java.io.BufferedReader;
@@ -121,7 +121,7 @@ public class CLContext extends CLObjectResource {
if (devices == null) {
- NativeSizeBuffer deviceCount = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer deviceCount = PointerBuffer.allocateDirect(1);
int ret = cl.clGetContextInfo(ID, CL_CONTEXT_DEVICES, 0, null, deviceCount);
checkForError(ret, "can not enumerate devices");
@@ -172,7 +172,7 @@ public class CLContext extends CLObjectResource {
long type = toDeviceBitmap(deviceTypes);
- NativeSizeBuffer properties = setupContextProperties(platform);
+ PointerBuffer properties = setupContextProperties(platform);
ErrorDispatcher dispatcher = new ErrorDispatcher();
return new CLContext(platform, createContextFromType(platform, dispatcher, properties, type), dispatcher);
}
@@ -190,7 +190,7 @@ public class CLContext extends CLObjectResource {
CLPlatform platform = devices[0].getPlatform();
- NativeSizeBuffer properties = setupContextProperties(platform);
+ PointerBuffer properties = setupContextProperties(platform);
ErrorDispatcher dispatcher = new ErrorDispatcher();
CLContext context = new CLContext(platform, createContext(platform, dispatcher, properties, devices), dispatcher);
if(devices != null) {
@@ -201,8 +201,7 @@ public class CLContext extends CLObjectResource {
return context;
}
- protected static long createContextFromType(CLPlatform platform, CLErrorHandler handler, NativeSizeBuffer properties, long deviceType) {
-
+ protected static long createContextFromType(CLPlatform platform, CLErrorHandler handler, PointerBuffer properties, long deviceType) {
IntBuffer status = newDirectIntBuffer(1);
CLContextBinding cl = platform.getContextBinding();
long context = cl.clCreateContextFromType(properties, deviceType, handler, status);
@@ -212,12 +211,11 @@ public class CLContext extends CLObjectResource {
return context;
}
- protected static long createContext(CLPlatform platform, CLErrorHandler handler, NativeSizeBuffer properties, CLDevice... devices) {
-
+ protected static long createContext(CLPlatform platform, CLErrorHandler handler, PointerBuffer properties, CLDevice... devices) {
IntBuffer status = newDirectIntBuffer(1);
- NativeSizeBuffer pb = null;
+ PointerBuffer pb = null;
if(devices != null && devices.length != 0) {
- pb = NativeSizeBuffer.allocateDirect(devices.length);
+ pb = PointerBuffer.allocateDirect(devices.length);
for (int i = 0; i < devices.length; i++) {
CLDevice device = devices[i];
if(device == null) {
@@ -234,13 +232,12 @@ public class CLContext extends CLObjectResource {
return context;
}
- private static NativeSizeBuffer setupContextProperties(CLPlatform platform) {
-
+ private static PointerBuffer setupContextProperties(CLPlatform platform) {
if(platform == null) {
throw new RuntimeException("no OpenCL installation found");
}
- return NativeSizeBuffer.allocateDirect(3).put(CL_CONTEXT_PLATFORM)
+ return PointerBuffer.allocateDirect(3).put(CL_CONTEXT_PLATFORM)
.put(platform.ID).put(0) // 0 terminated array
.rewind();
}
diff --git a/src/com/jogamp/opencl/CLDevice.java b/src/com/jogamp/opencl/CLDevice.java
index 4705d48..b47deb2 100644
--- a/src/com/jogamp/opencl/CLDevice.java
+++ b/src/com/jogamp/opencl/CLDevice.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 - 2010 JogAmp Community. All rights reserved.
+ * Copyright (c) 2009 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
diff --git a/src/com/jogamp/opencl/CLEvent.java b/src/com/jogamp/opencl/CLEvent.java
index 78f7d3d..d1bfeff 100644
--- a/src/com/jogamp/opencl/CLEvent.java
+++ b/src/com/jogamp/opencl/CLEvent.java
@@ -31,7 +31,7 @@ package com.jogamp.opencl;
import com.jogamp.opencl.impl.CLTLInfoAccessor;
import com.jogamp.opencl.llb.CLEventBinding;
import com.jogamp.opencl.llb.impl.CLEventCallback;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import java.nio.Buffer;
import static com.jogamp.opencl.llb.CL.*;
@@ -147,7 +147,7 @@ public class CLEvent extends CLObjectResource {
private class CLEventInfoAccessor extends CLTLInfoAccessor {
@Override
- protected int getInfo(int name, long valueSize, Buffer value, NativeSizeBuffer valueSizeRet) {
+ protected int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) {
return binding.clGetEventInfo(ID, name, valueSize, value, valueSizeRet);
}
@@ -156,7 +156,7 @@ public class CLEvent extends CLObjectResource {
private class CLEventProfilingInfoAccessor extends CLTLInfoAccessor {
@Override
- protected int getInfo(int name, long valueSize, Buffer value, NativeSizeBuffer valueSizeRet) {
+ protected int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) {
return binding.clGetEventProfilingInfo(ID, name, valueSize, value, valueSizeRet);
}
diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java
index e8d697b..53136e2 100644
--- a/src/com/jogamp/opencl/CLEventList.java
+++ b/src/com/jogamp/opencl/CLEventList.java
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
import com.jogamp.common.AutoCloseable;
import com.jogamp.common.nio.CachedBufferFactory;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import java.util.Iterator;
/**
@@ -44,12 +44,12 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
/**
* stores event ids for fast access.
*/
- final NativeSizeBuffer IDs;
+ final PointerBuffer IDs;
/**
* Points always to the first element of the id buffer.
*/
- final NativeSizeBuffer IDsView;
+ final PointerBuffer IDsView;
int size;
@@ -64,13 +64,13 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
public CLEventList(CachedBufferFactory factory, int capacity) {
this.events = new CLEvent[capacity];
this.IDs = initIDBuffer(factory, capacity);
- this.IDsView = NativeSizeBuffer.wrap(IDs.getBuffer().duplicate());
+ this.IDsView = IDs.duplicate();
}
public CLEventList(CachedBufferFactory factory, CLEvent... events) {
this.events = events;
this.IDs = initIDBuffer(factory, events.length);
- this.IDsView = NativeSizeBuffer.wrap(IDs.getBuffer().duplicate());
+ this.IDsView = IDs.duplicate();
for (CLEvent event : events) {
if(event == null) {
@@ -82,11 +82,11 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
size = events.length;
}
- private NativeSizeBuffer initIDBuffer(CachedBufferFactory factory, int size) {
+ private PointerBuffer initIDBuffer(CachedBufferFactory factory, int size) {
if(factory == null) {
- return NativeSizeBuffer.allocateDirect(size);
+ return PointerBuffer.allocateDirect(size);
}else{
- return NativeSizeBuffer.wrap(factory.newDirectByteBuffer(size*NativeSizeBuffer.elementSize()));
+ return PointerBuffer.wrap(factory.newDirectByteBuffer(size*PointerBuffer.ELEMENT_SIZE));
}
}
@@ -99,8 +99,8 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
size++;
}
- NativeSizeBuffer getEventBuffer(int index) {
- return NativeSizeBuffer.wrap(IDs.getBuffer().duplicate()).position(index);
+ PointerBuffer getEventBuffer(int index) {
+ return IDs.duplicate();
}
/**
@@ -122,7 +122,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
throw new IndexOutOfBoundsException("args: [start: "+start+" range: "+range+"], eventcount: "+size);
}
- NativeSizeBuffer view = getEventBuffer(start);
+ final PointerBuffer view = getEventBuffer(start);
getEvent(start).getPlatform().getEventBinding().clWaitForEvents(range, view);
}
@@ -130,7 +130,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
* Waits for the event with the given index in this list to occur.
*/
public void waitForEvent(int index) {
- NativeSizeBuffer view = getEventBuffer(index);
+ final PointerBuffer view = getEventBuffer(index);
getEvent(index).getPlatform().getEventBinding().clWaitForEvents(1, view);
}
diff --git a/src/com/jogamp/opencl/CLImage.java b/src/com/jogamp/opencl/CLImage.java
index 09b92b0..e2daff9 100644
--- a/src/com/jogamp/opencl/CLImage.java
+++ b/src/com/jogamp/opencl/CLImage.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 - 2010 JogAmp Community. All rights reserved.
+ * Copyright (c) 2009 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -28,8 +28,8 @@
package com.jogamp.opencl;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.impl.CLTLInfoAccessor;
-import com.jogamp.common.nio.NativeSizeBuffer;
import com.jogamp.opencl.llb.CLImageBinding;
import java.nio.Buffer;
@@ -116,7 +116,7 @@ public abstract class CLImage<B extends Buffer> extends CLMemory<B> {
this.id = id;
}
@Override
- public int getInfo(int name, long valueSize, Buffer value, NativeSizeBuffer valueSizeRet) {
+ public int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) {
return cl.clGetImageInfo(id, name, valueSize, value, valueSizeRet);
}
}
diff --git a/src/com/jogamp/opencl/CLKernel.java b/src/com/jogamp/opencl/CLKernel.java
index 8a3a44b..135174c 100644
--- a/src/com/jogamp/opencl/CLKernel.java
+++ b/src/com/jogamp/opencl/CLKernel.java
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
import com.jogamp.opencl.util.CLUtil;
import com.jogamp.common.nio.Buffers;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.CLKernelBinding;
import java.nio.Buffer;
import java.nio.ByteBuffer;
@@ -77,7 +77,7 @@ public class CLKernel extends CLObjectResource implements Cloneable {
if(name == null) {
// get function name
- NativeSizeBuffer size = NativeSizeBuffer.wrap(buffer);
+ PointerBuffer size = PointerBuffer.wrap(buffer);
int ret = binding.clGetKernelInfo(ID, CL_KERNEL_FUNCTION_NAME, 0, null, size);
checkForError(ret, "error while asking for kernel function name");
diff --git a/src/com/jogamp/opencl/CLMemory.java b/src/com/jogamp/opencl/CLMemory.java
index 0edfb7e..281d042 100644
--- a/src/com/jogamp/opencl/CLMemory.java
+++ b/src/com/jogamp/opencl/CLMemory.java
@@ -30,7 +30,7 @@ package com.jogamp.opencl;
import com.jogamp.opencl.llb.CLMemObjBinding;
import com.jogamp.common.nio.Buffers;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.CL;
import com.jogamp.opencl.llb.impl.CLMemObjectDestructorCallback;
import java.nio.Buffer;
@@ -90,9 +90,9 @@ public abstract class CLMemory <B extends Buffer> extends CLObjectResource {
}
protected static long getSizeImpl(CLContext context, long id) {
- NativeSizeBuffer pb = NativeSizeBuffer.allocateDirect(1);
- CLMemObjBinding binding = context.getPlatform().getMemObjectBinding();
- int ret = binding.clGetMemObjectInfo(id, CL_MEM_SIZE, NativeSizeBuffer.elementSize(), pb.getBuffer(), null);
+ PointerBuffer pb = PointerBuffer.allocateDirect(1);
+ CLMemObjBinding binding = context.getPlatform().getMemObjectBinding(); // FIXME: CL separation makes this pretty complicated !
+ int ret = binding.clGetMemObjectInfo(id, CL_MEM_SIZE, pb.elementSize(), pb.getBuffer(), null);
checkForError(ret, "can not obtain buffer info");
return pb.get();
}
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java
index 9e5308f..bd93caa 100644
--- a/src/com/jogamp/opencl/CLPlatform.java
+++ b/src/com/jogamp/opencl/CLPlatform.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 - 2010 JogAmp Community. All rights reserved.
+ * Copyright (c) 2009 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -39,7 +39,7 @@ import com.jogamp.common.nio.Buffers;
import com.jogamp.common.os.DynamicLookupHelper;
import com.jogamp.common.JogampRuntimeException;
import com.jogamp.common.os.NativeLibrary;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.gluegen.runtime.FunctionAddressResolver;
import com.jogamp.opencl.llb.CLBufferBinding;
import com.jogamp.opencl.llb.CLCommandQueueBinding;
@@ -274,7 +274,7 @@ public class CLPlatform {
checkForError(ret, "can not enumerate platforms");
// receive platform ids
- NativeSizeBuffer platformId = NativeSizeBuffer.allocateDirect(ib.get(0));
+ PointerBuffer platformId = PointerBuffer.allocateDirect(ib.get(0));
ret = cl.clGetPlatformIDs(platformId.capacity(), platformId, null);
checkForError(ret, "can not enumerate platforms");
diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java
index ce844bf..d373d5d 100644
--- a/src/com/jogamp/opencl/CLProgram.java
+++ b/src/com/jogamp/opencl/CLProgram.java
@@ -33,7 +33,6 @@ import com.jogamp.opencl.llb.CLProgramBinding;
import com.jogamp.opencl.util.CLProgramConfiguration;
import com.jogamp.opencl.util.CLUtil;
import com.jogamp.common.os.Platform;
-import com.jogamp.common.nio.NativeSizeBuffer;
import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.CLKernelBinding;
import com.jogamp.opencl.llb.impl.BuildProgramCallback;
@@ -82,7 +81,7 @@ public class CLProgram extends CLObjectResource {
IntBuffer status = newDirectIntBuffer(1);
- NativeSizeBuffer length = NativeSizeBuffer.allocateDirect(1).put(0, src.length());
+ PointerBuffer length = PointerBuffer.allocateDirect(1).put(0, src.length());
String[] srcArray = new String[] {src};
// Create the program
@@ -107,13 +106,13 @@ public class CLProgram extends CLObjectResource {
binarySize += entry.getValue().length;
}
- int pbSize = NativeSizeBuffer.elementSize();
+ int pbSize = PointerBuffer.ELEMENT_SIZE;
int deviceCount = binaries.size();
CachedBufferFactory bf = CachedBufferFactory.create(binarySize + pbSize*deviceCount*3 + 4, true);
- NativeSizeBuffer devices = NativeSizeBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize));
+ PointerBuffer devices = PointerBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize));
PointerBuffer codeBuffers = PointerBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize));
- NativeSizeBuffer lengths = NativeSizeBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize));
+ PointerBuffer lengths = PointerBuffer.wrap(bf.newDirectByteBuffer(deviceCount*pbSize));
int i = 0;
for (Map.Entry<CLDevice, byte[]> entry : entries) {
@@ -171,7 +170,7 @@ public class CLProgram extends CLObjectResource {
return "";
}
- NativeSizeBuffer size = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer size = PointerBuffer.allocateDirect(1);
int ret = binding.clGetProgramBuildInfo(ID, device.ID, flag, 0, null, size);
if(ret != CL_SUCCESS) {
@@ -194,7 +193,7 @@ public class CLProgram extends CLObjectResource {
return "";
}
- NativeSizeBuffer size = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer size = PointerBuffer.allocateDirect(1);
int ret = binding.clGetProgramInfo(ID, flag, 0, null, size);
checkForError(ret, "on clGetProgramInfo");
@@ -338,10 +337,10 @@ public class CLProgram extends CLObjectResource {
releaseKernels();
}
- NativeSizeBuffer deviceIDs = null;
+ PointerBuffer deviceIDs = null;
int count = 0;
if(devices != null && devices.length != 0) {
- deviceIDs = NativeSizeBuffer.allocateDirect(devices.length);
+ deviceIDs = PointerBuffer.allocateDirect(devices.length);
for (int i = 0; i < devices.length; i++) {
deviceIDs.put(i, devices[i].ID);
}
@@ -441,7 +440,7 @@ public class CLProgram extends CLObjectResource {
if(numKernels.get(0) > 0) {
- NativeSizeBuffer kernelIDs = NativeSizeBuffer.allocateDirect(numKernels.get(0));
+ PointerBuffer kernelIDs = PointerBuffer.allocateDirect(numKernels.get(0));
ret = kernelBinding.clCreateKernelsInProgram(ID, kernelIDs.capacity(), kernelIDs, null);
if(ret != CL_SUCCESS) {
throw newException(ret, "can not create "+kernelIDs.capacity()+" kernels for "+this);
@@ -507,7 +506,7 @@ public class CLProgram extends CLObjectResource {
return new CLDevice[0];
}
- NativeSizeBuffer size = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer size = PointerBuffer.allocateDirect(1);
int ret = binding.clGetProgramInfo(ID, CL_PROGRAM_DEVICES, 0, null, size);
if(ret != CL_SUCCESS) {
throw newException(ret, "on clGetProgramInfo of "+this);
@@ -617,8 +616,8 @@ public class CLProgram extends CLObjectResource {
CLDevice[] devices = getCLDevices();
- NativeSizeBuffer sizes = NativeSizeBuffer.allocateDirect(devices.length);
- int ret = binding.clGetProgramInfo(ID, CL_PROGRAM_BINARY_SIZES, sizes.capacity()*NativeSizeBuffer.elementSize(), sizes.getBuffer(), null);
+ PointerBuffer sizes = PointerBuffer.allocateDirect(devices.length);
+ int ret = binding.clGetProgramInfo(ID, CL_PROGRAM_BINARY_SIZES, sizes.capacity()*sizes.elementSize(), sizes.getBuffer(), null);
if(ret != CL_SUCCESS) {
throw newException(ret, "on clGetProgramInfo(CL_PROGRAM_BINARY_SIZES) of "+this);
}
@@ -632,7 +631,7 @@ public class CLProgram extends CLObjectResource {
long address = InternalBufferUtil.getDirectBufferAddress(binaries);
- NativeSizeBuffer addresses = NativeSizeBuffer.allocateDirect(sizes.capacity());
+ PointerBuffer addresses = PointerBuffer.allocateDirect(sizes.capacity());
sizes.rewind();
while(sizes.remaining() != 0) {
addresses.put(address);
@@ -640,7 +639,7 @@ public class CLProgram extends CLObjectResource {
}
addresses.rewind();
- ret = binding.clGetProgramInfo(ID, CL_PROGRAM_BINARIES, addresses.capacity()*NativeSizeBuffer.elementSize(), addresses.getBuffer(), null);
+ ret = binding.clGetProgramInfo(ID, CL_PROGRAM_BINARIES, addresses.capacity()*addresses.elementSize(), addresses.getBuffer(), null);
if(ret != CL_SUCCESS) {
throw newException(ret, "on clGetProgramInfo(CL_PROGRAM_BINARIES) of "+this);
}
diff --git a/src/com/jogamp/opencl/CLSampler.java b/src/com/jogamp/opencl/CLSampler.java
index 3f145b3..f19f58d 100644
--- a/src/com/jogamp/opencl/CLSampler.java
+++ b/src/com/jogamp/opencl/CLSampler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 - 2010 JogAmp Community. All rights reserved.
+ * Copyright (c) 2009 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -28,8 +28,8 @@
package com.jogamp.opencl;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.impl.CLTLInfoAccessor;
-import com.jogamp.common.nio.NativeSizeBuffer;
import com.jogamp.opencl.llb.CLSamplerBinding;
import java.nio.Buffer;
@@ -91,7 +91,7 @@ public class CLSampler extends CLObjectResource {
private class CLSamplerInfoAccessor extends CLTLInfoAccessor {
@Override
- protected int getInfo(int name, long valueSize, Buffer value, NativeSizeBuffer valueSizeRet) {
+ protected int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) {
return binding.clGetSamplerInfo(ID, name, valueSize, value, valueSizeRet);
}
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java
index f7214b6..dcddd3d 100644
--- a/src/com/jogamp/opencl/gl/CLGLContext.java
+++ b/src/com/jogamp/opencl/gl/CLGLContext.java
@@ -34,7 +34,7 @@ import com.jogamp.opencl.CLDevice;
import java.nio.Buffer;
import com.jogamp.opencl.CLMemory.Mem;
import com.jogamp.opencl.CLPlatform;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import jogamp.opengl.GLContextImpl;
import jogamp.opengl.egl.EGLContext;
import jogamp.opengl.macosx.cgl.MacOSXCGLContext;
@@ -97,7 +97,7 @@ public final class CLGLContext extends CLContext {
}
long[] glID = new long[1];
- NativeSizeBuffer properties = setupContextProperties(platform, glContext, glID);
+ PointerBuffer properties = setupContextProperties(platform, glContext, glID);
ErrorDispatcher dispatcher = createErrorHandler();
long clID = createContextFromType(platform, dispatcher, properties, toDeviceBitmap(deviceTypes));
@@ -121,7 +121,7 @@ public final class CLGLContext extends CLContext {
CLPlatform platform = devices[0].getPlatform();
long[] glID = new long[1];
- NativeSizeBuffer properties = setupContextProperties(platform, glContext, glID);
+ PointerBuffer properties = setupContextProperties(platform, glContext, glID);
ErrorDispatcher dispatcher = createErrorHandler();
long clID = createContext(platform, dispatcher, properties, devices);
@@ -135,7 +135,7 @@ public final class CLGLContext extends CLContext {
}
- private static NativeSizeBuffer setupContextProperties(CLPlatform platform, GLContext glContext, long[] glID) {
+ private static PointerBuffer setupContextProperties(CLPlatform platform, GLContext glContext, long[] glID) {
if(platform == null) {
throw new RuntimeException("no OpenCL installation found");
@@ -153,14 +153,14 @@ public final class CLGLContext extends CLContext {
GLContextImpl ctxImpl = (GLContextImpl)glContext;
glID[0] = glContext.getHandle();
- NativeSizeBuffer properties;
+ PointerBuffer properties;
if(glContext instanceof X11GLXContext) {
// spec: "When the GLX binding API is supported, the attribute
// CL_GL_CONTEXT_KHR should be set to a GLXContext handle to an
// OpenGL context, and the attribute CL_GLX_DISPLAY_KHR should be
// set to the Display handle of the X Window System display used to
// create the OpenGL context."
- properties = NativeSizeBuffer.allocateDirect(7);
+ properties = PointerBuffer.allocateDirect(7);
long displayHandle = ctxImpl.getDrawableImpl().getNativeSurface().getDisplayHandle();
properties.put(CL_GL_CONTEXT_KHR).put(glID[0])
.put(CL_GLX_DISPLAY_KHR).put(displayHandle)
@@ -170,7 +170,7 @@ public final class CLGLContext extends CLContext {
// CL_GL_CONTEXT_KHR should be set to an HGLRC handle to an OpenGL
// context, and the attribute CL_WGL_HDC_KHR should be set to the
// HDC handle of the display used to create the OpenGL context."
- properties = NativeSizeBuffer.allocateDirect(7);
+ properties = PointerBuffer.allocateDirect(7);
long surfaceHandle = ctxImpl.getDrawableImpl().getNativeSurface().getSurfaceHandle();
properties.put(CL_GL_CONTEXT_KHR).put(glID[0])
.put(CL_WGL_HDC_KHR).put(surfaceHandle)
@@ -181,7 +181,7 @@ public final class CLGLContext extends CLContext {
// a CGL share group object."
long cgl = CGL.getCGLContext(glID[0]);
long group = CGL.CGLGetShareGroup(cgl);
- properties = NativeSizeBuffer.allocateDirect(5);
+ properties = PointerBuffer.allocateDirect(5);
properties.put(CL_CGL_SHAREGROUP_KHR).put(group)
.put(CL_CONTEXT_PLATFORM).put(platform.ID);
}else if(glContext instanceof EGLContext) {
@@ -191,7 +191,7 @@ public final class CLGLContext extends CLContext {
// OpenGL ES or OpenGL context, and the attribute
// CL_EGL_DISPLAY_KHR should be set to the EGLDisplay handle of the
// display used to create the OpenGL ES or OpenGL context."
- properties = NativeSizeBuffer.allocateDirect(7);
+ properties = PointerBuffer.allocateDirect(7);
long displayHandle = ctxImpl.getDrawableImpl().getNativeSurface().getDisplayHandle();
properties.put(CL_GL_CONTEXT_KHR).put(glID[0])
.put(CL_EGL_DISPLAY_KHR).put(displayHandle)
diff --git a/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java b/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java
index ab4fcca..36718f1 100644
--- a/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java
+++ b/src/com/jogamp/opencl/impl/CLTLAccessorFactory.java
@@ -4,7 +4,7 @@
package com.jogamp.opencl.impl;
import java.nio.IntBuffer;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.CL;
import com.jogamp.opencl.llb.CLDeviceBinding;
import com.jogamp.opencl.spi.CLAccessorFactory;
@@ -41,7 +41,7 @@ public class CLTLAccessorFactory implements CLAccessorFactory {
}
@Override
- public int getInfo(int name, long valueSize, Buffer value, NativeSizeBuffer valueSizeRet) {
+ public int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) {
return cl.clGetDeviceInfo(ID, name, valueSize, value, valueSizeRet);
}
@@ -58,7 +58,7 @@ public class CLTLAccessorFactory implements CLAccessorFactory {
}
@Override
- public int getInfo(int name, long valueSize, Buffer value, NativeSizeBuffer valueSizeRet) {
+ public int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet) {
return cl.clGetPlatformInfo(ID, name, valueSize, value, valueSizeRet);
}
@@ -75,7 +75,7 @@ public class CLTLAccessorFactory implements CLAccessorFactory {
}else{
checkForError(ret, "error while enumerating devices");
- NativeSizeBuffer deviceIDs = NativeSizeBuffer.wrap(getBB(count*NativeSizeBuffer.elementSize()));
+ PointerBuffer deviceIDs = PointerBuffer.wrap(getBB(count*PointerBuffer.ELEMENT_SIZE));
ret = cl.clGetDeviceIDs(ID, type, count, deviceIDs, null);
checkForError(ret, "error while enumerating devices");
diff --git a/src/com/jogamp/opencl/impl/CLTLInfoAccessor.java b/src/com/jogamp/opencl/impl/CLTLInfoAccessor.java
index ee5d0e4..c31b22a 100644
--- a/src/com/jogamp/opencl/impl/CLTLInfoAccessor.java
+++ b/src/com/jogamp/opencl/impl/CLTLInfoAccessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 - 2010 JogAmp Community. All rights reserved.
+ * Copyright (c) 2009 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
@@ -29,7 +29,7 @@
package com.jogamp.opencl.impl;
import com.jogamp.opencl.spi.CLInfoAccessor;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.common.os.Platform;
import com.jogamp.opencl.util.CLUtil;
import java.nio.Buffer;
@@ -55,11 +55,11 @@ public abstract class CLTLInfoAccessor implements CLInfoAccessor {
}
};
- protected final static ThreadLocal<NativeSizeBuffer> localNSB = new ThreadLocal<NativeSizeBuffer>() {
+ protected final static ThreadLocal<PointerBuffer> localNSB = new ThreadLocal<PointerBuffer>() {
@Override
- protected NativeSizeBuffer initialValue() {
- return NativeSizeBuffer.allocateDirect(1);
+ protected PointerBuffer initialValue() {
+ return PointerBuffer.allocateDirect(1);
}
};
@@ -77,7 +77,7 @@ public abstract class CLTLInfoAccessor implements CLInfoAccessor {
@Override
public final String getString(int key) {
- NativeSizeBuffer sizeBuffer = getNSB();
+ PointerBuffer sizeBuffer = getNSB();
int ret = getInfo(key, 0, null, sizeBuffer);
checkForError(ret, "error while asking for info string");
@@ -122,11 +122,11 @@ public abstract class CLTLInfoAccessor implements CLInfoAccessor {
}
}
- protected NativeSizeBuffer getNSB() {
+ protected PointerBuffer getNSB() {
return localNSB.get();
}
- protected abstract int getInfo(int name, long valueSize, Buffer value, NativeSizeBuffer valueSizeRet);
+ protected abstract int getInfo(int name, long valueSize, Buffer value, PointerBuffer valueSizeRet);
}
diff --git a/src/com/jogamp/opencl/llb/impl/CLImpl.java b/src/com/jogamp/opencl/llb/impl/CLImpl.java
index d4a1672..0713ac4 100644
--- a/src/com/jogamp/opencl/llb/impl/CLImpl.java
+++ b/src/com/jogamp/opencl/llb/impl/CLImpl.java
@@ -31,7 +31,7 @@
*/
package com.jogamp.opencl.llb.impl;
-import com.jogamp.common.nio.NativeSizeBuffer;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.LongLongHashMap;
import com.jogamp.opencl.CLErrorHandler;
@@ -57,7 +57,7 @@ public class CLImpl extends CLAbstractImpl {
}
@Override
- public long clCreateContext(NativeSizeBuffer properties, NativeSizeBuffer devices, CLErrorHandler pfn_notify, IntBuffer errcode_ret) {
+ public long clCreateContext(PointerBuffer properties, PointerBuffer devices, CLErrorHandler pfn_notify, IntBuffer errcode_ret) {
if (properties != null && !properties.isDirect()) {
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
@@ -89,8 +89,7 @@ public class CLImpl extends CLAbstractImpl {
private native long clCreateContext0(Object cl_context_properties, int props_offset, int numDevices, Object devices, int devices_offset, Object pfn_notify, long[] global, Object errcode_ret, int err_offset, long address);
@Override
- public long clCreateContextFromType(NativeSizeBuffer properties, long device_type, CLErrorHandler pfn_notify, IntBuffer errcode_ret) {
-
+ public long clCreateContextFromType(PointerBuffer properties, long device_type, CLErrorHandler pfn_notify, IntBuffer errcode_ret) {
if (properties != null && !properties.isDirect()) {
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
}
@@ -138,8 +137,7 @@ public class CLImpl extends CLAbstractImpl {
/** Interface to C language function: <br> <code> int32_t clBuildProgram(cl_program, uint32_t, cl_device_id * , const char * , void * ); </code> */
@Override
- public int clBuildProgram(long program, int deviceCount, NativeSizeBuffer deviceList, String options, BuildProgramCallback cb) {
-
+ public int clBuildProgram(long program, int deviceCount, PointerBuffer deviceList, String options, BuildProgramCallback cb) {
if (deviceList != null && !deviceList.isDirect()) {
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
}
@@ -181,19 +179,19 @@ public class CLImpl extends CLAbstractImpl {
/** Interface to C language function: <br> <code> void * {@native clEnqueueMapImage}(cl_command_queue command_queue, cl_mem image, uint32_t blocking_map, uint64_t map_flags, const size_t * , const size_t * , size_t * image_row_pitch, size_t * image_slice_pitch, uint32_t num_events_in_wait_list, cl_event * event_wait_list, cl_event * event, int32_t * errcode_ret); </code>
- @param origin a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param range a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param image_row_pitch a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param image_slice_pitch a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param event_wait_list a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param event a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
+ @param origin a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param range a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param image_row_pitch a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param image_slice_pitch a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param event_wait_list a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param event a direct {@link com.jogamp.common.nio.PointerBuffer}
@param errcode_ret a direct {@link java.nio.IntBuffer} */
@Override
public ByteBuffer clEnqueueMapImage(long command_queue, long image, int blocking_map, long map_flags,
- NativeSizeBuffer origin, NativeSizeBuffer range,
- NativeSizeBuffer image_row_pitch, NativeSizeBuffer image_slice_pitch,
+ PointerBuffer origin, PointerBuffer range,
+ PointerBuffer image_row_pitch, PointerBuffer image_slice_pitch,
int num_events_in_wait_list,
- NativeSizeBuffer event_wait_list, NativeSizeBuffer event, IntBuffer errcode_ret) {
+ PointerBuffer event_wait_list, PointerBuffer event, IntBuffer errcode_ret) {
if (origin != null && !origin.isDirect()) {
throw new CLException("Argument \"origin\" was not a direct buffer");
@@ -242,12 +240,12 @@ public class CLImpl extends CLAbstractImpl {
}
/** Entry point to C language function: <code> void * {@native clEnqueueMapImage}(cl_command_queue command_queue, cl_mem image, uint32_t blocking_map, uint64_t map_flags, const size_t * , const size_t * , size_t * image_row_pitch, size_t * image_slice_pitch, uint32_t num_events_in_wait_list, cl_event * event_wait_list, cl_event * event, int32_t * errcode_ret); </code>
- @param origin a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param range a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param image_row_pitch a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param image_slice_pitch a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param event_wait_list a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
- @param event a direct {@link com.jogamp.common.nio.NativeSizeBuffer}
+ @param origin a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param range a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param image_row_pitch a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param image_slice_pitch a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param event_wait_list a direct {@link com.jogamp.common.nio.PointerBuffer}
+ @param event a direct {@link com.jogamp.common.nio.PointerBuffer}
@param errcode_ret a direct {@link java.nio.IntBuffer} */
private native ByteBuffer clEnqueueMapImage0(long command_queue, long image, int blocking_map, long map_flags,
Object origin, int origin_byte_offset, Object range, int range_byte_offset, Object image_row_pitch,
diff --git a/src/com/jogamp/opencl/util/CLBuildListener.java b/src/com/jogamp/opencl/util/CLBuildListener.java
index 0551785..acd53a5 100644
--- a/src/com/jogamp/opencl/util/CLBuildListener.java
+++ b/src/com/jogamp/opencl/util/CLBuildListener.java
@@ -40,7 +40,7 @@ import com.jogamp.opencl.CLProgram;
* Note1: registering a build callback can make {@link com.jogamp.opencl.llb.CL#clBuildProgram} non blocking (OpenCL implementation dependent).<br/>
* Note2: the thread which calls this method is unspecified. The Application should ensure propper synchronization.
* @author Michael Bien
- * @see com.jogamp.opencl.llb.CL#clBuildProgram(long, int, com.jogamp.common.nio.NativeSizeBuffer, java.lang.String, com.jogamp.opencl.llb.impl.BuildProgramCallback)
+ * @see com.jogamp.opencl.llb.CL#clBuildProgram(long, int, com.jogamp.common.nio.PointerBuffer, java.lang.String, com.jogamp.opencl.llb.impl.BuildProgramCallback)
*/
public interface CLBuildListener {
diff --git a/test/com/jogamp/opencl/LowLevelBindingTest.java b/test/com/jogamp/opencl/LowLevelBindingTest.java
index 655bfc6..c8e27a6 100644
--- a/test/com/jogamp/opencl/LowLevelBindingTest.java
+++ b/test/com/jogamp/opencl/LowLevelBindingTest.java
@@ -29,8 +29,8 @@
package com.jogamp.opencl;
import java.util.Random;
+import com.jogamp.common.nio.PointerBuffer;
import com.jogamp.opencl.llb.impl.BuildProgramCallback;
-import com.jogamp.common.nio.NativeSizeBuffer;
import com.jogamp.opencl.llb.CL;
import java.nio.ByteBuffer;
@@ -110,12 +110,12 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#platforms: "+intBuffer.get(0));
- NativeSizeBuffer platformId = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer platformId = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetPlatformIDs(platformId.capacity(), platformId, null);
checkForError(ret);
// print platform info
- NativeSizeBuffer longBuffer = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ByteBuffer bb = newDirectByteBuffer(128);
for (int i = 0; i < platformId.capacity(); i++) {
@@ -144,7 +144,7 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#devices: "+intBuffer.get(0));
- NativeSizeBuffer devices = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer devices = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetDeviceIDs(platform, CL.CL_DEVICE_TYPE_ALL, devices.capacity(), devices, null);
//print device info
@@ -177,7 +177,7 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#platforms: "+intBuffer.get(0));
- NativeSizeBuffer pb = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer pb = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetPlatformIDs(pb.capacity(), pb, null);
checkForError(ret);
@@ -188,14 +188,14 @@ public class LowLevelBindingTest {
checkForError(ret);
out.println("#devices: "+intBuffer.get(0));
- NativeSizeBuffer devices = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer devices = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetDeviceIDs(platform, CL.CL_DEVICE_TYPE_ALL, devices.capacity(), devices, null);
long context = cl.clCreateContext(null, devices, null, intBuffer);
checkError("on clCreateContext", intBuffer.get());
//get number of devices
- NativeSizeBuffer longBuffer = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longBuffer);
checkError("on clGetContextInfo", ret);
@@ -224,19 +224,19 @@ public class LowLevelBindingTest {
checkForError(ret);
assertTrue(intBuffer.get(0) > 0);
- NativeSizeBuffer pb = NativeSizeBuffer.allocateDirect(intBuffer.get(0));
+ PointerBuffer pb = PointerBuffer.allocateDirect(intBuffer.get(0));
ret = cl.clGetPlatformIDs(pb.capacity(), pb, null);
checkForError(ret);
long platform = pb.get(0);
- NativeSizeBuffer properties = NativeSizeBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM)
+ PointerBuffer properties = PointerBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM)
.put(platform).put(0) // 0 terminated array
.rewind();
long context = cl.clCreateContextFromType(properties, CL.CL_DEVICE_TYPE_ALL, null, null);
out.println("context handle: "+context);
checkError("on clCreateContextFromType", ret);
- NativeSizeBuffer longBuffer = NativeSizeBuffer.allocateDirect(1);
+ PointerBuffer longBuffer = PointerBuffer.allocateDirect(1);
ret = cl.clGetContextInfo(context, CL.CL_CONTEXT_DEVICES, 0, null, longBuffer);
checkError("on clGetContextInfo", ret);
@@ -285,7 +285,7 @@ public class LowLevelBindingTest {
// Create the program
- NativeSizeBuffer lengths = NativeSizeBuffer.allocateDirect(1).put(programSource.length()).rewind();
+ PointerBuffer lengths = PointerBuffer.allocateDirect(1).put(programSource.length()).rewind();
final long program = cl.clCreateProgramWithSource(context, 1, new String[] {programSource}, lengths, intBuffer);
out.println("program id: "+program);
checkError("on clCreateProgramWithSource", intBuffer.get(0));
@@ -372,8 +372,8 @@ public class LowLevelBindingTest {
checkError("on clEnqueueWriteBuffer", ret);
// Launch kernel
- NativeSizeBuffer gWS = NativeSizeBuffer.allocateDirect(1).put(globalWorkSize).rewind();
- NativeSizeBuffer lWS = NativeSizeBuffer.allocateDirect(1).put(localWorkSize).rewind();
+ PointerBuffer gWS = PointerBuffer.allocateDirect(1).put(globalWorkSize).rewind();
+ PointerBuffer lWS = PointerBuffer.allocateDirect(1).put(localWorkSize).rewind();
ret = cl.clEnqueueNDRangeKernel(commandQueue, kernel, 1, null, gWS, lWS, 0, null, null);
checkError("on clEnqueueNDRangeKernel", ret);
@@ -466,4 +466,4 @@ public class LowLevelBindingTest {
}
-} \ No newline at end of file
+}