summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLDevice.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-10-19 02:56:04 +0200
committerMichael Bien <[email protected]>2009-10-19 02:56:04 +0200
commit9abfd00399e4ca5c351df9cdf25cd85c960b3d44 (patch)
tree0b44ac0da5c03fdd08a4039b25238c240bda1857 /src/com/mbien/opencl/CLDevice.java
parent01ae874925c4471d76ee6b18f15bf201c6f12f48 (diff)
initial import of CLProgram. Updated JUnit Test accordingly.
Diffstat (limited to 'src/com/mbien/opencl/CLDevice.java')
-rw-r--r--src/com/mbien/opencl/CLDevice.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java
index ba20f4b2..d9f643ce 100644
--- a/src/com/mbien/opencl/CLDevice.java
+++ b/src/com/mbien/opencl/CLDevice.java
@@ -7,6 +7,8 @@ import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
+import static com.mbien.opencl.CLException.*;
+
/**
*
* @author Michael Bien
@@ -34,7 +36,7 @@ public final class CLDevice {
*/
DEFAULT(CL.CL_DEVICE_TYPE_DEFAULT);
- /**
+ /**
* Value of wrapped OpenCL device type.
*/
public final int CL_TYPE;
@@ -160,8 +162,7 @@ public final class CLDevice {
int ret = cl.clGetDeviceInfo(deviceID, key, bb.capacity(), bb, null, 0);
- if(CL.CL_SUCCESS != ret)
- throw new CLException(ret, "can not receive device info");
+ checkForError(ret, "can not receive device info");
return bb.getLong();
}
@@ -173,8 +174,7 @@ public final class CLDevice {
int ret = cl.clGetDeviceInfo(deviceID, key, bb.capacity(), bb, longBuffer, 0);
- if(CL.CL_SUCCESS != ret)
- throw new CLException(ret, "can not receive device info string");
+ checkForError(ret, "can not receive device info string");
return new String(bb.array(), 0, (int)longBuffer[0]);
@@ -183,9 +183,10 @@ public final class CLDevice {
@Override
public String toString() {
- return "CLPlatform [name:" + getName()
- + " type:" + getType()
- + " profile: " + getProfile()+"]";
+ return "CLDevice [id: " + deviceID
+ + " name: " + getName()
+ + " type: " + getType()
+ + " profile: " + getProfile()+"]";
}
@Override