PandA-2024.02
Data Structures | Macros | Functions | Variables
mandelbrot.c File Reference
#include <stdio.h>
#include <pthread.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
 
#define LEGUP   1
 

Functions

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

Variables

volatile unsigned char img [WIDTH][HEIGHT]
 

Macro Definition Documentation

◆ DECIMAL_PLACES

#define DECIMAL_PLACES   28

Definition at line 25 of file mandelbrot.c.

◆ fixed2int

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

Definition at line 28 of file mandelbrot.c.

◆ fixedmul

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

Definition at line 27 of file mandelbrot.c.

Referenced by mandelbrot().

◆ HEIGHT

#define HEIGHT   128

Definition at line 30 of file mandelbrot.c.

Referenced by main(), and mandelbrot().

◆ int2fixed

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

Definition at line 26 of file mandelbrot.c.

Referenced by mandelbrot().

◆ LEGUP

#define LEGUP   1

Definition at line 39 of file mandelbrot.c.

◆ MAX_ITER

#define MAX_ITER   50

Definition at line 34 of file mandelbrot.c.

Referenced by mandelbrot().

◆ NUM_ACCEL

#define NUM_ACCEL   4

Definition at line 35 of file mandelbrot.c.

Referenced by main().

◆ OMP_ACCEL

#define OMP_ACCEL   4

Definition at line 37 of file mandelbrot.c.

◆ OPS_PER_ACCEL

#define OPS_PER_ACCEL   HEIGHT/NUM_ACCEL

Definition at line 36 of file mandelbrot.c.

Referenced by main().

◆ WIDTH

#define WIDTH   128

Definition at line 31 of file mandelbrot.c.

Referenced by main(), and mandelbrot().

Function Documentation

◆ main()

int main ( void  )

Definition at line 95 of file mandelbrot.c.

References HEIGHT, img, mandelbrot(), thread_data::maxidx, NULL, NUM_ACCEL, OPS_PER_ACCEL, print_image(), thread_data::startidx, test_panda::threads, and WIDTH.

Here is the call graph for this function:

◆ mandelbrot()

void* mandelbrot ( void *  threadarg)

◆ print_image()

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

Definition at line 8 of file mandelbrot.c.

References img.

Variable Documentation

◆ img

volatile unsigned char img[WIDTH][HEIGHT]

Definition at line 47 of file mandelbrot.c.


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