AMD Quietly Started an OpenCL Code Samples Page

OpenCL logo

Why? Maybe because there is currently only one code sample… 😉

AMD OpenCL Samples page is available HERE.

Currently the unique sample is about 3D volume rendering:

The sample renders a 3D volume box from a data file using ray casting. The data is loaded into 3D textures that are provided in OpenCL; these originally consist of a number of 2D slices representing a 3D volume. The normalized 3D texture data lies in a box between end points (0, 0, 0) and (1, 1, 1).

A camera and a near location is placed in –Z direction. For each pixel on the near plane, a ray is fired from the camera through the near plane. If the ray does not intersect the volume box, the kernel returns; otherwise, data is sampled using a fixed step size and pixel color. This data is accumulated using a linear blending equation.

Note – The sample works with other volume data available at The volume dimensions may have to be changed in the VolumeRendering.hpp as these are hardcoded to 256x256x256, according to the provided volume data aneurism.


9 thoughts on “AMD Quietly Started an OpenCL Code Samples Page”

  1. Matumbo

    Unfortunately, all I got running this sample was an “ERROR : Unknown error code”. Very verbose 🙂

    With an ATI Radeon HD 5770, Cat 10.8.

  2. Matumbo

    Working with ATI Stream 2.2, I only had the 2.1, my fault.
    But it’s running a 4 fps… disappointing.

  3. Matumbo

    Spamming morning, sorry.
    It’s running smoothly at 60fps with a low sample rate. With the maximum sample rate, it’s running at 2fps.

  4. Robert

    Not suported on ATI48xx:
    “double-precision constant is represented as single-precision
    constant because double is not enabled”
    Very nice 🙁

  5. simon

    Yeah, one sample, and it’s a blatant copy of the volume render sample I wrote for the CUDA SDK. They didn’t even bother renaming the intersectBox() function!

  6. asdf

    Its not supported on 48xx because they don’t support images in OpenCL.

    I agree the intersectBox() function is copied but there aren’t many ways to sample a 3D volume using ray-casting.

    And that CUDA sample had hard-coded values for sampling that means you cannot try out different volume data sets without changing the code.

  7. Pingback: [OpenCL] ATI Stream SDK v2.3 and Image Convolution Optimization Techniques - 3D Tech News, Pixel Hacking, Data Visualization and 3D Programming -

Comments are closed.