diff options
author | Michael Bien <[email protected]> | 2009-10-25 18:35:46 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2009-10-25 18:35:46 +0100 |
commit | 30cd68083930688693ebdfefdeda609d857a2c8a (patch) | |
tree | 96f7a2625bb393510ded578566f2378bc25c856a /src/com/mbien/opencl/CLDevice.java | |
parent | 054e5005d1429ba6ea4f9283eee2988ff54d1abb (diff) |
implemented clCreateContext(...) and updated Tests and high level binding.
Diffstat (limited to 'src/com/mbien/opencl/CLDevice.java')
-rw-r--r-- | src/com/mbien/opencl/CLDevice.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/com/mbien/opencl/CLDevice.java b/src/com/mbien/opencl/CLDevice.java index 0ad8f0e9..de49aafa 100644 --- a/src/com/mbien/opencl/CLDevice.java +++ b/src/com/mbien/opencl/CLDevice.java @@ -255,21 +255,31 @@ public final class CLDevice { */ ACCELERATOR(CL.CL_DEVICE_TYPE_ACCELERATOR), /** - * CL_DEVICE_TYPE_DEFAULT + * CL_DEVICE_TYPE_DEFAULT. This type can be used for creating a context on + * the default device, a single device can never have this type. */ - DEFAULT(CL.CL_DEVICE_TYPE_DEFAULT); + DEFAULT(CL.CL_DEVICE_TYPE_DEFAULT), + /** + * CL_DEVICE_TYPE_ALL. This type can be used for creating a context on + * all devices, a single device can never have this type. + */ + ALL(CL.CL_DEVICE_TYPE_ALL); /** * Value of wrapped OpenCL device type. */ - public final int CL_TYPE; + public final long CL_TYPE; - private Type(int CL_TYPE) { + private Type(long CL_TYPE) { this.CL_TYPE = CL_TYPE; } - public static Type valueOf(int clDeviceType) { - switch(clDeviceType) { + public static Type valueOf(long clDeviceType) { + + if(clDeviceType == CL.CL_DEVICE_TYPE_ALL) + return ALL; + + switch((int)clDeviceType) { case(CL.CL_DEVICE_TYPE_DEFAULT): return DEFAULT; case(CL.CL_DEVICE_TYPE_CPU): |