diff options
author | Michael Bien <[email protected]> | 2009-11-01 01:05:08 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2009-11-01 01:05:08 +0100 |
commit | 0c2be38282bbba718f41895e43b057c87036d363 (patch) | |
tree | 86cb119af4ac60616e24aac8ddb4b4d3e047b314 /src/com/mbien/opencl/CLCommandQueue.java | |
parent | 905a38eb0a435a31ba5a4a9091dfc67350fc8fa8 (diff) |
added remaining utility getters to CLDevice.
Diffstat (limited to 'src/com/mbien/opencl/CLCommandQueue.java')
-rw-r--r-- | src/com/mbien/opencl/CLCommandQueue.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java index 28c4bad0..d58cc162 100644 --- a/src/com/mbien/opencl/CLCommandQueue.java +++ b/src/com/mbien/opencl/CLCommandQueue.java @@ -1,5 +1,8 @@ package com.mbien.opencl; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; import static com.mbien.opencl.CLException.*; /** @@ -226,5 +229,19 @@ public class CLCommandQueue { } return null; } + + public static EnumSet<Mode> valuesOf(int bitfield) { + List<Mode> matching = new ArrayList<Mode>(); + Mode[] values = Mode.values(); + for (Mode value : values) { + if((value.CL_QUEUE_MODE & bitfield) != 0) + matching.add(value); + } + if(matching.isEmpty()) + return EnumSet.noneOf(Mode.class); + else + return EnumSet.copyOf(matching); + } + } } |