summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/util/CLUtil.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-09-17 05:56:16 +0200
committerMichael Bien <[email protected]>2011-09-17 05:56:16 +0200
commit58eca7ee6b1743f471576ff77c6508dd2a886595 (patch)
tree8977c90f835fec87007325185e251f2e69583661 /src/com/jogamp/opencl/util/CLUtil.java
parent1247f00729e168d1cfb1991ed43f9d64bd9227bd (diff)
Reduction supports now cl.util.concurrent package.
toString() and other minor changes moved roundUp to CLUtil.
Diffstat (limited to 'src/com/jogamp/opencl/util/CLUtil.java')
-rw-r--r--src/com/jogamp/opencl/util/CLUtil.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/util/CLUtil.java b/src/com/jogamp/opencl/util/CLUtil.java
index ff04f745..5c90be56 100644
--- a/src/com/jogamp/opencl/util/CLUtil.java
+++ b/src/com/jogamp/opencl/util/CLUtil.java
@@ -85,6 +85,18 @@ public class CLUtil {
}
/**
+ * Rounds the value up to the nearest multiple.
+ */
+ public static int roundUp(int value, int requiredMultiple) {
+ int r = value % requiredMultiple;
+ if (r == 0) {
+ return value;
+ } else {
+ return value + requiredMultiple - r;
+ }
+ }
+
+ /**
* Reads chars from input stream and puts them into the supplied StringBuilder.
* The stream is closed after successful or unsuccessful read.
*/