From 8e915ca25ddea1258a7c8db3e35e3a660d40775f Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Tue, 8 Feb 2011 21:28:56 +0100 Subject: improved javadoc. --- src/com/jogamp/opencl/CLPlatform.java | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java index 6658f00..1db3dcf 100644 --- a/src/com/jogamp/opencl/CLPlatform.java +++ b/src/com/jogamp/opencl/CLPlatform.java @@ -56,7 +56,32 @@ import static com.jogamp.opencl.CLException.*; import static com.jogamp.opencl.CL.*; /** - * CLPlatfrorm representing an OpenCL installation (e.g. graphics driver). + * CLPlatfrorm representing a OpenCL implementation (e.g. graphics driver). + * + * optional eager initialization: + *

+ *     try{
+ *          CLPlatform.initialize();
+ *     }catch(JogampRuntimeException ex) {
+ *          throw new RuntimeException("could not load Java OpenCL Binding");
+ *     }
+ * 

+ * + * Example initialization: + *

+ *     CLPlatform platform = CLPlatform.getDefault(type(GPU));
+ *      
+ *     if(platform == null) {
+ *          throw new RuntimeException("please update your graphics drivers");
+ *     }
+ * 
+ *     CLContext context = CLContext.create(platform.getMaxFlopsDevice());
+ *     try {
+ *          // use it
+ *     }finally{
+ *          context.release();
+ *     }
+ * 

* * @author Michael Bien * @see #initialize() -- cgit v1.2.3