Skip to content
Snippets Groups Projects
Verified Commit e753a027 authored by baptiste.coudray's avatar baptiste.coudray
Browse files

Added comment

parent 95a1cd5e
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,6 @@ When the tools are installed, you need to navigate into a project folder `cd <fo
* `elementary_cuda`
* Execute tests with `mpirun -n <nb_tasks> <elementary_seq|mc|opencl|cuda> <height> <width>`
### Game of Life
* Uncomment `#include "../game_of_life/gol.h"` in `dispatch.h`
......
......@@ -213,6 +213,7 @@ static void find_best_factors(int n, int factors[2]) {
int factor2 = n / i;
int current_difference = abs(result[0] - result[1]);
int new_difference = abs(factor1 - factor2);
/* The minimum difference will be the most efficient dispatching */
if (first_pass || current_difference > new_difference) {
result[0] = factor1;
result[1] = factor2;
......@@ -238,6 +239,7 @@ static void find_network_dimensions(struct dispatch_context *dc) {
if (dc->n_dimensions == 3) {
int factors[2] = {0};
find_best_factors(dc->network_dimensions[1], factors);
/* We prefer to have more columns than depths */
if (factors[0] < factors[1]) {
dc->network_dimensions[1] = factors[1];
dc->network_dimensions[2] = factors[0];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment