summaryrefslogtreecommitdiffstats
path: root/test/com/mbien
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2009-09-29 04:10:07 +0200
committerMichael Bien <[email protected]>2009-09-29 04:10:07 +0200
commit842f684ed4e900fbc54dd00e92c58a0fe2d8ce04 (patch)
treecc7bd4a69107c20cf2611b6729a19820c0c90a7c /test/com/mbien
parent0ac4a12fb74de16f41ee9ad46e917b45523bbac4 (diff)
temporary added GL3 headers, we should use JOGL's headers in future.
continued with clCreateContextFromType impl.
Diffstat (limited to 'test/com/mbien')
-rw-r--r--test/com/mbien/opencl/JOCLTest.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/com/mbien/opencl/JOCLTest.java b/test/com/mbien/opencl/JOCLTest.java
index 68673746..053f22d3 100644
--- a/test/com/mbien/opencl/JOCLTest.java
+++ b/test/com/mbien/opencl/JOCLTest.java
@@ -26,12 +26,14 @@ public class JOCLTest {
@Test
public void basicTest() {
- System.out.println(0xFFFFFFFF);
- System.out.println(0xFFFFFFFE);
- System.out.println(0xFFFFFFFD);
+// System.out.println(0xFFFFFFFF);
+// System.out.println(0xFFFFFFFE);
+// System.out.println(0xFFFFFFFD);
+ System.out.print("loading native libs...");
System.loadLibrary("gluegen-rt");
System.loadLibrary("jocl");
+ System.out.println("done");
CreateContextCallback cb = new CreateContextCallback() {
@Override
@@ -40,14 +42,17 @@ public class JOCLTest {
}
};
+ System.out.println("creating OpenCL context");
+
CLImpl impl = new CLImpl();
- System.out.println("test call1: "+impl.clFinish(1));
- System.out.println("test call2: "+impl.clUnloadCompiler());
+ long context = impl.clCreateContextFromType(null, CL.CL_DEVICE_TYPE_ALL, cb, null, null);
+ System.out.println("context handle: "+context);
- long ctx = impl.clCreateContextFromType(null, CL.CL_DEVICE_TYPE_ALL, cb, null, null);
+ int[] buffer = new int[1];
+ impl.clGetContextInfo(context, CL.CL_CONTEXT_NUM_DEVICES, 0, null, buffer, 0);
+ System.out.println("CL_CONTEXT_NUM_DEVICES result: "+buffer[0]);
- System.out.println("context handle: "+ctx);
}