
430 Designing Scientific Applications on GPUs
rithm, thus the need for synchronization barriers, and requires only one kernel
launch from Java as described on Listing 18.5.
Listing 18.5. MIOR simulation launcher
@Override
p r o t e c t e d void d oLi ve Imp l ( ) {
s i m u l a t e K e r n e l . setA rgu m ent s (mmMem, omMem, worldsMem , mmOffsetsMem ,
omOffsetsMem , mmCSRMem, omCSRMem, partsMem ) ;
5 i f ( b l o c k S i z e < Math . max(nbOM, nbMM) ) {
throw new R untimeEx ception ( " bloc kSize (" + b l o c k S i z e +
") too small to execu te the simu lation " ) ;
}
10 OCLEvent ev e nt = queue . enqu eue1DKernel ( s i m u l a t e Ke r n e l , nbSim