summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLCommandQueue.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-11-01 01:05:08 +0100
committerMichael Bien <[email protected]>2009-11-01 01:05:08 +0100
commit0c2be38282bbba718f41895e43b057c87036d363 (patch)
tree86cb119af4ac60616e24aac8ddb4b4d3e047b314 /src/com/mbien/opencl/CLCommandQueue.java
parent905a38eb0a435a31ba5a4a9091dfc67350fc8fa8 (diff)
added remaining utility getters to CLDevice.
Diffstat (limited to 'src/com/mbien/opencl/CLCommandQueue.java')
-rw-r--r--src/com/mbien/opencl/CLCommandQueue.java17
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);
+ }
+
}
}