JOCL FAQ: Difference between revisions

From JogampWiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 56: Line 56:
* [[JOCL_Tutorial|Hello JOCL]]
* [[JOCL_Tutorial|Hello JOCL]]
* [http://jogamp.org/jocl-demos/www JOCL Demo Projects]
* [http://jogamp.org/jocl-demos/www JOCL Demo Projects]
== How can I test if OpenCL is properly set up on my system? ==
* run [http://jogamp.org/deployment/webstart-next/jocl-demos/clinfo.jnlp CLInfo] via webstart for basic OpenCL diagnostic readouts
* or invoke: java -jar jocl.jar -Djava.library.path="path/to/jocl/libs" com.jogamp.opencl.util.CLInfo
* run some of the other [http://jogamp.org/jocl-demos/www/ webstart demos]


== Is it possible to run JOCL based app without JOGL? ==
== Is it possible to run JOCL based app without JOGL? ==
Line 71: Line 76:


discussion: http://forum.jogamp.org/Allocate-memory-object-on-device-only-tp2465039p2465039.html
discussion: http://forum.jogamp.org/Allocate-memory-object-on-device-only-tp2465039p2465039.html
== How do I do image processing with JOCL? ==
For a simple example take a look at the [https://github.com/mbien/jocl-demos/blob/master/src/com/jogamp/opencl/demos/gamma/CLSimpleGammaCorrection.java gamma correction demo] from the
[http://jogamp.org/jocl-demos/www/ jocl-demos] repository.


== Is jocl.org the same as JOCL? ==
== Is jocl.org the same as JOCL? ==
no its not. Both are independent projects and do not share the same codebase.
no its not. Both are independent projects and do not share the same codebase.

Revision as of 21:51, 16 February 2011

What OpenCL platforms / Operating Systems / JDKs are supported?

OpenCL Platforms:

  • all of them. We are testing every build (in fact every commit) on AMD, Nvidia and Intel SDKs.
  • If you are running on a different platform or would like to provide a build server, please let us know.

Operating Systems:

  • Linux 32/64, Mac OS and Windows 32/64
  • Building JOCL on other systems is easy provided that a OpenCL implementation for that system.

(e.g. OpenSolaris doesn't have OpenCL drivers yet)

Java Runtime Environments:

  • We are testing on Oracle JDK and OpenJDK
  • Java 5+ is required to run JOCL.

How do I get the Source Code?

The project repository is located on github.

You can create a local copy/branch of the git repository, either anonymous:

or via SSH and your user credential, so you can easily push back your changes to the github server:

What are the Build Dependencies?

JOCL depends on GlueGen and JOGL

JDK6 and ANT 1.8 or later. JUnit tests require OpenCL capable hardware and OpenCL drivers.

I have all the Sourcecode, how do I build it?

Please refer to this HowTo

What files do I need at Runtime?

JOCL consists of two files:

  • jocl.jar
  • and one system dependent native library (e.g libjocl.so or jocl.dll or ..).

additionally you will have to provide

  • gluegen-rt.jar
  • and the corresponding native library (e.g libgluegen-rt.so or gluegen.dll or ...)

optionally you might want to add JOGL if you want to do OpenGL - OpenCL interoperability

How do I Get Started?

How can I test if OpenCL is properly set up on my system?

  • run CLInfo via webstart for basic OpenCL diagnostic readouts
  • or invoke: java -jar jocl.jar -Djava.library.path="path/to/jocl/libs" com.jogamp.opencl.util.CLInfo
  • run some of the other webstart demos

Is it possible to run JOCL based app without JOGL?

Yes. JOCL is independent from JOGL and can be used without JOGL in the classpath. In fact you have to explicitly create a shared context from a existing JOGL context if you want to interoperate with OpenGL.

// creates a pure OpenCL context
CLContext.create();
// creates a shared context. This context can be used to share memory with JOGL's OpenGL context
CLGLContext.create(glContext);

Can I allocate a CLBuffer without allocating a java.nio.Buffer?

yes, just use the right context.createBuffer() method.

discussion: http://forum.jogamp.org/Allocate-memory-object-on-device-only-tp2465039p2465039.html

How do I do image processing with JOCL?

For a simple example take a look at the gamma correction demo from the jocl-demos repository.

Is jocl.org the same as JOCL?

no its not. Both are independent projects and do not share the same codebase.