LULESH icon indicating copy to clipboard operation
LULESH copied to clipboard

CUDA version lulesh.cu CalcTimeConstraintsForElems function, stream usage

Open neozhang307 opened this issue 1 year ago • 0 comments

Vector_d<Real_t>* dev_mindtcourant= Allocator< Vector_d<Real_t> >::allocate(dimGrid);
Vector_d<Real_t>* dev_mindthydro  = Allocator< Vector_d<Real_t> >::allocate(dimGrid);

CalcTimeConstraintsForElems_kernel<dimBlock> <<<dimGrid,dimBlock>>>
    (length,qqc2,dvovmax,
     domain->matElemlist.raw(),domain->ss.raw(),domain->vdov.raw(),domain->arealg.raw(),
     dev_mindtcourant->raw(),dev_mindthydro->raw());

// TODO: if dimGrid < 1024, should launch less threads
CalcMinDtOneBlock<max_dimGrid> <<<2,max_dimGrid, max_dimGrid*sizeof(Real_t), domain->streams[1]>>>(dev_mindthydro->raw(),dev_mindtcourant->raw(),domain->dtcourant_h,domain->dthydro_h, dimGrid);

cudaEventRecord(domain->time_constraint_computed,domain->streams[1]);

Allocator<Vector_d<Real_t> >::free(dev_mindtcourant,dimGrid);
Allocator<Vector_d<Real_t> >::free(dev_mindthydro,dimGrid);

I am not sure, but wouldn't it be an issue as dev_mindtcourant is used in streams[1] and will be free in the default stream?

neozhang307 avatar Apr 04 '25 09:04 neozhang307