diff options
author | Michael Bien <[email protected]> | 2010-02-24 16:00:35 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-02-24 16:00:35 +0100 |
commit | 0b0a4735f71f1e34adf426a1c033b94aca01ab75 (patch) | |
tree | 22d430272f1554f87a8bc7ca91d26e92c2aa5cde | |
parent | 01775d5597d6d1ef4fff195f572c1a6528438f66 (diff) |
code review, spell checks and scope.
-rw-r--r-- | resources/clImplCustomCode.java | 2 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLBuffer.java | 2 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLCommandQueue.java | 2 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLContext.java | 2 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLDevice.java | 12 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLGLContext.java | 2 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLKernel.java | 4 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLMemory.java | 2 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLPlatform.java | 2 | ||||
-rw-r--r-- | src/com/mbien/opencl/CLUtils.java | 12 | ||||
-rw-r--r-- | test/com/mbien/opencl/CLBufferTest.java | 8 |
11 files changed, 25 insertions, 25 deletions
diff --git a/resources/clImplCustomCode.java b/resources/clImplCustomCode.java index 86366a10..a9576444 100644 --- a/resources/clImplCustomCode.java +++ b/resources/clImplCustomCode.java @@ -118,7 +118,7 @@ private native java.nio.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, int image_row_pitch_byte_offset, Object image_slice_pitch, int image_slice_pitch_byte_offset, int num_events_in_wait_list, Object event_wait_list, int event_wait_list_byte_offset, Object event, int event_byte_offset, Object errcode_ret, int errcode_ret_byte_offset); - private final static void convert32To64(long[] values) { + private static void convert32To64(long[] values) { if(values.length%2 == 1) { values[values.length-1] = values[values.length/2]>>>32; } diff --git a/src/com/mbien/opencl/CLBuffer.java b/src/com/mbien/opencl/CLBuffer.java index ebde221c..1895018d 100644 --- a/src/com/mbien/opencl/CLBuffer.java +++ b/src/com/mbien/opencl/CLBuffer.java @@ -10,7 +10,7 @@ import static com.mbien.opencl.CLException.*; */ public class CLBuffer<B extends Buffer> extends CLMemory<B> { - public CLBuffer(CLContext context, long id) { + protected CLBuffer(CLContext context, long id) { super(context, id); } diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java index 269b0e6e..7351d22a 100644 --- a/src/com/mbien/opencl/CLCommandQueue.java +++ b/src/com/mbien/opencl/CLCommandQueue.java @@ -807,7 +807,7 @@ public class CLCommandQueue extends CLObject implements CLResource { /** * Setting properties after a command queue has been created can be implementation specific, - * please refere to the specification ({@native clSetCommandQueueProperty}) or vendor documentation. + * please refer to the specification ({@native clSetCommandQueueProperty}) or vendor documentation. */ public void setProperty(Mode property, boolean enabled) { int ret = cl.clSetCommandQueueProperty(ID, property.QUEUE_MODE, clBoolean(enabled), null); diff --git a/src/com/mbien/opencl/CLContext.java b/src/com/mbien/opencl/CLContext.java index 68c391f1..73146acd 100644 --- a/src/com/mbien/opencl/CLContext.java +++ b/src/com/mbien/opencl/CLContext.java @@ -203,7 +203,7 @@ public class CLContext extends CLObject implements CLResource { BufferedReader reader = new BufferedReader(new InputStreamReader(sources)); StringBuilder sb = new StringBuilder(); - String line = null; + String line; try { while ((line = reader.readLine()) != null) sb.append(line).append("\n"); diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java index 3c1c4e25..a4a4b380 100644 --- a/src/com/mbien/opencl/CLDevice.java +++ b/src/com/mbien/opencl/CLDevice.java @@ -130,7 +130,7 @@ public final class CLDevice extends CLObject { * Preferred native vector width size for built-in short vectors. * The vector width is defined as the number of scalar elements that can be stored in the vector. */ - public int getPreferedShortVectorWidth() { + public int getPreferredShortVectorWidth() { return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT); } @@ -138,7 +138,7 @@ public final class CLDevice extends CLObject { * Preferred native vector width size for built-in char vectors. * The vector width is defined as the number of scalar elements that can be stored in the vector. */ - public int getPreferedCharVectorWidth() { + public int getPreferredCharVectorWidth() { return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR); } @@ -146,7 +146,7 @@ public final class CLDevice extends CLObject { * Preferred native vector width size for built-in int vectors. * The vector width is defined as the number of scalar elements that can be stored in the vector. */ - public int getPreferedIntVectorWidth() { + public int getPreferredIntVectorWidth() { return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT); } @@ -154,7 +154,7 @@ public final class CLDevice extends CLObject { * Preferred native vector width size for built-in long vectors. * The vector width is defined as the number of scalar elements that can be stored in the vector. */ - public int getPreferedLongVectorWidth() { + public int getPreferredLongVectorWidth() { return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG); } @@ -162,7 +162,7 @@ public final class CLDevice extends CLObject { * Preferred native vector width size for built-in float vectors. * The vector width is defined as the number of scalar elements that can be stored in the vector. */ - public int getPreferedFloatVectorWidth() { + public int getPreferredFloatVectorWidth() { return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT); } @@ -170,7 +170,7 @@ public final class CLDevice extends CLObject { * Preferred native vector width size for built-in double vectors. * The vector width is defined as the number of scalar elements that can be stored in the vector. */ - public int getPreferedDoubleVectorWidth() { + public int getPreferredDoubleVectorWidth() { return (int)deviceInfo.getLong(CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE); } diff --git a/src/com/mbien/opencl/CLGLContext.java b/src/com/mbien/opencl/CLGLContext.java index e10ae6e7..49fa7fac 100644 --- a/src/com/mbien/opencl/CLGLContext.java +++ b/src/com/mbien/opencl/CLGLContext.java @@ -108,7 +108,7 @@ public final class CLGLContext extends CLContext { DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration)ctxImpl.getDrawableImpl() .getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration(); - PointerBuffer properties = null; + PointerBuffer properties; if(glContext instanceof X11GLXContext) { properties = PointerBuffer.allocateDirect(7); long handle = config.getScreen().getDevice().getHandle(); diff --git a/src/com/mbien/opencl/CLKernel.java b/src/com/mbien/opencl/CLKernel.java index 1ba84d1c..865c7bf5 100644 --- a/src/com/mbien/opencl/CLKernel.java +++ b/src/com/mbien/opencl/CLKernel.java @@ -144,7 +144,7 @@ public class CLKernel extends CLObject implements CLResource, Cloneable { } if(!program.isExecutable()) { throw new IllegalStateException("can not set program" + - " arguments for a not excecutable program. "+program); + " arguments for a not executable program. "+program); } int ret = cl.clSetKernelArg(ID, argumentIndex, size, value); @@ -153,7 +153,7 @@ public class CLKernel extends CLObject implements CLResource, Cloneable { /** * Forces double and long arguments to be passed as float and int to the OpenCL kernel. - * This can be used in applications which want to mix kernels with different floating point precison. + * This can be used in applications which want to mix kernels with different floating point precision. */ public CLKernel setForce32BitArgs(boolean force) { this.force32BitArgs = force; diff --git a/src/com/mbien/opencl/CLMemory.java b/src/com/mbien/opencl/CLMemory.java index 28de48ed..aa65e806 100644 --- a/src/com/mbien/opencl/CLMemory.java +++ b/src/com/mbien/opencl/CLMemory.java @@ -91,7 +91,7 @@ public abstract class CLMemory <B extends Buffer> extends CLObject implements CL public long getCLSize() { PointerBuffer pb = PointerBuffer.allocateDirect(1); int ret = cl.clGetMemObjectInfo(ID, CL_MEM_SIZE, PointerBuffer.elementSize(), pb.getBuffer(), null); - checkForError(ret, "can not optain buffer info"); + checkForError(ret, "can not obtain buffer info"); return pb.get(); } diff --git a/src/com/mbien/opencl/CLPlatform.java b/src/com/mbien/opencl/CLPlatform.java index ddca7d38..597878b3 100644 --- a/src/com/mbien/opencl/CLPlatform.java +++ b/src/com/mbien/opencl/CLPlatform.java @@ -35,7 +35,7 @@ public final class CLPlatform { cl = new CLImpl(); } - CLPlatform(long id) { + private CLPlatform(long id) { this.ID = id; } diff --git a/src/com/mbien/opencl/CLUtils.java b/src/com/mbien/opencl/CLUtils.java index 0f948175..8f89980e 100644 --- a/src/com/mbien/opencl/CLUtils.java +++ b/src/com/mbien/opencl/CLUtils.java @@ -100,12 +100,12 @@ class CLUtils { map.put("CL_DEVICE_DOUBLE_FP_CONFIG", dev.getDoubleFPConfig()+""); map.put("CL_DEVICE_EXTENSIONS", dev.getExtensions()+""); - map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT", dev.getPreferedShortVectorWidth()+""); - map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR", dev.getPreferedCharVectorWidth()+""); - map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT", dev.getPreferedIntVectorWidth()+""); - map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG", dev.getPreferedLongVectorWidth()+""); - map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT", dev.getPreferedFloatVectorWidth()+""); - map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE", dev.getPreferedDoubleVectorWidth()+""); + map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT", dev.getPreferredShortVectorWidth()+""); + map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR", dev.getPreferredCharVectorWidth()+""); + map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT", dev.getPreferredIntVectorWidth()+""); + map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG", dev.getPreferredLongVectorWidth()+""); + map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT", dev.getPreferredFloatVectorWidth()+""); + map.put("CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE", dev.getPreferredDoubleVectorWidth()+""); //TODO device extensions -> properties diff --git a/test/com/mbien/opencl/CLBufferTest.java b/test/com/mbien/opencl/CLBufferTest.java index 39f85a75..7a16e9d7 100644 --- a/test/com/mbien/opencl/CLBufferTest.java +++ b/test/com/mbien/opencl/CLBufferTest.java @@ -26,7 +26,7 @@ public class CLBufferTest { CLContext context = CLContext.create(); - // the CL.MEM_* flag is probably completly irrelevant in our case since we do not use a kernel in this test + // the CL.MEM_* flag is probably completely irrelevant in our case since we do not use a kernel in this test CLBuffer<ByteBuffer> clBufferA = context.createByteBuffer(elements*SIZEOF_INT, Mem.READ_ONLY); CLBuffer<ByteBuffer> clBufferB = context.createByteBuffer(elements*SIZEOF_INT, Mem.READ_ONLY); @@ -101,9 +101,9 @@ public class CLBufferTest { final int elements = NUM_ELEMENTS; final int sizeInBytes = elements*SIZEOF_INT; - CLContext context = null; - CLBuffer<?> clBufferA = null; - CLBuffer<?> clBufferB = null; + CLContext context; + CLBuffer<?> clBufferA; + CLBuffer<?> clBufferB; // We will have to allocate mappable NIO memory on non CPU contexts // since we can't map e.g GPU memory. |