Commit 449ad648 authored by Leonardo Solis's avatar Leonardo Solis

#31, added clFinish() to ensure(correct) data-transfer to host after docking

now all #evals and #gens in final_population_runX.txt are correct
parent 1f3e169b
......@@ -872,6 +872,8 @@ void Krnl_GA(
// Write final evals & generation counts to FPGA-board DDRs
GlobEvals_performed[Host_RunId] = eval_cnt;
GlobGens_performed [Host_RunId] = generation_cnt;
/*printf("Host_RunId: %u, eval_cnt: %u, generation_cnt: %u\n", Host_RunId, eval_cnt, generation_cnt);*/
}
// --------------------------------------------------------------------------
......
......@@ -1052,13 +1052,20 @@ filled with clock() */
// The data will be be transferred from system memory
// over PCIe to the FPGA on-board DDR memory.
command_queue_ga.enqueueMigrateMemObjects(outBufVec,CL_MIGRATE_MEM_OBJECT_HOST);
// Making sure all data was transferred back to host
#ifdef ENABLE_KRNL_GA
command_queue_ga.finish();
#endif
// -----------------------------------------------------------------------------------------------------
for (unsigned int run_cnt = 0; run_cnt < mypars->num_of_runs; run_cnt++) {
arrange_result(cpu_final_populations.data() + run_cnt*mypars->pop_size*ACTUAL_GENOTYPE_LENGTH,
cpu_energies.data() + run_cnt*mypars->pop_size,
mypars->pop_size);
mypars->pop_size);
/*printf("cpu_evals_of_runs[%u]: %u\n", run_cnt, cpu_evals_of_runs[run_cnt]);*/
make_resfiles(cpu_final_populations.data() + run_cnt*mypars->pop_size*ACTUAL_GENOTYPE_LENGTH,
cpu_energies.data() + run_cnt*mypars->pop_size,
......
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