summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLProgram.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-11-02 02:18:21 +0100
committerMichael Bien <[email protected]>2009-11-02 02:18:21 +0100
commitb2dfcb34a4cdc9c45d5ce20a2b1559b4bf3ebb8c (patch)
tree1245bfc07fdf03618a7d867c46e49e0762ccb967 /src/com/mbien/opencl/CLProgram.java
parent1690ead6c21b61bd337706b836c04164940eed69 (diff)
refactoring and more utility methods.
Diffstat (limited to 'src/com/mbien/opencl/CLProgram.java')
-rw-r--r--src/com/mbien/opencl/CLProgram.java33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/com/mbien/opencl/CLProgram.java b/src/com/mbien/opencl/CLProgram.java
index ff2919e8..da0a0447 100644
--- a/src/com/mbien/opencl/CLProgram.java
+++ b/src/com/mbien/opencl/CLProgram.java
@@ -210,8 +210,37 @@ public class CLProgram {
}
/**
- * Returns the build log for this program. The contents of the log are
- * implementation dependent log can be an empty String.
+ * Returns the build log of this program on all devices. The contents of the log are
+ * implementation dependent.
+ */
+ public String getBuildLog() {
+ StringBuilder sb = new StringBuilder();
+ CLDevice[] devices = getCLDevices();
+ for (int i = 0; i < devices.length; i++) {
+ CLDevice device = devices[i];
+ sb.append(device).append(" build log:");
+ sb.append(getBuildLog(device));
+ if(i != devices.length-1)
+ sb.append("\n");
+ }
+ return sb.toString();
+ }
+
+ /**
+ * Returns the build status enum of this program for each device as Map.
+ */
+ public Map<CLDevice,Status> getBuildStatus() {
+ Map<CLDevice,Status> statusMap = new HashMap<CLDevice, Status>();
+ CLDevice[] devices = getCLDevices();
+ for (CLDevice device : devices) {
+ statusMap.put(device, getBuildStatus(device));
+ }
+ return Collections.unmodifiableMap(statusMap);
+ }
+
+ /**
+ * Returns the build log for this program on the specified device. The contents
+ * of the log are implementation dependent log can be an empty String.
*/
public String getBuildLog(CLDevice device) {
return getBuildInfoString(device.ID, CL.CL_PROGRAM_BUILD_LOG);