summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-02-13 13:57:31 +0100
committerMichael Bien <[email protected]>2011-02-13 13:57:31 +0100
commite4f978fef8c2805413190f356f9101f6cd3a56cc (patch)
tree3419bbe81a1b51f3653383094c53918779ef5fd4
parent8cc4dacf765452fb10c3f16076b26955994f2b80 (diff)
fixed compiler redundant-casts warnings due to language level changes in gluegen-rt.
-rw-r--r--src/com/jogamp/opencl/CLBuffer.java3
-rw-r--r--src/com/jogamp/opencl/CLCommandQueue.java6
-rw-r--r--src/com/jogamp/opencl/CLContext.java2
-rw-r--r--src/com/jogamp/opencl/CLDevice.java2
-rw-r--r--src/com/jogamp/opencl/CLEventList.java1
-rw-r--r--src/com/jogamp/opencl/CLProgram.java2
-rw-r--r--src/com/jogamp/opencl/gl/CLGLContext.java2
-rw-r--r--test/com/jogamp/opencl/HighLevelBindingTest.java4
-rw-r--r--test/com/jogamp/opencl/LowLevelBindingTest.java8
9 files changed, 17 insertions, 13 deletions
diff --git a/src/com/jogamp/opencl/CLBuffer.java b/src/com/jogamp/opencl/CLBuffer.java
index d1cb5670..fed7db11 100644
--- a/src/com/jogamp/opencl/CLBuffer.java
+++ b/src/com/jogamp/opencl/CLBuffer.java
@@ -102,7 +102,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
B slice = null;
if(buffer != null) {
- slice = (B)Buffers.slice(buffer, offset, size);
+ slice = Buffers.slice(buffer, offset, size);
int elemSize = Buffers.sizeOfBufferElem(buffer);
offset *= elemSize;
size *= elemSize;
@@ -141,6 +141,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> {
/**
* Returns the list of subbuffers.
*/
+ @SuppressWarnings("unchecked")
public List<CLSubBuffer<B>> getSubBuffers() {
if(childs == null) {
return Collections.EMPTY_LIST;
diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java
index a9955797..15fd1480 100644
--- a/src/com/jogamp/opencl/CLCommandQueue.java
+++ b/src/com/jogamp/opencl/CLCommandQueue.java
@@ -1693,7 +1693,7 @@ public class CLCommandQueue extends CLObject implements CLResource {
}
private static PointerBuffer copy2NIO(PointerBuffer buffer, long a) {
- return (PointerBuffer) buffer.put(2, a).position(2);
+ return buffer.put(2, a).position(2);
}
// private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b) {
@@ -1705,11 +1705,11 @@ public class CLCommandQueue extends CLObject implements CLResource {
// }
private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b) {
- return (PointerBuffer) ((PointerBuffer)buffer.position(1)).put(a).put(b).position(1);
+ return buffer.position(1).put(a).put(b).position(1);
}
private static PointerBuffer copy2NIO(PointerBuffer buffer, long a, long b, long c) {
- return (PointerBuffer) ((PointerBuffer)buffer.rewind()).put(a).put(b).put(c).rewind();
+ return buffer.rewind().put(a).put(b).put(c).rewind();
}
private static String toStr(PointerBuffer buffer) {
diff --git a/src/com/jogamp/opencl/CLContext.java b/src/com/jogamp/opencl/CLContext.java
index 240f6d00..a5f4e52e 100644
--- a/src/com/jogamp/opencl/CLContext.java
+++ b/src/com/jogamp/opencl/CLContext.java
@@ -236,7 +236,7 @@ public class CLContext extends CLObject implements CLResource {
throw new RuntimeException("no OpenCL installation found");
}
- return (PointerBuffer)PointerBuffer.allocateDirect(3).put(CL.CL_CONTEXT_PLATFORM)
+ return PointerBuffer.allocateDirect(3).put(CL.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 8d45a116..fd1d93f3 100644
--- a/src/com/jogamp/opencl/CLDevice.java
+++ b/src/com/jogamp/opencl/CLDevice.java
@@ -354,7 +354,7 @@ public final class CLDevice extends CLObject {
}
/**
- * Returns the maximal allocatable memory on this device.
+ * Returns the largest allocatable size of a {@link CLBuffer} on this device.
*/
@CLProperty("CL_DEVICE_MAX_MEM_ALLOC_SIZE")
public long getMaxMemAllocSize() {
diff --git a/src/com/jogamp/opencl/CLEventList.java b/src/com/jogamp/opencl/CLEventList.java
index c20a1f82..03a6f838 100644
--- a/src/com/jogamp/opencl/CLEventList.java
+++ b/src/com/jogamp/opencl/CLEventList.java
@@ -82,6 +82,7 @@ public final class CLEventList implements CLResource, AutoCloseable, Iterable<CL
/**
* @deprecated use {@link #release()} instead.
*/
+ @Deprecated
public final void close() throws Exception {
release();
}
diff --git a/src/com/jogamp/opencl/CLProgram.java b/src/com/jogamp/opencl/CLProgram.java
index 323e9b34..3cb63003 100644
--- a/src/com/jogamp/opencl/CLProgram.java
+++ b/src/com/jogamp/opencl/CLProgram.java
@@ -75,7 +75,7 @@ public class CLProgram extends CLObject implements CLResource {
IntBuffer status = newDirectIntBuffer(1);
- PointerBuffer length = (PointerBuffer)PointerBuffer.allocateDirect(1).put(0, src.length());
+ PointerBuffer length = PointerBuffer.allocateDirect(1).put(0, src.length());
String[] srcArray = new String[] {src};
// Create the program
diff --git a/src/com/jogamp/opencl/gl/CLGLContext.java b/src/com/jogamp/opencl/gl/CLGLContext.java
index fc3d34aa..c220fcfc 100644
--- a/src/com/jogamp/opencl/gl/CLGLContext.java
+++ b/src/com/jogamp/opencl/gl/CLGLContext.java
@@ -197,7 +197,7 @@ public final class CLGLContext extends CLContext {
throw new RuntimeException("unsupported GLContext: "+glContext);
}
- return (PointerBuffer)properties.put(0).rewind(); // 0 terminated array
+ return properties.put(0).rewind(); // 0 terminated array
}
// Buffers
diff --git a/test/com/jogamp/opencl/HighLevelBindingTest.java b/test/com/jogamp/opencl/HighLevelBindingTest.java
index 6b66e762..749db3a6 100644
--- a/test/com/jogamp/opencl/HighLevelBindingTest.java
+++ b/test/com/jogamp/opencl/HighLevelBindingTest.java
@@ -40,6 +40,7 @@ import com.jogamp.opencl.CLDevice.LocalMemType;
import com.jogamp.opencl.CLDevice.Type;
import com.jogamp.opencl.CLDevice.Capabilities;
import java.io.IOException;
+import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.EnumSet;
@@ -285,7 +286,8 @@ public class HighLevelBindingTest {
out.println("max FLOPS device: " + context.getMaxFlopsDevice());
- CLProgram program = context.createProgram(getClass().getResourceAsStream("testkernels.cl")).build();
+ InputStream stream = getClass().getResourceAsStream("testkernels.cl");
+ CLProgram program = context.createProgram(stream).build();
CLDevice[] programDevices = program.getCLDevices();
CLDevice device = programDevices[0];
diff --git a/test/com/jogamp/opencl/LowLevelBindingTest.java b/test/com/jogamp/opencl/LowLevelBindingTest.java
index 27f71554..d5ef3f50 100644
--- a/test/com/jogamp/opencl/LowLevelBindingTest.java
+++ b/test/com/jogamp/opencl/LowLevelBindingTest.java
@@ -228,7 +228,7 @@ public class LowLevelBindingTest {
checkForError(ret);
long platform = pb.get(0);
- PointerBuffer properties = (PointerBuffer)PointerBuffer.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);
@@ -284,7 +284,7 @@ public class LowLevelBindingTest {
// Create the program
- PointerBuffer lengths = (PointerBuffer)PointerBuffer.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));
@@ -370,8 +370,8 @@ public class LowLevelBindingTest {
checkError("on clEnqueueWriteBuffer", ret);
// Launch kernel
- PointerBuffer gWS = (PointerBuffer) PointerBuffer.allocateDirect(1).put(globalWorkSize).rewind();
- PointerBuffer lWS = (PointerBuffer) PointerBuffer.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);