summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/llb
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:35:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:35:47 +0200
commita90ee128ce0550cd05f969d0283312c2f42b8254 (patch)
treedade644101970d8f69ea3845db310499f2b66a76 /src/com/jogamp/opencl/llb
parenta0e0c8a39d0ef41ff6b64d9b40d058f21b786e81 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/com/jogamp/opencl/llb')
-rw-r--r--src/com/jogamp/opencl/llb/impl/BuildProgramCallback.java10
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java12
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLEventCallback.java8
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLImpl.java30
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLMemObjectDestructorCallback.java10
5 files changed, 36 insertions, 34 deletions
diff --git a/src/com/jogamp/opencl/llb/impl/BuildProgramCallback.java b/src/com/jogamp/opencl/llb/impl/BuildProgramCallback.java
index 51bde322..58806610 100644
--- a/src/com/jogamp/opencl/llb/impl/BuildProgramCallback.java
+++ b/src/com/jogamp/opencl/llb/impl/BuildProgramCallback.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -43,5 +43,5 @@ public interface BuildProgramCallback {
* has been built (successfully or unsuccessfully).
*/
public void buildFinished(long cl_program);
-
+
}
diff --git a/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java b/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java
index 19d89fc1..517e1002 100644
--- a/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java
+++ b/src/com/jogamp/opencl/llb/impl/CLDynamicLibraryBundleInfo.java
@@ -39,6 +39,8 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
+import jogamp.common.os.PlatformPropsImpl;
+
public final class CLDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo {
private static final boolean isAndroid;
private static final List<String> glueLibNames;
@@ -55,7 +57,7 @@ public final class CLDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
return null;
}
});
- isAndroid = Platform.OSType.ANDROID == Platform.OS_TYPE;
+ isAndroid = Platform.OSType.ANDROID == PlatformPropsImpl.OS_TYPE;
glueLibNames = new ArrayList<String>();
glueLibNames.add("jocl");
@@ -95,7 +97,7 @@ public final class CLDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
@Override
public final List<List<String>> getToolLibNames() {
- List<List<String>> libNamesList = new ArrayList<List<String>>();
+ final List<List<String>> libNamesList = new ArrayList<List<String>>();
final List<String> libCL = new ArrayList<String>();
{
@@ -126,7 +128,7 @@ public final class CLDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
@Override
public final List<String> getToolGetProcAddressFuncNameList() {
- List<String> res = new ArrayList<String>();
+ final List<String> res = new ArrayList<String>();
res.add("clGetExtensionFunctionAddress");
return res;
}
@@ -141,13 +143,13 @@ public final class CLDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
funcName = funcName.substring(0, funcName.length() - Impl_len);
}
if( funcName.endsWith("KHR") || funcName.endsWith("EXT") ) {
- return CLImpl.clGetExtensionFunctionAddress(toolGetProcAddressHandle, funcName);
+ return CLAbstractImpl.clGetExtensionFunctionAddress(toolGetProcAddressHandle, funcName);
}
return 0; // on libs ..
}
@Override
- public final boolean useToolGetProcAdressFirst(String funcName) {
+ public final boolean useToolGetProcAdressFirst(final String funcName) {
return true;
}
diff --git a/src/com/jogamp/opencl/llb/impl/CLEventCallback.java b/src/com/jogamp/opencl/llb/impl/CLEventCallback.java
index 1373995a..352e02a3 100644
--- a/src/com/jogamp/opencl/llb/impl/CLEventCallback.java
+++ b/src/com/jogamp/opencl/llb/impl/CLEventCallback.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
diff --git a/src/com/jogamp/opencl/llb/impl/CLImpl.java b/src/com/jogamp/opencl/llb/impl/CLImpl.java
index 57d45dfc..6eb9cde5 100644
--- a/src/com/jogamp/opencl/llb/impl/CLImpl.java
+++ b/src/com/jogamp/opencl/llb/impl/CLImpl.java
@@ -56,7 +56,7 @@ public class CLImpl extends CLAbstractImpl {
}
@Override
- public long clCreateContext(PointerBuffer properties, PointerBuffer devices, CLErrorHandler pfn_notify, IntBuffer errcode_ret) {
+ public long clCreateContext(final PointerBuffer properties, final PointerBuffer devices, final CLErrorHandler pfn_notify, final IntBuffer errcode_ret) {
if (properties != null && !properties.isDirect()) {
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
@@ -71,8 +71,8 @@ public class CLImpl extends CLAbstractImpl {
throw new UnsupportedOperationException("Method not available");
}
- long[] global = new long[1];
- long ctx = this.clCreateContext0(
+ final long[] global = new long[1];
+ final long ctx = this.clCreateContext0(
properties != null ? properties.getBuffer() : null, getDirectBufferByteOffset(properties),
devices != null ? devices.remaining() : 0, devices != null ? devices.getBuffer() : null, getDirectBufferByteOffset(devices),
pfn_notify, global, errcode_ret, getDirectBufferByteOffset(errcode_ret), address);
@@ -88,7 +88,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(PointerBuffer properties, long device_type, CLErrorHandler pfn_notify, IntBuffer errcode_ret) {
+ public long clCreateContextFromType(final PointerBuffer properties, final long device_type, final CLErrorHandler pfn_notify, final IntBuffer errcode_ret) {
if (properties != null && !properties.isDirect()) {
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
}
@@ -102,8 +102,8 @@ public class CLImpl extends CLAbstractImpl {
throw new UnsupportedOperationException("Method not available");
}
- long[] global = new long[1];
- long ctx = this.clCreateContextFromType0(
+ final long[] global = new long[1];
+ final long ctx = this.clCreateContextFromType0(
properties != null ? properties.getBuffer() : null, getDirectBufferByteOffset(properties),
device_type, pfn_notify, global, errcode_ret, getDirectBufferByteOffset(errcode_ret), address);
@@ -118,7 +118,7 @@ public class CLImpl extends CLAbstractImpl {
private native long clCreateContextFromType0(Object properties, int props_offset, long device_type, Object pfn_notify, long[] global, Object errcode_ret, int err_offset, long address);
@Override
- public int clReleaseContext(long context) {
+ public int clReleaseContext(final long context) {
long global = 0;
synchronized (contextCallbackMap) {
global = contextCallbackMap.remove(context);
@@ -136,7 +136,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, PointerBuffer deviceList, String options, BuildProgramCallback cb) {
+ public int clBuildProgram(final long program, final int deviceCount, final PointerBuffer deviceList, final String options, final BuildProgramCallback cb) {
if (deviceList != null && !deviceList.isDirect()) {
throw new RuntimeException("Argument \"properties\" was not a direct buffer");
}
@@ -154,7 +154,7 @@ public class CLImpl extends CLAbstractImpl {
@Override
- public int clSetEventCallback(long event, int trigger, CLEventCallback callback) {
+ public int clSetEventCallback(final long event, final int trigger, final CLEventCallback callback) {
final long address = addressTable._addressof_clSetEventCallback;
if (address == 0) {
throw new UnsupportedOperationException("Method not available");
@@ -166,7 +166,7 @@ public class CLImpl extends CLAbstractImpl {
@Override
- public int clSetMemObjectDestructorCallback(long memObjID, CLMemObjectDestructorCallback cb) {
+ public int clSetMemObjectDestructorCallback(final long memObjID, final CLMemObjectDestructorCallback cb) {
final long address = addressTable._addressof_clSetMemObjectDestructorCallback;
if (address == 0) {
throw new UnsupportedOperationException("Method not available");
@@ -186,11 +186,11 @@ public class CLImpl extends CLAbstractImpl {
@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,
- PointerBuffer origin, PointerBuffer range,
- PointerBuffer image_row_pitch, PointerBuffer image_slice_pitch,
- int num_events_in_wait_list,
- PointerBuffer event_wait_list, PointerBuffer event, IntBuffer errcode_ret) {
+ public ByteBuffer clEnqueueMapImage(final long command_queue, final long image, final int blocking_map, final long map_flags,
+ final PointerBuffer origin, final PointerBuffer range,
+ final PointerBuffer image_row_pitch, final PointerBuffer image_slice_pitch,
+ final int num_events_in_wait_list,
+ final PointerBuffer event_wait_list, final PointerBuffer event, final IntBuffer errcode_ret) {
if (origin != null && !origin.isDirect()) {
throw new CLException("Argument \"origin\" was not a direct buffer");
diff --git a/src/com/jogamp/opencl/llb/impl/CLMemObjectDestructorCallback.java b/src/com/jogamp/opencl/llb/impl/CLMemObjectDestructorCallback.java
index 5ed57cce..b80eb093 100644
--- a/src/com/jogamp/opencl/llb/impl/CLMemObjectDestructorCallback.java
+++ b/src/com/jogamp/opencl/llb/impl/CLMemObjectDestructorCallback.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -40,7 +40,7 @@ package com.jogamp.opencl.llb.impl;
public interface CLMemObjectDestructorCallback {
/**
- *
+ *
*/
public void memoryDeallocated(long memObjID);