Mali OpenCL SDK v1.1.0
 All Classes Files Functions Variables Macros Pages
mandelbrot.cl File Reference

Go to the source code of this file.

Macros

#define MAX_ITER   255
 

Functions

float4 createStartX (int x)
 Create a float4 containing the x positions of x and the 3 adjacent pixels.
 
__kernel void mandelbrot (__global uchar *restrict output, const int width, const int height)
 Mandelbrot kernel function.
 

Macro Definition Documentation

#define MAX_ITER   255

Definition at line 16 of file mandelbrot.cl.

Function Documentation

float4 createStartX ( int  x)

Create a float4 containing the x positions of x and the 3 adjacent pixels.

Parameters
[in]xFirst pixel position to use.
Returns
An vector of 4 floats containing x, x + 1, x + 2, and x + 3.

Definition at line 23 of file mandelbrot.cl.

__kernel void mandelbrot ( __global uchar *restrict  output,
const int  width,
const int  height 
)

Mandelbrot kernel function.

Evaluates whether a set of four adjacent pixels are part of the Mandelbrot set. The output is an array where each value represents how many iterations were required to be able to decide whether the point in imaginary space is part of the Mandelbrot set or not. A value of MAX_ITER represents a point that is part of the Mandelbrot set. All other values represent points that are not part of the Mandelbrot set. A value is in the Mandelbrot set if the results of the calculations remain bounded.

Parameters
[out]outputOutput data buffer. Must be width * height * sizeof(cl_uchar) in size.
[in]widthWidth of the data required.
[in]heightHeight of the data required.

Definition at line 41 of file mandelbrot.cl.