diff options
author | Michael Bien <[email protected]> | 2011-09-17 05:56:16 +0200 |
---|---|---|
committer | Michael Bien <[email protected]> | 2011-09-17 05:56:16 +0200 |
commit | 58eca7ee6b1743f471576ff77c6508dd2a886595 (patch) | |
tree | 8977c90f835fec87007325185e251f2e69583661 /src/com/jogamp/opencl/util/CLUtil.java | |
parent | 1247f00729e168d1cfb1991ed43f9d64bd9227bd (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.java | 12 |
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. */ |