JOCL Struct JAR file (including documentation and source code) Simple struct example |
This library shows how structs might be handled with JOCL. It contains
the source code and documentation of a Struct class which
can serve as the basis for own structs. For example, it is possible
to create a struct
which corresponds to the native struct
Arrays of instances of these Struct classes may then be written
to buffers, which in turn can be copied into OpenCL memory objects. The
utilitiy classes for doing so will automatically take care of
the alignment requirements imposed by the OpenCL specification. The
sample shows how these
classes may be used.Important note: "Structs are difficult, both alignment of individual components and alignment and size of the overall struct must match on the device and host code. It probably will take trial and error to get it correct." This library and the general approach are highly experimental. It has only been tested on 32 bit Windows, with a GeForce 8800 GPU. Other operating systems, architectures and GPUs may use different endianness or have different alignment requirements. The library should only be considered as a very basic demonstration of how structs might be used, but not more. |
||
JET JAR file (including documentation and source code) Simple JET example |
This JAR file contains the JET - the "JOCL Event Tracer". This is a
small utility that allows tracing events in JOCL and displays a bar
chart showing the schedule and duration of the commands that the
events belong to. This is not a profiler! It might be a helpful utility for analyzing the schedule of relatively long-lasting operations, and for detecting bottlenecks or disadvantageous wait conditions. However, its precision is not nearly as high as that of a real native OpenCL profiler. The simple JET example shows how the JET may be used to trace events for some simple operations, and the output is shown in this screenshot: The following interaction with the bar chart is possible:
Notes: Currently, all events are associated with the same command queue and device, but of course, this is not the intention: The internal data structures already aim at supporting the visualization of multiple devices and multiple command queues for each device. This is currently not supported due to some flaws of the existing OpenCL implementations, of which some do not allow obtaining the command queue for an event, the device for a command queue, or precise timing information for events on multiple devices. However, when this utility turns out to be useful and these functionalities are provided by future OpenCL implementations, they will be integrated into the event tracer utility. The following screenshot shows another example: Here the event tracer was used to trace the events in the "JOCLMandelbrot" sample from the samples section, which divides the region of interest into smaller tiles and computes these tiles individually. |
||
QuadFloat CL file |
This OpenCL source file contains some very basic functions for
high-precision floating point values that are represented
as a float4. The functions that are prefixed with "qf "
may be considered as the "public" functions. This file is also used in the "JOCLMandelbrot" sample from the samples section, to allow deep zooms into the Mandelbrot set. These functions have been created by porting parts of the Quad-Double package from http://crd.lbl.gov/~dhbailey/mpdist/index.html to the float4 type of OpenCL. This file is distributed using any license that is compatible with the original license of the Quad-Double package (which is a slightly modified BSD license). |