Commit bd633ddd authored by lvs's avatar lvs
Browse files

added sync after asynch copies in krnls 3 & 4 & grad & fire, #31

parent e4374d85
......@@ -92,7 +92,7 @@ gpu_calc_initpop(
}
// Asynchronous copy should be finished by here
wait_group_events(1,&ev);
wait_group_events(1, &ev);
// Evaluating initial genotypes
barrier(CLK_LOCAL_MEM_FENCE);
......
......@@ -152,7 +152,7 @@ perform_LS(
// Asynchronous copy should be finished by here
wait_group_events(1,&ev);
wait_group_events(1, &ev);
barrier(CLK_LOCAL_MEM_FENCE);
......@@ -437,7 +437,10 @@ perform_LS(
// Updating old offspring in population
barrier(CLK_LOCAL_MEM_FENCE);
async_work_group_copy(dockpars_conformations_next+(run_id*dockpars_pop_size+entity_id)*GENOTYPE_LENGTH_IN_GLOBMEM,
offspring_genotype,
dockpars_num_of_genes,0);
event_t ev2 = async_work_group_copy(dockpars_conformations_next+(run_id*dockpars_pop_size+entity_id)*GENOTYPE_LENGTH_IN_GLOBMEM,
offspring_genotype,
dockpars_num_of_genes,0);
// Asynchronous copy should be finished by here
wait_group_events(1, &ev2);
}
......@@ -219,7 +219,7 @@ gpu_gen_and_eval_newpops(
dockpars_num_of_genes, 0);
// Asynchronous copy should be finished by here
wait_group_events(1,&ev);
wait_group_events(1, &ev);
} // End of crossover
barrier(CLK_LOCAL_MEM_FENCE);
......@@ -316,8 +316,11 @@ gpu_gen_and_eval_newpops(
}
// Copying new offspring to next generation
async_work_group_copy(dockpars_conformations_next + GENOTYPE_LENGTH_IN_GLOBMEM*get_group_id(0),
offspring_genotype,
dockpars_num_of_genes, 0);
event_t ev2 = async_work_group_copy(dockpars_conformations_next + GENOTYPE_LENGTH_IN_GLOBMEM*get_group_id(0),
offspring_genotype,
dockpars_num_of_genes, 0);
// Asynchronous copy should be finished by here
wait_group_events(1, &ev2);
}
}
......@@ -123,7 +123,7 @@ gradient_minFire(
dockpars_num_of_genes, 0);
// Asynchronous copy should be finished by here
wait_group_events(1,&ev);
wait_group_events(1, &ev);
// -----------------------------------------------------------------------------
// Some OpenCL compilers don't allow declaring
......@@ -685,7 +685,10 @@ gradient_minFire(
// Updating old offspring in population
barrier(CLK_LOCAL_MEM_FENCE);
async_work_group_copy(dockpars_conformations_next+(run_id*dockpars_pop_size+entity_id)*GENOTYPE_LENGTH_IN_GLOBMEM,
genotype,
dockpars_num_of_genes, 0);
event_t ev2 = async_work_group_copy(dockpars_conformations_next+(run_id*dockpars_pop_size+entity_id)*GENOTYPE_LENGTH_IN_GLOBMEM,
genotype,
dockpars_num_of_genes, 0);
// Asynchronous copy should be finished by here
wait_group_events(1, &ev2);
}
......@@ -139,7 +139,7 @@ gradient_minimizer(
dockpars_num_of_genes, 0);
// Asynchronous copy should be finished by here
wait_group_events(1,&ev);
wait_group_events(1, &ev);
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
......@@ -814,7 +814,10 @@ gradient_minimizer(
// Updating old offspring in population
barrier(CLK_LOCAL_MEM_FENCE);
async_work_group_copy(dockpars_conformations_next+(run_id*dockpars_pop_size+entity_id)*GENOTYPE_LENGTH_IN_GLOBMEM,
genotype,
dockpars_num_of_genes, 0);
event_t ev2 = async_work_group_copy(dockpars_conformations_next+(run_id*dockpars_pop_size+entity_id)*GENOTYPE_LENGTH_IN_GLOBMEM,
genotype,
dockpars_num_of_genes, 0);
// Asynchronous copy should be finished by here
wait_group_events(1, &ev2);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment