PandA-2024.02
Data Structures | Macros | Functions | Variables
mandelbrot.c File Reference
#include <stdio.h>
Include dependency graph for mandelbrot.c:

Go to the source code of this file.

Data Structures

struct  thread_data
 

Macros

#define DECIMAL_PLACES   28
 
#define int2fixed(num)   ((num) << DECIMAL_PLACES)
 
#define fixedmul(a, b)   ((((long long)a) * ((long long)b)) >> DECIMAL_PLACES)
 
#define fixed2int(num)   ((num) >> DECIMAL_PLACES)
 
#define HEIGHT   128
 
#define WIDTH   128
 
#define MAX_ITER   50
 
#define NUM_ACCEL   4
 
#define OPS_PER_ACCEL   HEIGHT/NUM_ACCEL
 
#define OMP_ACCEL   4
 

Functions

void print_image (int width, int height, int max, unsigned char img[width][height])
 
int mandelbrot (int startidx)
 
int main ()
 

Variables

volatile unsigned char img [WIDTH][HEIGHT]
 

Macro Definition Documentation

◆ DECIMAL_PLACES

#define DECIMAL_PLACES   28

Definition at line 24 of file mandelbrot.c.

◆ fixed2int

#define fixed2int (   num)    ((num) >> DECIMAL_PLACES)

Definition at line 27 of file mandelbrot.c.

◆ fixedmul

#define fixedmul (   a,
 
)    ((((long long)a) * ((long long)b)) >> DECIMAL_PLACES)

Definition at line 26 of file mandelbrot.c.

Referenced by mandelbrot().

◆ HEIGHT

#define HEIGHT   128

Definition at line 29 of file mandelbrot.c.

Referenced by main(), and mandelbrot().

◆ int2fixed

#define int2fixed (   num)    ((num) << DECIMAL_PLACES)

Definition at line 25 of file mandelbrot.c.

Referenced by mandelbrot().

◆ MAX_ITER

#define MAX_ITER   50

Definition at line 33 of file mandelbrot.c.

Referenced by mandelbrot().

◆ NUM_ACCEL

#define NUM_ACCEL   4

Definition at line 34 of file mandelbrot.c.

Referenced by main().

◆ OMP_ACCEL

#define OMP_ACCEL   4

Definition at line 36 of file mandelbrot.c.

◆ OPS_PER_ACCEL

#define OPS_PER_ACCEL   HEIGHT/NUM_ACCEL

Definition at line 35 of file mandelbrot.c.

Referenced by main(), and mandelbrot().

◆ WIDTH

#define WIDTH   128

Definition at line 30 of file mandelbrot.c.

Referenced by main(), and mandelbrot().

Function Documentation

◆ main()

int main ( void  )

Definition at line 89 of file mandelbrot.c.

References HEIGHT, img, mandelbrot(), NUM_ACCEL, OPS_PER_ACCEL, print_image(), and WIDTH.

Here is the call graph for this function:

◆ mandelbrot()

int mandelbrot ( int  startidx)

Definition at line 47 of file mandelbrot.c.

References fixedmul, HEIGHT, img, int2fixed, MAX_ITER, OPS_PER_ACCEL, thread_data::startidx, WIDTH, and x.

◆ print_image()

void print_image ( int  width,
int  height,
int  max,
unsigned char  img[width][height] 
)
inline

Definition at line 7 of file mandelbrot.c.

References img.

Referenced by main().

Here is the caller graph for this function:

Variable Documentation

◆ img

volatile unsigned char img[WIDTH][HEIGHT]

Definition at line 45 of file mandelbrot.c.


Generated on Mon Feb 12 2024 13:03:09 for PandA-2024.02 by doxygen 1.8.13