summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLCommandQueue.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-10-23 00:21:58 +0200
committerMichael Bien <[email protected]>2009-10-23 00:21:58 +0200
commit054e5005d1429ba6ea4f9283eee2988ff54d1abb (patch)
tree163f7124f6dba109de965f3382f8b2613cf2068c /src/com/mbien/opencl/CLCommandQueue.java
parent503845224a820c0b9ce9204aa6215519f6b93c36 (diff)
utility methods and refactoring.
Diffstat (limited to 'src/com/mbien/opencl/CLCommandQueue.java')
-rw-r--r--src/com/mbien/opencl/CLCommandQueue.java38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/com/mbien/opencl/CLCommandQueue.java b/src/com/mbien/opencl/CLCommandQueue.java
index 5abc5cd5..00e1d6b0 100644
--- a/src/com/mbien/opencl/CLCommandQueue.java
+++ b/src/com/mbien/opencl/CLCommandQueue.java
@@ -3,7 +3,12 @@ package com.mbien.opencl;
import static com.mbien.opencl.CLException.*;
/**
- *
+ * The command-queue can be used to queue a set of operations in order. Having multiple
+ * command-queues allows applications to queue multiple independent commands without
+ * requiring synchronization. Note that this should work as long as these objects are
+ * not being shared.<b/>
+ * Sharing of objects across multiple command-queues will require the application to
+ * perform appropriate synchronization.
* @author Michael Bien
*/
public class CLCommandQueue {
@@ -190,5 +195,36 @@ public class CLCommandQueue {
return hash;
}
+ /**
+ * Enumeration for the command-queue settings.
+ */
+ public enum Mode {
+ /**
+ * CL_DEVICE_TYPE_CPU
+ */
+ OUT_OF_ORDER_EXEC_MODE(CL.CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE),
+ /**
+ * CL_DEVICE_TYPE_GPU
+ */
+ PROFILING_MODE(CL.CL_QUEUE_PROFILING_ENABLE);
+
+ /**
+ * Value of wrapped OpenCL device type.
+ */
+ public final int CL_QUEUE_MODE;
+
+ private Mode(int CL_VALUE) {
+ this.CL_QUEUE_MODE = CL_VALUE;
+ }
+ public static Mode valueOf(int queueMode) {
+ switch(queueMode) {
+ case(CL.CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE):
+ return OUT_OF_ORDER_EXEC_MODE;
+ case(CL.CL_QUEUE_PROFILING_ENABLE):
+ return PROFILING_MODE;
+ }
+ return null;
+ }
+ }
}