-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
1,729 additions
and
674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#C small extensible c/4 greyship: Hartmut Holzwart, 24 March 2006 | ||
x = 95, y = 133, rule = B3/S23 | ||
23bo16bo$22bobo14bobo$22bobo14bobo$23bo16bo$23boo15boo$22b3o14b3o$$21b | ||
oboo13boboo$20boobo13boobo$22bobo14bobo$22bobo14bobo$21bo16bo$22bo16bo | ||
$20boo15boo$15b4oboo10b4oboo$15bobb3o11bobb3o$20bo16bo$15b3ob3o10b3ob | ||
3o$20boo15boo$15bobb3o11bobb3o$15b4obbo10b4obbo$20bobbo13bobbo$20bobo | ||
14bobo$23bo16bo$16boobo3bo9boobo3bo$15bobboo12bobboo$15boo7bo7boo7bo$ | ||
16bobob4o9bobob4o$$16bo16bo27boobo$17bo16bo25bob3o$15b3o14b3o25boboo$ | ||
16boo15boo24bobo$59bobo12boobo$15bobbob3o9bobbob3o19boo12bob3o$15b4obo | ||
11b4obo24b3o8boboo$15bo5boo9bo5boo22b3o7bobo$16b7o10b7o24bo7bobo$16bob | ||
o14bobo26boo8boo$17bo16bo27bobbo9b3o$16boboo13boboo25bo12b3o$17b3o14b | ||
3o25bobbo11bo$62b4o9boo$17boo15boo26boo11bobbo$17boo3bo11boo3bo21boo | ||
12bo$23bo16bo19b3o12bobbo$20booboo12booboo18bobo12b4o$21boboo13boboo | ||
19boo12boo$10bobo8bobo14bobo19boo12boo$5boobbobbo8bobo14bobo22bo9b3o$ | ||
4b3obo3bo47bo12bobo$5boobbo13boo15boo21bo10boo$12bobbobo5bo4b3obobo5bo | ||
4b3obobo7b3o11boo$11b5o3bo4bo3b5o3bo4bo3b5o3bo5boo15bo$13bo6bobbo13bo | ||
bbo13bo18bo$10bobb6obo3b12obo3b12obo3bo17bo$5bobobobo47boobo9b3o$boobb | ||
ob4ob47obobo9boo$ooboobo53bob3obbo$bo5b53o3b3obo3bo$oo59bo10boobo13bo | ||
bboo$bo5b65obobo13bobb3o$ooboobo66bob3obbo8bo4bo$boobbob66o3b3obo3b5o$ | ||
5bobo66bo10boboo$8b77o$$8b77o$5bobo66bo10boboo$boobbob66o3b3obo3b5o$oo | ||
boobo66bob3obbo8bo4bo$bo5b65obobo13bobb3o$oo59bo10boobo13bobboo$bo5b | ||
53o3b3obo3bo$ooboobo53bob3obbo$boobbob4ob47obobo9boo$5bobobobo47boobo | ||
9b3o$10bobb6obo3b12obo3b12obo3bo17bo$13bo6bobbo13bobbo13bo18bo$11b5o3b | ||
o4bo3b5o3bo4bo3b5o3bo5boo15bo$12bobbobo5bo4b3obobo5bo4b3obobo7b3o11boo | ||
$5boobbo13boo15boo21bo10boo$4b3obo3bo47bo12bobo$5boobbobbo8bobo14bobo | ||
22bo9b3o$10bobo8bobo14bobo19boo12boo$21boboo13boboo19boo12boo$20booboo | ||
12booboo18bobo12b4o$23bo16bo19b3o12bobbo$17boo3bo11boo3bo21boo12bo$17b | ||
oo15boo26boo11bobbo$62b4o9boo$17b3o14b3o25bobbo11bo$16boboo13boboo25bo | ||
12b3o$17bo16bo27bobbo9b3o$16bobo14bobo26boo8boo$16b7o10b7o24bo7bobo$ | ||
15bo5boo9bo5boo22b3o7bobo$15b4obo11b4obo24b3o8boboo$15bobbob3o9bobbob | ||
3o19boo12bob3o$59bobo12boobo$16boo15boo24bobo$15b3o14b3o25boboo$17bo | ||
16bo25bob3o$16bo16bo27boobo$$16bobob4o9bobob4o$15boo7bo7boo7bo$15bobb | ||
oo12bobboo$16boobo3bo9boobo3bo$23bo16bo$20bobo14bobo$20bobbo13bobbo$ | ||
15b4obbo10b4obbo$15bobb3o11bobb3o$20boo15boo$15b3ob3o10b3ob3o$20bo16bo | ||
$15bobb3o11bobb3o$15b4oboo10b4oboo$20boo15boo$22bo16bo$21bo16bo$22bobo | ||
14bobo$22bobo14bobo$20boobo13boobo$21boboo13boboo$$22b3o14b3o$23boo15b | ||
oo$23bo16bo$22bobo14bobo$22bobo14bobo$23bo16bo! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
|
||
#include "easypap.h" | ||
|
||
#include <omp.h> | ||
|
||
// If defined, the initialization hook function is called quite early in the | ||
// initialization process, after the size (DIM variable) of images is known. | ||
// This function can typically spawn a team of threads, or allocated additionnal | ||
// OpenCL buffers. | ||
// A function named <kernel>_init_<variant> is search first. If not found, a | ||
// function <kernel>_init is searched in turn. | ||
void <template>_init (void) | ||
{ | ||
PRINT_DEBUG ('u', "Image size is %dx%d\n", DIM, DIM); | ||
PRINT_DEBUG ('u', "Tile size is %dx%d\n", TILE_W, TILE_H); | ||
PRINT_DEBUG ('u', "Press <SPACE> to pause/unpause, <ESC> to quit.\n"); | ||
} | ||
|
||
// The image is a two-dimension array of size of DIM x DIM. Each pixel is of | ||
// type 'unsigned' and store the color information following a RGBA layout (4 | ||
// bytes). Pixel at line 'l' and column 'c' in the current image can be accessed | ||
// using cur_img (l, c). | ||
|
||
static unsigned compute_color (int i, int j) | ||
{ | ||
return cur_img (i, j); | ||
} | ||
|
||
// The kernel returns 0, or the iteration step at which computation has | ||
// completed (e.g. stabilized). | ||
|
||
///////////////////////////// Simple sequential version (seq) | ||
// Suggested cmdline(s): | ||
// ./run --size 1024 --kernel <template> --variant seq | ||
// or | ||
// ./run -s 1024 -k <template> -v seq | ||
// | ||
unsigned <template>_compute_seq (unsigned nb_iter) | ||
{ | ||
for (unsigned it = 1; it <= nb_iter; it++) { | ||
|
||
for (int i = 0; i < DIM; i++) | ||
for (int j = 0; j < DIM; j++) | ||
next_img (i, j) = compute_color (i, j); | ||
|
||
swap_images (); | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
|
||
///////////////////////////// Tiled sequential version (tiled) | ||
// Suggested cmdline(s): | ||
// ./run -k <template> -v tiled -g 16 -m | ||
// or | ||
// ./run -k <template> -v tiled -ts 64 -m | ||
// | ||
static void do_tile (int x, int y, int width, int height, int who) | ||
{ | ||
// Calling monitoring_{start|end}_tile before/after actual computation allows | ||
// to monitor the execution in real time (--monitoring) and/or to generate an | ||
// execution trace (--trace). | ||
// monitoring_start_tile only needs the cpu number | ||
monitoring_start_tile (who); | ||
|
||
for (int i = y; i < y + height; i++) | ||
for (int j = x; j < x + width; j++) | ||
next_img (i, j) = compute_color (i, j); | ||
|
||
// In addition to the cpu number, monitoring_end_tile also needs the tile | ||
// coordinates | ||
monitoring_end_tile (x, y, width, height, who); | ||
} | ||
|
||
unsigned <template>_compute_tiled (unsigned nb_iter) | ||
{ | ||
for (unsigned it = 1; it <= nb_iter; it++) { | ||
|
||
for (int y = 0; y < DIM; y += TILE_H) | ||
for (int x = 0; x < DIM; x += TILE_W) | ||
do_tile (x, y, TILE_W, TILE_H, 0 /* CPU id */); | ||
|
||
swap_images (); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef API_FUNCS_IS_DEF | ||
#define API_FUNCS_IS_DEF | ||
|
||
typedef enum { | ||
VEC_TYPE_CHAR, | ||
VEC_TYPE_INT, | ||
VEC_TYPE_FLOAT, | ||
VEC_TYPE_DOUBLE | ||
} vec_type_t; | ||
|
||
typedef enum { | ||
DIR_HORIZONTAL, | ||
DIR_VERTICAL | ||
} direction_t; | ||
|
||
unsigned easypap_requested_number_of_threads (void); | ||
unsigned easypap_number_of_cores (void); | ||
unsigned easypap_number_of_gpus (void); | ||
int easypap_mpi_rank (void); | ||
int easypap_mpi_size (void); | ||
void easypap_check_mpi (void); | ||
void easypap_check_vectorization (vec_type_t vec_type, direction_t dir); | ||
int easypap_proc_is_master (void); | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.