Skip to content

CUDA version lulesh.cu CalcTimeConstraintsForElems function, stream usage #28

@neozhang307

Description

@neozhang307
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions